| 1 |
include /etc/ql.mak |
| 2 |
|
| 3 |
# Makefile for Zip, ZipNote, ZipCloak and ZipSplit |
| 4 |
|
| 5 |
MAKE = make |
| 6 |
SHELL = /bin/sh |
| 7 |
|
| 8 |
# |
| 9 |
BIND = $(CC) |
| 10 |
|
| 11 |
# probably can change this to 'install' if you have it |
| 12 |
INSTALL = cp |
| 13 |
|
| 14 |
# target directories - where to install executables and man pages to |
| 15 |
BINDIR = |
| 16 |
manext=1 |
| 17 |
MANDIR = |
| 18 |
ZIPMANUAL = MANUAL |
| 19 |
|
| 20 |
# flags |
| 21 |
# CFLAGS flags for C compile |
| 22 |
# LFLAGS1 flags after output file spec, before obj file list |
| 23 |
# LFLAGS2 flags after obj file list (libraries, etc) |
| 24 |
CFLAGS = -O -DASMV -DASM_CRC |
| 25 |
LFLAGS1 = -v |
| 26 |
#LFLAGS2 = -lutime |
| 27 |
|
| 28 |
all: zip |
| 29 |
|
| 30 |
# object file lists |
| 31 |
OBJZ = zip.o zipfile.o zipup.o fileio.o util.o globals.o crypt.o qdos.o ttyio.o |
| 32 |
OBJI = deflate.o trees.o qfileio.o crc32.o |
| 33 |
OBJA = config.o crc68.o match.o |
| 34 |
# crc32.o |
| 35 |
OBJQ = qdos_.o config.o qfileio_.o |
| 36 |
OBJU = zipfile_.o fileio_.o util_.o globals.o $(OBJQ) |
| 37 |
OBJN = zipnote.o $(OBJU) |
| 38 |
OBJC = zipcloak.o $(OBJU) crc32_.o crypt_.o |
| 39 |
OBJS = zipsplit.o $(OBJU) |
| 40 |
|
| 41 |
|
| 42 |
# suffix rules |
| 43 |
.SUFFIXES: |
| 44 |
.SUFFIXES: _.o .o .c .doc .1 |
| 45 |
.c_.o: |
| 46 |
rm -f $*_.c; ln $< $*_.c |
| 47 |
$(CC) $(CFLAGS) -DUTIL -c $*_.c |
| 48 |
rm -f $*_.c |
| 49 |
.c.o: |
| 50 |
$(CC) $(CFLAGS) -c $< |
| 51 |
|
| 52 |
.1.doc: |
| 53 |
nroff -man $< | col -b | uniq > $@ |
| 54 |
|
| 55 |
# rules for zip, zipnote, zipcloak, zipsplit, and zip.doc. |
| 56 |
$(OBJZ): zip.h ziperr.h tailor.h |
| 57 |
$(OBJI): zip.h ziperr.h tailor.h |
| 58 |
$(OBJN): zip.h ziperr.h tailor.h |
| 59 |
$(OBJS): zip.h ziperr.h tailor.h |
| 60 |
$(OBJC): zip.h ziperr.h tailor.h |
| 61 |
zip.o zipup.o crc32.o crypt.o fileio.o zipfile.o: crc32.h |
| 62 |
zipcloak.o crc32_.o crypt_.o fileio_.o zipfile_.o: crc32.h |
| 63 |
zip.o zipup.o crypt.o zipup_.o zipcloak.o crypt_.o: crypt.h |
| 64 |
|
| 65 |
qfileio.o: qdos/qfileio.c |
| 66 |
cp qdos/qfileio.c qfileio.c |
| 67 |
$(CC) $(CFLAGS) -c qfileio.c |
| 68 |
rm -f qfileio.c |
| 69 |
|
| 70 |
qfileio_.o: qdos/qfileio.c |
| 71 |
cp qdos/qfileio.c qfileio_.c |
| 72 |
$(CC) $(CFLAGS) -DUTIL -c qfileio_.c |
| 73 |
rm -f qfileio_.c |
| 74 |
|
| 75 |
match.o: qdos/match.s |
| 76 |
cp qdos/match.s ./_match.s |
| 77 |
$(AS) _match.s -o match.o |
| 78 |
rm -f _match.s |
| 79 |
|
| 80 |
crc68.o: qdos/crc68.s |
| 81 |
cp qdos/crc68.s ./crc68.s |
| 82 |
$(AS) crc68.s -o crc68.o |
| 83 |
rm -f crc68.s |
| 84 |
|
| 85 |
config.o: qdos/config.s |
| 86 |
cp qdos/config.s ./config.x |
| 87 |
$(CC) -c -DZIP config.x -o config.o |
| 88 |
rm -f config.x |
| 89 |
|
| 90 |
ZIPS = zip$E zipnote$E zipsplit$E zipcloak$E |
| 91 |
|
| 92 |
zip.o zipup.o zipnote.o zipcloak.o zipsplit.o: revision.h |
| 93 |
zips: $(ZIPS) |
| 94 |
zipsman: $(ZIPS) $(ZIPMANUAL) |
| 95 |
|
| 96 |
qdos.o: qdos/qdos.c |
| 97 |
cp qdos/qdos.c . |
| 98 |
$(CC) -c -oqdos.o qdos.c |
| 99 |
rm -f qdos.c |
| 100 |
|
| 101 |
qdos_.o: qdos/qdos.c |
| 102 |
cp qdos/qdos.c ./qdos_.c |
| 103 |
$(CC) -DUTIL -c -oqdos_.o qdos_.c |
| 104 |
rm -f qdos_.c |
| 105 |
|
| 106 |
zip$E: $(OBJZ) $(OBJI) $(OBJA) |
| 107 |
$(BIND) -o zip$E $(LFLAGS1) $(OBJZ) $(OBJI) $(OBJA) $(LFLAGS2) |
| 108 |
zipnote$E: $(OBJN) |
| 109 |
$(BIND) -o zipnote$E $(LFLAGS1) $(OBJN) $(LFLAGS2) |
| 110 |
zipcloak$E: $(OBJC) |
| 111 |
$(BIND) -o zipcloak$E $(LFLAGS1) $(OBJC) $(LFLAGS2) |
| 112 |
zipsplit$E: $(OBJS) |
| 113 |
$(BIND) -o zipsplit$E $(LFLAGS1) $(OBJS) $(LFLAGS2) |
| 114 |
|
| 115 |
$(ZIPMANUAL): man/zip.1 |
| 116 |
nroff -man man/zip.1 | col -b | uniq > $(ZIPMANUAL) |
| 117 |
|
| 118 |
# install |
| 119 |
install: $(ZIPS) |
| 120 |
$(INSTALL) $(ZIPS) $(BINDIR) |
| 121 |
$(INSTALL) man/zip.1 $(MANDIR)/zip.$(manext) |
| 122 |
|
| 123 |
uninstall: |
| 124 |
-cd $(BINDIR); rm -f $(ZIPS) |
| 125 |
-cd $(MANDIR); rm -f zip.$(manext) |
| 126 |
|
| 127 |
flags: configure |
| 128 |
sh configure flags |
| 129 |
|
| 130 |
# These symbols, when #defined using -D have these effects on compilation: |
| 131 |
# ZMEM - includes C language versions of memset(), memcpy(), and |
| 132 |
# memcmp() (util.c). |
| 133 |
# SYSV - use <sys/dirent.h> and the library opendir() |
| 134 |
# DIRENT - use <sys/dirent.h> and getdents() instead of <sys/dir.h> |
| 135 |
# and opendir(), etc. (fileio.c). |
| 136 |
# NODIR - used for 3B1, which has neither getdents() nor opendir(). |
| 137 |
# NDIR - use "ndir.h" instead of <sys/dir.h> (fileio.c). |
| 138 |
# UTIL - select routines for utilities (note, cloak, and split). |
| 139 |
# PROTO - enable function prototypes. |
| 140 |
# RMDIR - remove directories using a system("rmdir ...") call. |
| 141 |
# CONVEX - for Convex make target. |
| 142 |
# AIX - for AIX make target. |
| 143 |
# LINUX - for linux make target. |
| 144 |
|
| 145 |
# end of Makefile |