File: Makefile

package info (click to toggle)
unzip 5.52-9etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 5,776 kB
  • ctags: 7,140
  • sloc: ansic: 49,152; cpp: 3,978; makefile: 2,310; asm: 1,583; sh: 91
file content (219 lines) | stat: -rw-r--r-- 6,679 bytes parent folder | download | duplicates (5)
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# Makefile for UnZip 5.50 and later:  Human68k with gcc        NIIMI Satoshi
#
# The original Makefile maybe works fine, but X680x0 is too slow
# to process it.  So I split out needed part.
#
# Last revised:  27 Feb 01
#
# 1999/09/23: Modified by Shimazaki Ryo.

ifeq "$(TARGET)" "X68030"
COPT = -m68020-40
AOPT = -m68020
LDFLAGS = -L/usr/local/lib/lib060
endif

CC = gcc2
CFLAGS = $(COPT) -Wall -O2 -I. -fomit-frame-pointer -fstrength-reduce \
         -DHAVE_TWONCALL_H -D__DOS_INLINE__ -DASM_CRC -DASM_INFLATECODES
#LDFLAGS = -Wl,-x
LIBS = -lhmem -lttyi -lsignal

AS = g2as
ASFLAGS = $(AOPT) -1 -c4 -y

# UnZipSFX flags
XC = -DSFX

# fUnZip flags
FC = -DFUNZIP

# object files
OBJS = unzip.o crc_68.o crctab.o crypt.o envargs.o explode.o extract.o \
	fileio.o globals.o inflate.o flate.o list.o match.o process.o \
	ttyio.o unreduce.o unshrink.o zipinfo.o human68k.o
OBJX = unzipsfx.o crc_68.o crctab_.o crypt_.o extract_.o fileio_.o globals_.o \
	inflate_.o flate_.o match_.o process_.o ttyio_.o human68k_.o
OBJF = funzip.o crc_68.o cryptf.o globalsf.o inflatef.o flatef.o ttyiof.o

UNZIP_H = unzip.h unzpriv.h globals.h

UNZIPS = unzip.x unzipsfx.x funzip.x
DOCS = unzip.txt unzipsfx.txt zipinfo.txt funzip.txt

.c.o:
	$(CC) $(CFLAGS) -I. -c $< -o $@

# for debugging
.c.s:
	$(CC) $(CFLAGS) -c $< -o $@

all:		unzips
unzips:		$(UNZIPS)
docs:		$(DOCS)
unzipsman:	unzips docs
unzipsdocs:	unzips docs

clean:
	rm -f $(OBJS) $(OBJF) $(OBJX) $(UNZIPS)

unzip.x: $(OBJS)
	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)

unzipsfx.x: $(OBJX)
	$(CC) $(LDFLAGS) -o $@ $(OBJX) $(LIBS)

funzip.x: $(OBJF)
	$(CC) $(LDFLAGS) -o $@ $(OBJF) $(LIBS)

#crc32.o:	crc32.c $(UNZIP_H) zip.h
crctab.o:	crctab.c $(UNZIP_H) zip.h
crypt.o:	crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h
envargs.o:	envargs.c $(UNZIP_H)
explode.o:	explode.c $(UNZIP_H)
extract.o:	extract.c $(UNZIP_H) crypt.h
fileio.o:	fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h
funzip.o:	funzip.c $(UNZIP_H) crypt.h ttyio.h tables.h
globals.o:	globals.c $(UNZIP_H)
inflate.o:	inflate.c inflate.h $(UNZIP_H)
list.o:		list.c $(UNZIP_H)
match.o:	match.c $(UNZIP_H)
process.o:	process.c $(UNZIP_H)
ttyio.o:	ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
unreduce.o:	unreduce.c $(UNZIP_H)
unshrink.o:	unshrink.c $(UNZIP_H)
unzip.o:	unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
zipinfo.o:	zipinfo.c $(UNZIP_H)

crctab_.o:	crctab.c $(UNZIP_H) zip.h			# unzipsfx
	$(CC) $(CFLAGS) $(XC) -c $< -o $@

crypt_.o:	crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h	# unzipsfx
	$(CC) $(CFLAGS) $(XC) -c $< -o $@

extract_.o:	extract.c $(UNZIP_H) crypt.h			# unzipsfx
	$(CC) $(CFLAGS) $(XC) -c $< -o $@

fileio_.o:	fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h	# unzipsfx
	$(CC) $(CFLAGS) $(XC) -c $< -o $@

globals_.o:	globals.c $(UNZIP_H)				# unzipsfx
	$(CC) $(CFLAGS) $(XC) -c $< -o $@

inflate_.o:	inflate.c inflate.h $(UNZIP_H) crypt.h		# unzipsfx
	$(CC) $(CFLAGS) $(XC) -c $< -o $@

process_.o:	process.c $(UNZIP_H)				# unzipsfx
	$(CC) $(CFLAGS) $(XC) -c $< -o $@

match_.o:	match.c $(UNZIP_H)				# unzipsfx
	$(CC) $(CFLAGS) $(XC) -c $< -o $@

