1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
|
#
# Makefile for G0FRD CW tutor for UNIX flavours
#
# The following UNIX variants are available:
#
# Linux: IBM PC Console running Linux.
# SCO: IBM PC Console running SCO OpenServer.
# UW: IBM PC Console running SCO UnixWare.
#
# select the C compiler
#CC = gcc - for Linux
#CC = cc - for SCO OpenServer
#CC = cc - for SCO UnixWare
CC = gcc
# C compiler flags necessary to compile the programs correctly
#CFLAGS = -DLINUX - for Linux
#CFLAGS = -DSCO - for SCO OpenServer (optional -bELF)
#CFLAGS = -DUNIXWARE - for SCO UnixWare
CFLAGS = -DLINUX
# information for the installation
BINDIR = debian/tmp/usr/bin
MANDIR = debian/tmp/usr/man/man1
OWNER = root:root
MODE = 755
all: bins
# build the tutor binaries
bins: cw cwgen cwcp
cw: cw.h cw.c
$(CC) $(CFLAGS) -o cw cw.c
strip cw
cwgen: cwgen.c
$(CC) $(CFLAGS) -o cwgen cwgen.c
strip cwgen
cwcp: cw.h cwcp.c
$(CC) $(CFLAGS) -I/usr/include/ncurses -o cwcp cwcp.c -lncurses
strip cwcp
# build manpages in different formats; useful for SCO where *roff
# is not available by default
manpages: cw.1.ps cw.1.cat cwgen.1.ps cwgen.1.cat cwcp.1.ps cwcp.1.cat
cw.1.ps: cw.1
-man -t ./cw.1 >|cw.1.ps
cw.1.cat: cw.1
-man ./cw.1 >|cw.1.cat
cwgen.1.ps: cwgen.1
-man -t ./cwgen.1 >|cwgen.1.ps
cwgen.1.cat: cwgen.1
-man ./cwgen.1 >|cwgen.1.cat
cwcp.1.ps: cwcp.1
-man -t ./cwcp.1 >|cwcp.1.ps
cwcp.1.cat: cwcp.1
-man ./cwcp.1 >|cwcp.1.cat
# install the binaries and man pages
install: bins
cp cw $(BINDIR)/unixcw
chown $(OWNER) $(BINDIR)/unixcw
chmod $(MODE) $(BINDIR)/unixcw
cp cwgen $(BINDIR)
chown $(OWNER) $(BINDIR)/cwgen
chmod $(MODE) $(BINDIR)/cwgen
cp cwcp $(BINDIR)
chown $(OWNER) $(BINDIR)/cwcp
chmod $(MODE) $(BINDIR)/cwcp
cp cw.1 $(MANDIR)/unixcw.1
cp cwgen.1 $(MANDIR)/cwgen.1
cp cwcp.1 $(MANDIR)/cwcp.1
cp cwtest1.cw debian/tmp/usr/doc/unixcw/examples
cp cwtest2.cw debian/tmp/usr/doc/unixcw/examples
# install test programs
test1: bins
cp -f cwtest1.cw debian/tmp/usr/doc/unixcw/examples
test2: bins
cp -f cwtest2.cw debian/tmp/usr/doc/unixcw/examples
# uninstall the binaries and man pages
uninstall:
-rm $(BINDIR)/cw $(BINDIR)/cwgen $(BINDIR)/cwcp
-rm $(MANDIR)/cw.1.gz $(MANDIR)/cwgen.1.gz $(MANDIR)/cwcp.1.gz
# clear up for a rebuild
clean:
-rm -f *.o cw cwgen cwcp *.1.ps *.1.cat
# completely remove
clobber: clean uninstall
|