Debian Codegraph @

qdos/Makefile.qlzip

raw
1 # Makefile for Zip, ZipNote, ZipCloak and ZipSplit
2
3 # what you can make ...
4 all: zip
5
6 #MAKE = make -f unix/Makefile
7 SHELL = /bin/sh
8
9 # (to use the Gnu compiler, change cc to gcc in CC and BIND)
10 CC = cc
11 BIND = $(CC)
12 AS = $(CC) -c
13 E =
14 CPP = /lib/cpp
15
16 # probably can change this to 'install' if you have it
17 INSTALL = cp
18
19 # target directories - where to install executables and man pages to
20 prefix = /usr/local
21 BINDIR = $(prefix)/bin
22 manext=1
23 MANDIR = $(prefix)/man/man$(manext)
24 ZIPMANUAL = MANUAL
25
26 # flags
27 # CFLAGS flags for C compile
28 # LFLAGS1 flags after output file spec, before obj file list
29 # LFLAGS2 flags after obj file list (libraries, etc)
30 CFLAGS = -O2 -fno-strength-reduce -I. -DUNIX -DQLZIP -DASM_CRC
31 LFLAGS1 =
32 LFLAGS2 = -s
33
34 # object file lists
35 OBJZ = zip.o zipfile.o zipup.o fileio.o util.o globals.o crypt.o ttyio.o \
36 unix.o crc_gcc.o crc32.o qdos.o
37 OBJI = deflate.o trees.o
38 OBJA =
39 OBJU = zipfile_.o fileio_.o util_.o globals.o unix_.o
40 OBJN = zipnote.o $(OBJU)
41 OBJC = zipcloak.o $(OBJU) crc32_.o crypt_.o ttyio.o
42 OBJS = zipsplit.o $(OBJU)
43
44 ZIP_H = zip.h ziperr.h tailor.h unix/osdep.h
45
46 # suffix rules
47 .SUFFIXES:
48 .SUFFIXES: _.o .o .c .doc .1
49 .c_.o:
50 rm -f $*_.c; ln $< $*_.c
51 $(CC) -c $(CFLAGS) -DUTIL $*_.c
52 rm -f $*_.c
53 .c.o:
54 $(CC) -c $(CFLAGS) $<
55
56 .1.doc:
57 nroff -man $< | col -b | uniq > $@
58
59 # rules for zip, zipnote, zipcloak, zipsplit, and the Zip MANUAL.
60 $(OBJZ): $(ZIP_H)
61 $(OBJI): $(ZIP_H)
62 $(OBJN): $(ZIP_H)
63 $(OBJS): $(ZIP_H)
64 $(OBJC): $(ZIP_H)
65 zip.o zipup.o crypt.o fileio.o zipfile.o: crc32.h
66 zipcloak.o crc32_.o crypt_.o fileio_.o zipfile_.o: crc32.h
67 zip.o zipup.o crypt.o ttyio.o zipcloak.o crypt_.o: crypt.h
68 zip.o zipup.o zipnote.o zipcloak.o zipsplit.o: revision.h
69 zip.o crypt.o ttyio.o zipcloak.o crypt_.o: ttyio.h
70 zipup.o: unix/zipup.h
71
72 match.o: match.S
73 $(CPP) match.S > _match.s
74 $(AS) _match.s
75 mv _match.o match.o
76 rm -f _match.s
77
78 unix.o: unix/unix.c
79 $(CC) -c $(CFLAGS) unix/unix.c
80
81 unix_.o: unix/unix.c
82 rm -f $*_.c; ln unix/unix.c $*_.c
83 $(CC) -c $(CFLAGS) -DUTIL $*_.c
84 rm -f $*_.c
85
86 qdos.o: qdos/qdos.c
87 $(CC) -c $(CFLAGS) qdos/qdos.c
88
89 crc_gcc.o: crc_i386.S # 32bit, GNU AS
90 gcc -O3 -I. -DASM_CRC -Di386 -x assembler-with-cpp -c -o $@ crc_i386.S
91
92 ZIPS = zip$E zipnote$E zipsplit$E zipcloak$E
93
94 zips: $(ZIPS)
95 zipsman: $(ZIPS) $(ZIPMANUAL)
96
97 zip$E: $(OBJZ) $(OBJI) $(OBJA)
98 $(BIND) -o qlzip$E $(LFLAGS1) $(OBJZ) $(OBJI) $(OBJA) $(LFLAGS2)
99 zipnote$E: $(OBJN)
100 $(BIND) -o zipnote$E $(LFLAGS1) $(OBJN) $(LFLAGS2)
101 zipcloak$E: $(OBJC)
102 $(BIND) -o zipcloak$E $(LFLAGS1) $(OBJC) $(LFLAGS2)
103 zipsplit$E: $(OBJS)
104 $(BIND) -o zipsplit$E $(LFLAGS1) $(OBJS) $(LFLAGS2)
105
106 $(ZIPMANUAL): man/zip.1
107 nroff -man man/zip.1 | col -b | uniq > $(ZIPMANUAL)
108
109 # install
110 install: $(ZIPS)
111 $(INSTALL) $(ZIPS) $(BINDIR)
112 $(INSTALL) man/zip.1 $(MANDIR)/zip.$(manext)
113
114 uninstall:
115 -cd $(BINDIR); rm -f $(ZIPS)
116 -cd $(MANDIR); rm -f zip.$(manext)
117
118 dist:
119 zip -u9T zip`sed -e '/VERSION/!d' -e 's/.*"\(.*\)".*/\1/' \
120 -e s/[.]//g -e q revision.h` \
121 `awk '/^Makefile/,/vms_zip.rnh/ {print $$1}' < contents`
122
123 flags: unix/configure
124 sh unix/configure "${CC}" "${CFLAGS}"
125
126 # These symbols, when #defined using -D have these effects on compilation:
127 # ZMEM - includes C language versions of memset(), memcpy(),
128 # and memcmp() (util.c).
129 # HAVE_DIRENT_H - use <dirent.h> instead of <sys/dir.h>
130 # NODIR - for 3B1, which has neither getdents() nor opendir().
131 # HAVE_NDIR_H - use <ndir.h> (unix/unix.c).
132 # HAVE_SYS_DIR_H - use <sys/dir.h>
133 # HAVE_SYS_NDIR_H - use <sys/ndir.h>
134 # UTIL - select routines for utilities (note, cloak, split)
135 # NO_RMDIR - remove directories using a system("rmdir ...") call.
136 # NO_PROTO - cannot handle ANSI prototypes
137 # NO_CONST - cannot handle ANSI const
138
139 # Generic targets:
140
141 # end of Makefile