-#
-# Makefile for the showkey utility
-#
-CFLAGS = -g
+# showkey -- keystroke echoer
-all: showkey
+# Note: When the version changes, you also have to change the RPM spec file.
+VERS=1.2
+
+CFLAGS = -O
showkey: showkey.c
+ $(CC) -DREVISION=$(VERS) showkey.c -o showkey
+
+showkey.1: showkey.xml
+ xmlto man showkey.xml
-SOURCES = READ.ME showkey.1 Makefile showkey.c showkey.lsm
+clean:
+ rm -f showkey showkey.o splashscreen.h showkey.1 *.rpm *.tar.gz
-showkey.tar: $(SOURCES)
- tar -cvf showkey.tar $(SOURCES)
-showkey.tar.gz: showkey.tar
- gzip showkey.tar
+install: showkey.1
+ cp showkey /usr/bin/showkey
+ cp showkey.1 /usr/share/man/man1
-showkey.shar: $(SOURCES)
- shar $(SOURCES) >showkey.shar
+uninstall:
+ rm /usr/bin/showkey
+ rm /usr/share/man/man1/showkey.1
-clean:
- rm -f showkey showkey.tar showkey.tar.gz showkey.shar
+SOURCES = READ.ME Makefile showkey.c showkey.xml showkey.lsm showkey.spec
+
+showkey-$(VERS).tar.gz: $(SOURCES) showkey.1
+ @ls $(SOURCES) showkey.1 | sed s:^:showkey-$(VERS)/: >MANIFEST
+ @(cd ..; ln -s showkey showkey-$(VERS))
+ (cd ..; tar -czvf showkey/showkey-$(VERS).tar.gz `cat showkey/MANIFEST`)
+ @(cd ..; rm showkey-$(VERS))
+
+dist: showkey-$(VERS).tar.gz
+
+RPMROOT=/usr/src/redhat
+RPM = rpm
+RPMFLAGS = -ba
+rpm: dist
+ cp showkey-$(VERS).tar.gz $(RPMROOT)/SOURCES;
+ cp showkey.spec $(RPMROOT)/SPECS
+ cd $(RPMROOT)/SPECS; $(RPM) $(RPMFLAGS) showkey.spec
+ cp $(RPMROOT)/RPMS/`arch|sed 's/i[4-9]86/i386/'`/showkey-$(VERS)*.rpm .
+ cp $(RPMROOT)/SRPMS/showkey-$(VERS)*.src.rpm .
until some unexpected situation pops up and you have to have it. Then you
get to be mugged by the details of tty-interface code, yippee. Never again!
-Runs under System V or Linux. Could be POSIXified almost trivially.
-
-You may find updates and related resources via WWW
-at http://www.tuxedo.org/~esr/home.html.
+You may find updates and related resources via WWW at
+<http://www.tuxedo.org/~esr/>.
* Invoke this (no arguments needed) to see keycap-to-keystrokes mappings.
*
* by Eric S. Raymond <esr@snark.thyrsus.com>, 1 Nov 88
- * fix for little-endian machines 21 Oct 1996.
+ * - fix for little-endian machines 21 Oct 1996.
+ * - cleanup and modern packaging (version 1.3), 1 Aug 2002.
*/
#include <stdio.h>
#include <termio.h>