]>
Commit | Line | Data |
---|---|---|
f6bcfd97 BP |
1 | # Makefile for UnZip, UnZipSFX and fUnZip 24 November 1998 |
2 | # | |
3 | # supported compilers: | |
4 | # - Microsoft C, version 6.00 or higher, for use under OS/2 1.x (16-bit) | |
5 | # - Watcom C/C++, version 9.0+, for use under OS/2 1.x or 2.x+ (16/32-bit) | |
6 | # - emx+gcc, version 0.9c or higher, for use under OS/2 2.x+ (32-bit) | |
7 | # - IBM C Set++, for use under OS/2 2.x+ (32-bit) | |
8 | # - Borland C++, for use under OS/2 2.x+ (32-bit) | |
9 | # - Metaware High C/C++, for use under OS/2 2.x+ (32-bit) | |
10 | # | |
11 | # supported cross-compilers: | |
12 | # - Microsoft C, version 6.0 or 7.0, for use under DOS (16-bit) | |
13 | # - Watcom C/C++, version 9.0+, for use under DOS/Win95/NT (16/32-bit) | |
14 | # - GNU gcc (emx), version 0.9c or higher, for use under DOS/Win95/NT (32-bit) | |
15 | # | |
16 | # supported assemblers: | |
17 | # - Microsoft MASM 6.00 with Microsoft C | |
18 | # - Watcom WASM with Watcom C/C++ | |
19 | # - GNU as with GNU gcc | |
20 | ||
21 | # To use MASM 5.x instead of MASM 6.00: | |
22 | # - set AS="masm -t -Ml" | |
23 | # - set ASEOL=";" | |
24 | ||
25 | # To use, enter "{d,n}make -f os2/makefile.os2" (this makefile depends on its | |
26 | # name being "makefile.os2", and it must be in the os2 subdirectory). | |
27 | ||
28 | # Notes on Microsoft C 6.00 compilation for OS/2: | |
29 | # | |
30 | # The resulting programs can be used under OS/2 protected mode only, not | |
31 | # under DOS. A larger stack has to be used for OS/2 because system calls | |
32 | # use more stack than under DOS; 8k is recommended by Microsoft. | |
33 | ||
34 | # Notes on IBM C Set++, Watcom C/C++, Borland C++ or emx+gcc compilation: | |
35 | # | |
36 | # The resulting programs can be used under protected mode of OS/2 2.x or | |
37 | # higher only, not under OS/2 1.x and not under DOS. | |
38 | # | |
39 | # The NFLAGS macro is used to work around an optimization bug in the IBM | |
40 | # C++ Set compiler; this is fixed by CSD #4, so NFLAGS="" can be used for | |
41 | # all targets below. | |
42 | ||
43 | # Notes on Watcom C/C++ compilation for DOS with the PMODE/W extender: | |
44 | # | |
45 | # You need to add the following section to your \watcom\binb\wlsystem.lnk | |
46 | # file and also need to copy pmodew.exe to the same directory: | |
47 | # | |
48 | # system begin pmodew | |
49 | # option osname='PMODE/W' | |
50 | # libpath %WATCOM%\lib386 | |
51 | # libpath %WATCOM%\lib386\dos | |
52 | # op stub=pmodew.exe | |
53 | # format os2 le | |
54 | # end | |
55 | # | |
56 | # PMODE/W 1.16 or higher is required. See also msdos/README for important | |
57 | # notes about PMODE/W bugs. | |
58 | ||
59 | default: | |
60 | @echo "Enter `$(MAKE) -f os2/makefile.os2 target' from the main" | |
61 | @echo "UnZip directory, where target is one of:" | |
62 | @echo " msc mscdebug mscdos ibm ibmdyn ibmdebug ibmprof" | |
63 | @echo " ibmdll ibmdyndll ibmdebugdll ibmprofdll" | |
64 | @echo " metaware borland gcc gccdyn gccdebug gccdos gccwin32" | |
65 | @echo " watcom watcom16 watcomdos watcom16dos pmodew watcomwin32" | |
66 | ||
67 | # MS C 6.00 for OS/2, 16-bit (should figure out way to split unzip/funzip | |
68 | # compiles so former is always large model and latter always small model...) | |
69 | msc: | |
70 | $(MAKE) -f os2/makefile.os2 all \ | |
71 | CC="cl -nologo -AL -Ocegit -Gs -I. $(FP)" \ | |
72 | CFLAGS="-G2 -Zp1 -W3 -DOS2 -DMSC -DASM_CRC $(LOCAL_UNZIP)" \ | |
73 | NFLAGS="" \ | |
74 | DLLFLAG="" \ | |
75 | AS="ml -nologo -c -Zm -Cp" \ | |
76 | ASFLAGS="-D__LARGE__ -D__286" \ | |
77 | LDFLAGS="-F 2000 -Lp -Fe" \ | |
78 | LDFLAGS2="-link /noe" \ | |
79 | OUT="-Fo" \ | |
80 | OBJ=".obj" \ | |
81 | CRC32="crc_i86" \ | |
82 | CRC32F="crc_i86" \ | |
83 | CRC32X="crc_i86" \ | |
84 | DEF="os2\unzip.def" | |
85 | ||
86 | # MS C 6.00 for OS/2, debug version | |
87 | mscdebug: | |
88 | $(MAKE) -f os2/makefile.os2 all \ | |
89 | CC="cl -nologo -AL -Zi -Od -I. $(FP)" \ | |
90 | CFLAGS="-G2 -Zp1 -W3 -DOS2 -DMSC -DASM_CRC $(LOCAL_UNZIP)" \ | |
91 | NFLAGS="" \ | |
92 | DLLFLAG="" \ | |
93 | AS="ml -nologo -c -Zim -Cp" \ | |
94 | ASFLAGS="-D__LARGE__ -D__286" \ | |
95 | LDFLAGS="-F 2000 -Lp -Fe" \ | |
96 | LDFLAGS2="-link /noe" \ | |
97 | OUT="-Fo" \ | |
98 | OBJ=".obj" \ | |
99 | CRC32="crc_i86" \ | |
100 | CRC32F="crc_i86" \ | |
101 | CRC32X="crc_i86" \ | |
102 | DEF="os2\unzip.def" | |
103 | ||
104 | # cross-compilation for MS-DOS with MS C 6.00 (same comment as above...formerly; | |
105 | # now unzip is medium model again, with [almost] all strings in far memory) | |
106 | mscdos: | |
107 | $(MAKE) -f os2/makefile.os2 all \ | |
108 | CC="cl -nologo -AM -Oaict -Gs -I. $(FP)" \ | |
109 | CFLAGS="-Zp1 -W3 -DASM_CRC $(LOCAL_UNZIP)" \ | |
110 | NFLAGS="" \ | |
111 | DLLFLAG="" \ | |
112 | AS="ml -nologo -c -Zm -Cp" \ | |
113 | ASFLAGS="-D__MEDIUM__" \ | |
114 | LDFLAGS="-F 0C00 -Lr -Fe" \ | |
115 | LDFLAGS2="-link /noe /exe" \ | |
116 | OUT="-Fo" \ | |
117 | OBJ=".obj" \ | |
118 | CRC32="crc_i86" \ | |
119 | CRC32F="crc_i86" \ | |
120 | CRC32X="crc_i86" \ | |
121 | OBJU2="msdos.obj" \ | |
122 | OBJX2="msdos_.obj" \ | |
123 | OSDEP_H="msdos/doscfg.h" | |
124 | ||
125 | # IBM C Set, statically linked runtime | |
126 | ibm: | |
127 | $(MAKE) -f os2/makefile.os2 all \ | |
128 | CC="icc -Q -O -Gs -I." \ | |
129 | CFLAGS="-Sm -Sp1 -DOS2 $(LOCAL_UNZIP)" \ | |
130 | NFLAGS="" \ | |
131 | DLLFLAG="" \ | |
132 | LDFLAGS="-B/ST:0x50000 -Fe" \ | |
133 | LDFLAGS2="" \ | |
134 | OUT="-Fo" \ | |
135 | OBJ=".obj" \ | |
136 | DEF="os2\unzip.def" | |
137 | ||
138 | # IBM C Set, dynamically linked runtime | |
139 | ibmdyn: | |
140 | $(MAKE) -f os2/makefile.os2 all \ | |
141 | CC="icc -Q -O -Gs -Gd -I." \ | |
142 | CFLAGS="-Sm -Sp1 -DOS2 $(LOCAL_UNZIP)" \ | |
143 | NFLAGS="" \ | |
144 | DLLFLAG="" \ | |
145 | LDFLAGS="-B/ST:0x50000 -Fe" \ | |
146 | LDFLAGS2="" \ | |
147 | OUT="-Fo" \ | |
148 | OBJ=".obj" \ | |
149 | DEF="os2\unzip.def" | |
150 | ||
151 | # IBM C Set, debug version | |
152 | ibmdebug: | |
153 | $(MAKE) -f os2/makefile.os2 all \ | |
154 | CC="icc -Q -Ti -I." \ | |
155 | CFLAGS="-Sm -Sp1 -D__DEBUG_ALLOC__ -DOS2 $(LOCAL_UNZIP)" \ | |
156 | NFLAGS="" \ | |
157 | DLLFLAG="" \ | |
158 | LDFLAGS="-B/ST:0x50000 -Fe" \ | |
159 | LDFLAGS2="" \ | |
160 | OUT="-Fo" \ | |
161 | OBJ=".obj" \ | |
162 | DEF="os2\unzip.def" | |
163 | ||
164 | # IBM C Set, profiling version for PROFIT | |
165 | ibmprof: | |
166 | $(MAKE) -f os2/makefile.os2 all \ | |
167 | CC="icc -Q -O -Gs -Gh -Ti -I." \ | |
168 | CFLAGS="-Sm -Sp1 -DOS2 $(LOCAL_UNZIP)" \ | |
169 | NFLAGS="" \ | |
170 | DLLFLAG="" \ | |
171 | LDFLAGS="-B/ST:0x50000 -Fe" \ | |
172 | LDFLAGS2="cppopa3.obj" \ | |
173 | OUT="-Fo" \ | |
174 | OBJ=".obj" \ | |
175 | DEF="os2\unzip.def" | |
176 | ||
177 | # IBM C Set, statically linked runtime | |
178 | ibmdll: | |
179 | $(MAKE) -f os2/makefile.os2 dll \ | |
180 | CC="icc -Q -O -Gs -I." \ | |
181 | CFLAGS="-Sm -Sp1 -DOS2 $(LOCAL_UNZIP)" \ | |
182 | NFLAGS="" \ | |
183 | DLLFLAG="-Gm -Ge- -DDLL -DOS2DLL -DAPI_DOC" \ | |
184 | LDFLAGS="-Fe" \ | |
185 | LDFLAGS2="" \ | |
186 | OUT="-Fo" \ | |
187 | OBJ=".obj" \ | |
188 | DLLDEF="os2\rexxapi.def" \ | |
189 | STUBDEF="os2\stub.def" \ | |
190 | DEF="os2\unzip.def" \ | |
191 | APILIB="REXX.lib" | |
192 | ||
193 | # IBM C Set, dynamically linked runtime | |
194 | ibmdyndll: | |
195 | $(MAKE) -f os2/makefile.os2 dll \ | |
196 | CC="icc -Q -O -Gs -Gd -I." \ | |
197 | CFLAGS="-Sm -Sp1 -DOS2 $(LOCAL_UNZIP)" \ | |
198 | NFLAGS="" \ | |
199 | DLLFLAG="-Gm -Ge- -DDLL -DOS2DLL -DAPI_DOC" \ | |
200 | LDFLAGS="-Fe" \ | |
201 | LDFLAGS2="" \ | |
202 | OUT="-Fo" \ | |
203 | OBJ=".obj" \ | |
204 | DLLDEF="os2\rexxapi.def" \ | |
205 | STUBDEF="os2\stub.def" \ | |
206 | DEF="os2\unzip.def" \ | |
207 | APILIB="REXX.lib" | |
208 | ||
209 | # IBM C Set, debug version | |
210 | ibmdebugdll: | |
211 | $(MAKE) -f os2/makefile.os2 dll \ | |
212 | CC="icc -Q -Ti -I." \ | |
213 | CFLAGS="-Sm -Sp1 -D__DEBUG_ALLOC__ -DOS2 $(LOCAL_UNZIP)" \ | |
214 | NFLAGS="" \ | |
215 | DLLFLAG="-Gm -Ge- -DDLL -DOS2DLL -DAPI_DOC" \ | |
216 | LDFLAGS="-Fe" \ | |
217 | LDFLAGS2="" \ | |
218 | OUT="-Fo" \ | |
219 | OBJ=".obj" \ | |
220 | DLLDEF="os2\rexxapi.def" \ | |
221 | STUBDEF="os2\stub.def" \ | |
222 | DEF="os2\unzip.def" \ | |
223 | APILIB="REXX.lib" | |
224 | ||
225 | # IBM C Set, profiling version for PROFIT | |
226 | ibmprofdll: | |
227 | $(MAKE) -f os2/makefile.os2 dll \ | |
228 | CC="icc -Q -O -Gs -Gh -Ti -I." \ | |
229 | CFLAGS="-Gm -Sm -Sp1 -DOS2 $(LOCAL_UNZIP)" \ | |
230 | NFLAGS="" \ | |
231 | DLLFLAG="-Gm -Ge- -DDLL -DOS2DLL -DAPI_DOC" \ | |
232 | LDFLAGS="-Fe" \ | |
233 | LDFLAGS2="profit.obj" \ | |
234 | OUT="-Fo" \ | |
235 | OBJ=".obj" \ | |
236 | DLLDEF="os2\rexxapi.def" \ | |
237 | STUBDEF="os2\stub.def" \ | |
238 | DEF="os2\unzip.def" \ | |
239 | APILIB="REXX.lib" | |
240 | ||
241 | # Watcom C/386 9.0 or higher | |
242 | watcom: | |
243 | $(MAKE) -f os2/makefile.os2 all \ | |
244 | CC="wcl386 -bt=os2v2 -zq -Ox -s -I." \ | |
245 | CFLAGS="-Zp1 -DOS2 -DASM_CRC $(LOCAL_UNZIP)" \ | |
246 | NFLAGS="" \ | |
247 | DLLFLAG="" \ | |
248 | AS="wasm -bt=os2v2 -zq -3 -mf" \ | |
249 | ASFLAGS="" \ | |
250 | LDFLAGS="-k0x50000 -x -l=os2v2 -Fe=" \ | |
251 | LDFLAGS2="" \ | |
252 | OUT="-Fo" \ | |
253 | OBJ=".obj" \ | |
254 | CRC32="crc_i386" \ | |
255 | CRC32F="crc_i386" \ | |
256 | CRC32X="crc_i386" \ | |
257 | DEF="" \ | |
258 | DIRSEP="\\" \ | |
259 | AS_DIRSEP="\\" | |
260 | ||
261 | # Watcom C/286 9.0 or higher | |
262 | watcom16: | |
263 | $(MAKE) -f os2/makefile.os2 all \ | |
264 | CC="wcl -bt=os2 -zq -ml -Ox -s -I." \ | |
265 | CFLAGS="-Zp1 -DOS2 $(LOCAL_UNZIP)" \ | |
266 | NFLAGS="" \ | |
267 | DLLFLAG="" \ | |
268 | AS="wasm -bt=os2 -zq -2 -ml" \ | |
269 | ASFLAGS="" \ | |
270 | LDFLAGS="-k0x2000 -x -l=os2 -Fe=" \ | |
271 | LDFLAGS2="" \ | |
272 | OUT="-Fo" \ | |
273 | OBJ=".obj" \ | |
274 | CRC32="crc_i86" \ | |
275 | CRC32F="crc_i86" \ | |
276 | CRC32X="crc_i86" \ | |
277 | DIRSEP="\\" \ | |
278 | AS_DIRSEP="\\" | |
279 | ||
280 | # Watcom C/386 9.0 or higher, crosscompilation for DOS, DOS4GW extender | |
281 | watcomdos: | |
282 | $(MAKE) -f os2/makefile.os2 all \ | |
283 | CC="wcl386 -bt=dos4g -zq -Ox -s -I." \ | |
284 | CFLAGS="-Zp1 -DMSDOS -DASM_CRC $(LOCAL_UNZIP)" \ | |
285 | NFLAGS="" \ | |
286 | DLLFLAG="" \ | |
287 | AS="wasm -bt=dos4g -zq -3 -mf" \ | |
288 | ASFLAGS="" \ | |
289 | LDFLAGS="-k0x50000 -x -l=dos4g -Fe=" \ | |
290 | LDFLAGS2="" \ | |
291 | OUT="-Fo" \ | |
292 | OBJ=".obj" \ | |
293 | CRC32="crc_i386" \ | |
294 | CRC32F="crc_i386" \ | |
295 | CRC32X="crc_i386" \ | |
296 | OBJU2="msdos.obj" \ | |
297 | OBJX2="msdos_.obj" \ | |
298 | OSDEP_H="msdos/doscfg.h" \ | |
299 | DIRSEP="\\" \ | |
300 | AS_DIRSEP="\\" | |
301 | ||
302 | # Watcom C/386 9.0 or higher, crosscompilation for DOS, PMODE/W extender | |
303 | pmodew: | |
304 | $(MAKE) -f os2/makefile.os2 all \ | |
305 | CC="wcl386 -bt=dos4g -zq -Ox -s -I." \ | |
306 | CFLAGS="-Zp1 -DMSDOS -DASM_CRC $(LOCAL_UNZIP)" \ | |
307 | NFLAGS="" \ | |
308 | DLLFLAG="" \ | |
309 | AS="wasm -bt=dos4g -zq -3 -mf" \ | |
310 | ASFLAGS="" \ | |
311 | LDFLAGS="-k0x50000 -x -l=pmodew -Fe=" \ | |
312 | LDFLAGS2="" \ | |
313 | OUT="-Fo" \ | |
314 | OBJ=".obj" \ | |
315 | CRC32="crc_i386" \ | |
316 | CRC32F="crc_i386" \ | |
317 | CRC32X="crc_i386" \ | |
318 | OBJU2="msdos.obj" \ | |
319 | OBJX2="msdos_.obj" \ | |
320 | OSDEP_H="msdos/doscfg.h" \ | |
321 | DIRSEP="\\" \ | |
322 | AS_DIRSEP="\\" | |
323 | ||
324 | # Watcom C/286 9.0 or higher, crosscompilation for DOS | |
325 | watcom16dos: | |
326 | $(MAKE) -f os2/makefile.os2 all \ | |
327 | CC="wcl -bt=dos -zq -ml -Ox -s -I." \ | |
328 | CFLAGS="-Zp1 -DMSDOS $(LOCAL_UNZIP)" \ | |
329 | NFLAGS="" \ | |
330 | DLLFLAG="" \ | |
331 | AS="wasm -bt=dos -0 -mm" \ | |
332 | ASFLAGS="-D__MEDIUM__" \ | |
333 | LDFLAGS="-k0xC00 -x -l=dos -Fe=" \ | |
334 | LDFLAGS2="" \ | |
335 | OUT="-Fo" \ | |
336 | OBJ=".obj" \ | |
337 | OBJU2="msdos.obj" \ | |
338 | OBJX2="msdos_.obj" \ | |
339 | OSDEP_H="msdos/doscfg.h" \ | |
340 | DIRSEP="\\" \ | |
341 | AS_DIRSEP="\\" | |
342 | ||
343 | # Watcom C/386 9.0 or higher, crosscompilation for Win95/NT | |
344 | watcomwin32: | |
345 | $(MAKE) -f os2/makefile.os2 all \ | |
346 | CC="wcl386 -bt=NT -zq -Ox -s -I." \ | |
347 | CFLAGS="-Zp1 -DWIN32 -DASM_CRC $(LOCAL_UNZIP)" \ | |
348 | NFLAGS="" \ | |
349 | DLLFLAG="" \ | |
350 | AS="wasm -bt=NT -zq -3 -mf" \ | |
351 | ASFLAGS="" \ | |
352 | LDFLAGS="-k0x50000 -x -l=NT -Fe=" \ | |
353 | LDFLAGS2="" \ | |
354 | OUT="-Fo" \ | |
355 | OBJ=".obj" \ | |
356 | OBJU2="win32.obj nt.obj" \ | |
357 | OBJX2="win32_.obj nt_.obj" \ | |
358 | CRC32="crc_i386" \ | |
359 | CRC32F="crc_i386" \ | |
360 | CRC32X="crc_i386" \ | |
361 | DEF="" \ | |
362 | DIRSEP="\\" \ | |
363 | AS_DIRSEP="\\" | |
364 | ||
365 | # MetaWare High C/C++ 3.2 | |
366 | metaware: | |
367 | $(MAKE) -f os2/makefile.os2 all \ | |
368 | CC="hc -O2 -I." \ | |
369 | CFLAGS="-D__32BIT__ -DOS2 $(LOCAL_UNZIP)" \ | |
370 | NFLAGS="" \ | |
371 | DLLFLAG="" \ | |
372 | LDFLAGS="-o " \ | |
373 | LDFLAGS2="" \ | |
374 | OUT="-o ./" \ | |
375 | OBJ=".obj" \ | |
376 | DEF="-Hdef=os2\unzip.def" | |
377 | ||
378 | # Borland C++ | |
379 | borland: | |
380 | $(MAKE) -f os2/makefile.os2 all \ | |
381 | CC="bcc -O -I. -Ios2" \ | |
382 | CFLAGS="-w- -D__cdecl -D__32BIT__ -DOS2 $(LOCAL_UNZIP)" \ | |
383 | NFLAGS="" \ | |
384 | DLLFLAG="" \ | |
385 | LDFLAGS="-e" \ | |
386 | LDFLAGS2="" \ | |
387 | OUT="-o" \ | |
388 | OBJ=".obj" \ | |
389 | DEF="-sDos2\unzip.def" | |
390 | ||
391 | # emx, gcc, OMF format, statically linked C runtime | |
392 | gcc: | |
393 | $(MAKE) -f os2/makefile.os2 all \ | |
394 | CC="gcc -Zomf -O -I." \ | |
395 | CFLAGS="-Wall -DOS2 -DASM_CRC $(LOCAL_UNZIP)" \ | |
396 | NFLAGS="" \ | |
397 | DLLFLAG="" \ | |
398 | AS="gcc -Zomf" \ | |
399 | ASFLAGS="-Di386" \ | |
400 | LDFLAGS="-o ./" \ | |
401 | LDFLAGS2="-Zsmall-conv -Zstack 320 -Zsys -s" \ | |
402 | OUT="-o" \ | |
403 | OBJ=".obj" \ | |
404 | CRC32="crc_gcc" \ | |
405 | CRC32F="crc_gcc" \ | |
406 | CRC32X="crc_gcc" \ | |
407 | DEF="os2/unzip.def" | |
408 | ||
409 | # emx, gcc, OMF format, dynamically linked C runtime | |
410 | gccdyn: | |
411 | $(MAKE) -f os2/makefile.os2 all \ | |
412 | CC="gcc -Zomf -O -I." \ | |
413 | CFLAGS="-Wall -DOS2 -DASM_CRC $(LOCAL_UNZIP)" \ | |
414 | NFLAGS="" \ | |
415 | DLLFLAG="" \ | |
416 | AS="gcc -Zomf" \ | |
417 | ASFLAGS="-Di386" \ | |
418 | LDFLAGS="-o ./" \ | |
419 | LDFLAGS2="-Zstack 320 -Zcrtdll -s" \ | |
420 | OUT="-o" \ | |
421 | OBJ=".obj" \ | |
422 | CRC32="crc_gcc" \ | |
423 | CRC32F="crc_gcc" \ | |
424 | CRC32X="crc_gcc" \ | |
425 | DEF="os2/unzip.def" | |
426 | ||
427 | # emx, gcc, a.out format, with debug info for gdb | |
428 | gccdebug: | |
429 | $(MAKE) -f os2/makefile.os2 all \ | |
430 | CC="gcc -g -I." \ | |
431 | CFLAGS="-Wall -DOS2 -DASM_CRC $(LOCAL_UNZIP)" \ | |
432 | NFLAGS="" \ | |
433 | DLLFLAG="" \ | |
434 | AS="gcc -g" \ | |
435 | ASFLAGS="-Di386" \ | |
436 | LDFLAGS="-o ./" \ | |
437 | LDFLAGS2="-Zsmall-conv" \ | |
438 | OUT="-o" \ | |
439 | OBJ=".o" \ | |
440 | CRC32="crc_gcc" \ | |
441 | CRC32F="crc_gcc" \ | |
442 | CRC32X="crc_gcc" | |
443 | ||
444 | # emx, gcc, a.out format, cross-compilation for MS-DOS | |
445 | gccdos: | |
446 | $(MAKE) -f os2/makefile.os2 all \ | |
447 | CC="gcc -O -I." \ | |
448 | CFLAGS="-Wall -DMSDOS -DASM_CRC $(LOCAL_UNZIP)" \ | |
449 | NFLAGS="" \ | |
450 | DLLFLAG="" \ | |
451 | AS="gcc" \ | |
452 | ASFLAGS="-Di386" \ | |
453 | LDFLAGS="-o ./" \ | |
454 | LDFLAGS2="-Zsmall-conv -s" \ | |
455 | OUT="-o" \ | |
456 | OBJ=".o" \ | |
457 | CRC32="crc_gcc" \ | |
458 | CRC32F="crc_gcc" \ | |
459 | CRC32X="crc_gcc" \ | |
460 | OBJU2="msdos.o" \ | |
461 | OBJX2="msdos_.o" \ | |
462 | OSDEP_H="msdos/doscfg.h" | |
463 | ||
464 | # emx, gcc, RSXNT, cross-compilation for Win32, statically linked C runtime | |
465 | gccwin32: | |
466 | $(MAKE) -f os2/makefile.os2 all \ | |
467 | CC="gcc -Zwin32 -O2 -I." \ | |
468 | CFLAGS="-Wall -DWIN32 -DASM_CRC $(LOCAL_UNZIP)" \ | |
469 | NFLAGS="" \ | |
470 | DLLFLAG="" \ | |
471 | AS="gcc" \ | |
472 | ASFLAGS="-Di386" \ | |
473 | LDFLAGS="-Zsys -o ./" \ | |
474 | LDFLAGS2="-ladvapi32 -Zsmall-conv -s" \ | |
475 | OUT="-o" \ | |
476 | OBJ=".o" \ | |
477 | CRC32="crc_gcc" \ | |
478 | CRC32F="crc_gcc" \ | |
479 | CRC32X="crc_gcc" \ | |
480 | OBJU2="win32.o nt.o" \ | |
481 | OBJX2="win32_.o nt_.o" \ | |
482 | OBJF2="win32f.o" \ | |
483 | OSDEP_H="win32/w32cfg.h" | |
484 | ||
485 | # variables | |
486 | ||
487 | # LOCAL_UNZIP = -DREENTRANT | |
488 | ||
489 | # default settings for target dependent macros: | |
490 | DIRSEP = / | |
491 | AS_DIRSEP = / | |
492 | ||
493 | OSDEP_H = os2/os2data.h os2/os2cfg.h | |
494 | CRC32 = crc32 | |
495 | CRC32F = crc32f | |
496 | CRC32X = crc32_ | |
497 | ||
498 | OBJU = unzip$(OBJ) $(CRC32)$(OBJ) crctab$(OBJ) crypt$(OBJ) envargs$(OBJ) \ | |
499 | explode$(OBJ) extract$(OBJ) fileio$(OBJ) globals$(OBJ) \ | |
500 | inflate$(OBJ) list$(OBJ) match$(OBJ) process$(OBJ) ttyio$(OBJ) \ | |
501 | unreduce$(OBJ) unshrink$(OBJ) zipinfo$(OBJ) | |
502 | OBJU2 = os2$(OBJ) os2acl$(OBJ) | |
503 | OBJX = unzipsf_$(OBJ) $(CRC32X)$(OBJ) crctab_$(OBJ) crypt_$(OBJ) \ | |
504 | extract_$(OBJ) fileio_$(OBJ) globals_$(OBJ) inflate_$(OBJ) \ | |
505 | match_$(OBJ) process_$(OBJ) ttyio_$(OBJ) | |
506 | OBJX2 = os2_$(OBJ) os2acl_$(OBJ) | |
507 | OBJDLL= api$(OBJ) apihelp$(OBJ) rexxhelp$(OBJ) rexxapi$(OBJ) | |
508 | OBJF = funzip$(OBJ) $(CRC32F)$(OBJ) cryptf$(OBJ) inflatef$(OBJ) \ | |
509 | globalsf$(OBJ) ttyiof$(OBJ) | |
510 | OBJF2 = | |
511 | ||
512 | UNZIP_H = unzip.h unzpriv.h globals.h $(OSDEP_H) | |
513 | ||
514 | # rules | |
515 | ||
516 | .SUFFIXES: .c .asm $(OBJ) | |
517 | ||
518 | .c$(OBJ): | |
519 | $(CC) -c $(CFLAGS) $(DLLFLAG) $< | |
520 | ||
521 | .asm$(OBJ): | |
522 | $(AS) $(ASFLAGS) $< $(ASEOL) | |
523 | ||
524 | # targets | |
525 | ||
526 | all: unzip.exe funzip.exe unzipsfx.exe | |
527 | dll: unzip32.dll unzip.stb funzip.exe unzipsfx.exe | |
528 | ||
529 | unzip.exe: $(OBJU) $(OBJU2) | |
530 | $(CC) $(LDFLAGS)$@ $(DEF) $(OBJU) $(OBJU2) $(LDFLAGS2) | |
531 | ||
532 | funzip.exe: $(OBJF) $(OBJF2) | |
533 | $(CC) $(LDFLAGS)$@ $(DEF) $(OBJF) $(OBJF2) $(LDFLAGS2) | |
534 | ||
535 | unzipsfx.exe: $(OBJX) $(OBJX2) | |
536 | $(CC) $(LDFLAGS)$@ $(DEF) $(OBJX) $(OBJX2) $(LDFLAGS2) | |
537 | ||
538 | unzip32.dll: $(DLLDEF) $(OBJU) $(OBJU2) $(OBJDLL) | |
539 | $(CC) $(DLLFLAG) $(LDFLAGS)$@ $(DLLDEF) $(OBJU) $(OBJDLL) $(OBJU2) $(APILIB) $(LDFLAGS2) | |
540 | ||
541 | unzip.stb: unzipstb$(OBJ) $(STUBDEF) | |
542 | $(CC) $(LDFLAGS)$@ $(STUBDEF) unzipstb$(OBJ) $(LDFLAGS2) | |
543 | copy unzip.stb unzip.exe | |
544 | ||
545 | # dependencies | |
546 | ||
547 | apihelp$(OBJ): apihelp.c $(UNZIP_H) version.h | |
548 | crc32$(OBJ): crc32.c $(UNZIP_H) zip.h | |
549 | crctab$(OBJ): crctab.c $(UNZIP_H) zip.h | |
550 | envargs$(OBJ): envargs.c $(UNZIP_H) | |
551 | explode$(OBJ): explode.c $(UNZIP_H) | |
552 | extract$(OBJ): extract.c $(UNZIP_H) crypt.h | |
553 | fileio$(OBJ): fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h | |
554 | globals$(OBJ): globals.c $(UNZIP_H) | |
555 | inflate$(OBJ): inflate.c $(UNZIP_H) | |
556 | list$(OBJ): list.c $(UNZIP_H) | |
557 | match$(OBJ): match.c $(UNZIP_H) | |
558 | process$(OBJ): process.c $(UNZIP_H) | |
559 | ttyio$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h | |
560 | unreduce$(OBJ): unreduce.c $(UNZIP_H) | |
561 | unshrink$(OBJ): unshrink.c $(UNZIP_H) | |
562 | unzip$(OBJ): unzip.c $(UNZIP_H) crypt.h version.h consts.h | |
563 | api$(OBJ): api.c $(UNZIP_H) version.h | |
564 | zipinfo$(OBJ): zipinfo.c $(UNZIP_H) | |
565 | ||
566 | funzip$(OBJ): funzip.c $(UNZIP_H) crypt.h ttyio.h tables.h # funzip only | |
567 | $(CC) -c $(CFLAGS) funzip.c | |
568 | ||
569 | unzipstb$(OBJ): unzipstb.c # DLL version | |
570 | $(CC) -c $(CFLAGS) unzipstb.c | |
571 | ||
572 | msdos$(OBJ): msdos/msdos.c $(UNZIP_H) version.h # DOS only | |
573 | $(CC) -c $(CFLAGS) msdos$(DIRSEP)msdos.c | |
574 | ||
575 | msdos_$(OBJ): msdos/msdos.c $(UNZIP_H) # DOS unzipsfx | |
576 | $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ msdos$(DIRSEP)msdos.c | |
577 | ||
578 | win32$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h version.h # Win32 only | |
579 | $(CC) -c $(CFLAGS) win32$(DIRSEP)win32.c | |
580 | ||
581 | nt$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h # Win32 only | |
582 | $(CC) -c $(CFLAGS) win32$(DIRSEP)nt.c | |
583 | ||
584 | win32_$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h # Win32 unzipsfx | |
585 | $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ win32$(DIRSEP)win32.c | |
586 | ||
587 | nt_$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h # Win32 unzipsfx | |
588 | $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ win32$(DIRSEP)nt.c | |
589 | ||
590 | win32f$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h # Win32 funzip | |
591 | $(CC) -c $(CFLAGS) -DFUNZIP $(OUT)$@ win32$(DIRSEP)win32.c | |
592 | ||
593 | os2$(OBJ): os2/os2.c $(UNZIP_H) version.h # OS/2 only | |
594 | $(CC) -c $(CFLAGS) $(DLLFLAG) os2$(DIRSEP)os2.c | |
595 | ||
596 | os2_$(OBJ): os2/os2.c $(UNZIP_H) # OS/2 unzipsfx | |
597 | $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ os2$(DIRSEP)os2.c | |
598 | ||
599 | os2acl$(OBJ): os2/os2acl.c $(UNZIP_H) version.h # OS/2 only | |
600 | $(CC) -c $(CFLAGS) $(DLLFLAG) os2$(DIRSEP)os2acl.c | |
601 | ||
602 | os2acl_$(OBJ): os2/os2acl.c $(UNZIP_H) version.h # OS/2 unzipsfx | |
603 | $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ os2$(DIRSEP)os2acl.c | |
604 | ||
605 | rexxhelp$(OBJ): os2/rexxhelp.c # OS/2 DLL only | |
606 | $(CC) -c $(CFLAGS) $(DLLFLAG) os2$(DIRSEP)rexxhelp.c | |
607 | ||
608 | rexxapi$(OBJ): os2/rexxapi.c # OS/2 DLL only | |
609 | $(CC) -c $(CFLAGS) $(DLLFLAG) os2$(DIRSEP)rexxapi.c | |
610 | ||
611 | crc_i86$(OBJ): msdos/crc_i86.asm # 16bit only | |
612 | $(AS) $(ASFLAGS) msdos$(AS_DIRSEP)crc_i86.asm $(ASEOL) | |
613 | ||
614 | crc_i386$(OBJ): win32/crc_i386.asm # 32bit, MASM | |
615 | $(AS) $(ASFLAGS) win32$(AS_DIRSEP)crc_i386.asm $(ASEOL) | |
616 | ||
617 | crc_gcc$(OBJ): crc_i386.S # 32bit, GNU AS | |
618 | $(AS) $(ASFLAGS) -x assembler-with-cpp -c -o $@ crc_i386.S | |
619 | ||
620 | # NFLAGS are solely used as work-around for optimization bug in IBM C++ Set | |
621 | crypt$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h | |
622 | $(CC) -c $(CFLAGS) $(DLLFLAG) $(NFLAGS) crypt.c | |
623 | ||
624 | cryptf$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h # funzip only | |
625 | $(CC) -c $(CFLAGS) $(NFLAGS) -DFUNZIP $(OUT)$@ crypt.c | |
626 | ||
627 | crc32f$(OBJ): crc32.c $(UNZIP_H) zip.h # funzip only | |
628 | $(CC) -c $(CFLAGS) -DFUNZIP $(OUT)$@ crc32.c | |
629 | ||
630 | globalsf$(OBJ): globals.c $(UNZIP_H) # funzip only | |
631 | $(CC) -c $(CFLAGS) -DFUNZIP $(OUT)$@ globals.c | |
632 | ||
633 | inflatef$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h # funzip only | |
634 | $(CC) -c $(CFLAGS) -DFUNZIP $(OUT)$@ inflate.c | |
635 | ||
636 | ttyiof$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h # funzip only | |
637 | $(CC) -c $(CFLAGS) $(NFLAGS) -DFUNZIP $(OUT)$@ ttyio.c | |
638 | ||
639 | crc32_$(OBJ): crc32.c $(UNZIP_H) zip.h # unzipsfx only | |
640 | $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ crc32.c | |
641 | ||
642 | crctab_$(OBJ): crctab.c $(UNZIP_H) zip.h # unzipsfx only | |
643 | $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ crctab.c | |
644 | ||
645 | crypt_$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h # unzipsfx only | |
646 | $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ crypt.c | |
647 | ||
648 | extract_$(OBJ): extract.c $(UNZIP_H) crypt.h # unzipsfx only | |
649 | $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ extract.c | |
650 | ||
651 | fileio_$(OBJ): fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h # unzipsfx only | |
652 | $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ fileio.c | |
653 | ||
654 | globals_$(OBJ): globals.c $(UNZIP_H) # unzipsfx only | |
655 | $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ globals.c | |
656 | ||
657 | inflate_$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h # unzipsfx only | |
658 | $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ inflate.c | |
659 | ||
660 | match_$(OBJ): match.c $(UNZIP_H) # unzipsfx only | |
661 | $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ match.c | |
662 | ||
663 | process_$(OBJ): process.c $(UNZIP_H) # unzipsfx only | |
664 | $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ process.c | |
665 | ||
666 | ttyio_$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h # unzipsfx only | |
667 | $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ ttyio.c | |
668 | ||
669 | unzipsf_$(OBJ): unzip.c $(UNZIP_H) crypt.h version.h consts.h # unzipsfx only | |
670 | $(CC) -c $(CFLAGS) -DSFX $(OUT)$@ unzip.c |