ttyio_.o:	ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h	# unzipsfx
	$(CC) $(CFLAGS) $(XC) -c $< -o $@

unzipsfx.o:	unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h	# unzipsfx
	$(CC) $(CFLAGS) $(XC) -c $< -o $@


cryptf.o:	crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h	# funzip
	$(CC) $(CFLAGS) $(FC) -c $< -o $@

globalsf.o:	globals.c $(UNZIP_H)				# funzip
	$(CC) $(CFLAGS) $(FC) -c $< -o $@

inflatef.o:	inflate.c inflate.h $(UNZIP_H) crypt.h		# funzip
	$(CC) $(CFLAGS) $(FC) -c $< -o $@

ttyiof.o:	ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h	# funzip
	$(CC) $(CFLAGS) $(FC) -c $< -o $@


human68k.o:	human68k/human68k.c $(UNZIP_H)
	$(CC) $(CFLAGS) -I. -c human68k/human68k.c -o $@

human68k_.o:	human68k/human68k.c $(UNZIP_H)			# unzipsfx
	$(CC) $(CFLAGS) $(XC) -I. -c human68k/human68k.c -o $@

crc_68.o:	human68k/crc_68.s
	$(AS) $(ASFLAGS) $< -o $@

flate.o:	human68k/flate.s human68k/g_offs.mac
	$(AS) $(ASFLAGS) $< -o $@

flate_.o:	human68k/flate.s human68k/g_offs_.mac		# unzipsfx
	$(AS) $(ASFLAGS) $< -o $@ -sSFX

flatef.o:	human68k/flate.s human68k/g_offsf.mac		# funzip
	$(AS) $(ASFLAGS) $< -o $@ -sFUNZIP

human68k/g_offs.mac:	human68k/gbloffs.x
	human68k/mkgoff.x >! $@

human68k/g_offs_.mac:	human68k/gbloffs_.x			# unzipsfx
	human68k/mkgoff_.x >! $@

human68k/g_offsf.mac:	human68k/gbloffsf.x			# funzip
	human68k/mkgofff.x >! $@

human68k/gbloffs.x:	gbloffs.c $(UNZIP_H) crypt.h
	$(CC) $(CFLAGS) gbloffs.c -o $@

human68k/gbloffs_.x:	gbloffs.c $(UNZIP_H) crypt.h		# unzipsfx
	$(CC) $(CFLAGS) gbloffs.c -o $@ $(XC)

human68k/gbloffsf.x:	gbloffs.c $(UNZIP_H) crypt.h		# funzip
	$(CC) $(CFLAGS) gbloffs.c -o $@ $(FC)

# the test zipfile
TESTZIP = testmake.zip

# test some basic features of the build
test:	check

check:	unzips
	@if test ! -f $(TESTZIP); then \
	    echo "#####  ERROR:  can't find test file $(TESTZIP)"; exit 1; fi
#
	@echo "#####  testing extraction"
	@./unzip -bo $(TESTZIP) testmake.zipinfo
	@if test ! -f testmake.zipinfo ; then \
	    echo "#####  ERROR:  file extraction from $(TESTZIP) failed"; \
	    exit 1; fi
#
	@echo '#####  testing zipinfo (unzip -Z)'
	@./unzip -Z $(TESTZIP) > testmake.unzip-Z
	@if diff testmake.unzip-Z testmake.zipinfo; then echo "OK."; else \
	    echo "#####  WARNING:  zipinfo output doesn't match stored version"; \
	    echo '#####     (If the only difference is the file times, compare your'; \
	    echo '#####      timezone with the Central European timezone, which is one'; \
	    echo '#####      hour east of Greenwich but effectively 2 hours east'; \
	    echo '#####      during summer Daylight Savings Time.  The upper two'; \
	    echo '#####      lines should correspond to your local time when the'; \
	    echo '#####      files were created, on 19 November 1998 at 10:46pm CET.'; \
	    echo '#####      If the times are consistent, please ignore this warning.)'; \
	    fi
	@rm -f testmake.unzip-Z testmake.zipinfo
#
	@echo '#####  testing unzip -d exdir option'
	@./unzip -bo $(TESTZIP) -d testun notes
	@cat testun/notes
#
	@echo '#####  testing unzip -o and funzip (ignore funzip warning)'
	@./unzip -boq $(TESTZIP) notes -d testun
	@./funzip < $(TESTZIP) > testun/notes2
	@if diff testun/notes testun/notes2; then true; else \
	    echo '#####  ERROR:  funzip output disagrees with unzip'; fi
#
	@echo '#####  testing unzipsfx (self-extractor)'
	@cat unzipsfx.x $(TESTZIP) > testsfx.x
	@chmod 0700 testsfx.x
	@./testsfx -bo notes
	@if diff notes testun/notes; then true; else \
	    echo '#####  ERROR:  unzipsfx file disagrees with unzip'; fi
	@rm -f testsfx.x notes testun/notes testun/notes2
	@rmdir testun
#
	@echo '#####  testing complete.'

# EOF