1
# WMAKE makefile for Windows 95 and Windows NT (Intel only)
2
# using Watcom C/C++ v11.0+, by Paul Kienitz, last revised 13 Feb 99.
3
# Makes Zip.exe, ZipNote.exe, ZipCloak.exe, and ZipSplit.exe.
5
# Invoke from Zip source dir with "WMAKE -F WIN32\MAKEFILE.WAT [targets]"
6
# To build with debug info use "WMAKE DEBUG=1 ..."
7
# To build without any assembly modules use "WMAKE NOASM=1 ..."
9
# Other options to be fed to the compiler can be specified in an environment
10
# variable called LOCAL_ZIP. One possibility "-DDYN_ALLOC", but currently
11
# this is not supported unless NOASM is also used.
13
variation = $(%LOCAL_ZIP)
15
# Stifle annoying "Delete this file?" questions when errors occur:
19
.EXTENSIONS: .exe .obj .c .h .asm
21
# We maintain multiple sets of object files in different directories so that
22
# we can compile msdos, dos/4gw, and win32 versions of Zip without their
23
# object files interacting. The following var must be a directory name
24
# ending with a backslash. All object file names must include this macro
25
# at the beginning, for example "$(O)foo.obj".
28
O = od32w\ # comment here so backslash won't continue the line
33
# The assembly hot-spot code in crc_i386.asm and match32.asm is optional.
34
# This section controls its usage.
37
asmob = $(O)crc32.obj # C source
38
cvars = $+$(cvars)$- -DNO_ASM # otherwise ASM_CRC might default on!
39
# "$+$(foo)$-" means expand foo as it has been defined up to now; normally,
40
# this make defers inner expansion until the outer macro is expanded.
42
asmob = $(O)match32.obj $(O)crc_i386.obj
43
cvars = $+$(cvars)$- -DASMV -DASM_CRC
46
# Our object files. OBJZ is for Zip, OBJC is for ZipCloak, OBJN is for
47
# ZipNote, and OBJS is for ZipSplit:
49
OBJZ3 = $(O)zip.obj $(O)crypt.obj $(O)ttyio.obj $(O)trees.obj $(O)zipup.obj
50
OBJZ2 = $(OBJZ3) $(O)util.obj $(O)zipfile.obj $(O)fileio.obj $(O)deflate.obj
51
OBJZ1 = $(OBJZ2) $(O)globals.obj $(O)crctab.obj $(asmob)
52
OBJZ = $(OBJZ1) $(O)win32zip.obj $(O)win32.obj $(O)nt.obj
54
OBJU1 = $(O)zipfile_.obj $(O)fileio_.obj $(O)util_.obj $(O)globals.obj
55
OBJ_U = $(OBJU1) $(O)win32_.obj
57
OBJC = $(O)zipcloak.obj $(O)crctab.obj $(O)crypt_.obj $(O)ttyio.obj $(OBJ_U)
59
OBJN = $(O)zipnote.obj $(OBJ_U)
61
OBJS = $(O)zipsplit.obj $(OBJ_U)
63
# Common header files included by all C sources:
65
ZIP_H = zip.h ziperr.h tailor.h win32\osdep.h
67
# Now we have to pick out the proper compiler and options for it.
72
# Use Pentium Pro timings, register args, static strings in code:
73
cflags = -bt=NT -6r -zt -zq
74
aflags = -bt=NT -mf -3 -zq
76
cvars = $+$(cvars)$- -DWIN32 $(variation)
77
avars = $+$(avars)$- $(variation)
79
# Specify optimizations, or a nonoptimized debugging version:
83
ldebug = d w all op symf
85
cdebug = -s -obhikl+rt -oe=100 -zp8
86
# -oa helps slightly but might be dangerous.
90
# How to compile sources:
92
$(cc) $(cdebug) $(cflags) $(cvars) $[@ -fo=$@
94
# Here we go! By default, make all targets:
95
all: Zip.exe ZipNote.exe ZipCloak.exe ZipSplit.exe
97
# Convenient shorthand options for single targets:
99
n: ZipNote.exe .SYMBOLIC
100
c: ZipCloak.exe .SYMBOLIC
101
s: ZipSplit.exe .SYMBOLIC
104
$(link) $(lflags) $(ldebug) name $@ file {$(OBJZ)}
107
$(link) $(lflags) $(ldebug) name $@ file {$(OBJN)}
109
ZipCloak.exe: $(OBJC)
110
$(link) $(lflags) $(ldebug) name $@ file {$(OBJC)}
112
ZipSplit.exe: $(OBJS)
113
$(link) $(lflags) $(ldebug) name $@ file {$(OBJS)}
115
# Source dependencies:
117
$(O)crctab.obj: crctab.c $(ZIP_H)
118
$(O)crc32.obj: crc32.c $(ZIP_H) # only used if NOASM
119
$(O)crypt.obj: crypt.c $(ZIP_H) crypt.h ttyio.h
120
$(O)deflate.obj: deflate.c $(ZIP_H)
121
$(O)fileio.obj: fileio.c $(ZIP_H)
122
$(O)globals.obj: globals.c $(ZIP_H)
123
$(O)trees.obj: trees.c $(ZIP_H)
124
$(O)ttyio.obj: ttyio.c $(ZIP_H) crypt.h ttyio.h
125
$(O)util.obj: util.c $(ZIP_H)
126
$(O)zip.obj: zip.c $(ZIP_H) crypt.h revision.h ttyio.h
127
$(O)zipfile.obj: zipfile.c $(ZIP_H)
128
$(O)zipup.obj: zipup.c $(ZIP_H) revision.h crypt.h win32\zipup.h
129
$(O)zipnote.obj: zipnote.c $(ZIP_H) revision.h
130
$(O)zipcloak.obj: zipcloak.c $(ZIP_H) revision.h crypt.h ttyio.h
131
$(O)zipsplit.obj: zipsplit.c $(ZIP_H) revision.h
133
# Special case object files:
135
$(O)win32.obj: win32\win32.c $(ZIP_H) win32\win32zip.h
136
$(cc) $(cdebug) $(cflags) $(cvars) win32\win32.c -fo=$@
138
$(O)win32zip.obj: win32\win32zip.c $(ZIP_H) win32\win32zip.h win32\nt.h
139
$(cc) $(cdebug) $(cflags) $(cvars) win32\win32zip.c -fo=$@
141
$(O)nt.obj: win32\nt.c $(ZIP_H) win32\nt.h
142
$(cc) $(cdebug) $(cflags) $(cvars) win32\nt.c -fo=$@
144
$(O)match32.obj: win32\match32.asm
145
$(asm) $(aflags) $(avars) win32\match32.asm -fo=$@
147
$(O)crc_i386.obj: win32\crc_i386.asm
148
$(asm) $(aflags) $(avars) win32\crc_i386.asm -fo=$@
150
# Variant object files for ZipNote, ZipCloak, and ZipSplit:
152
$(O)zipfile_.obj: zipfile.c $(ZIP_H)
153
$(cc) $(cdebug) $(cflags) $(cvars) -DUTIL zipfile.c -fo=$@
155
$(O)fileio_.obj: fileio.c $(ZIP_H)
156
$(cc) $(cdebug) $(cflags) $(cvars) -DUTIL fileio.c -fo=$@
158
$(O)util_.obj: util.c $(ZIP_H)
159
$(cc) $(cdebug) $(cflags) $(cvars) -DUTIL util.c -fo=$@
161
$(O)crypt_.obj: crypt.c $(ZIP_H) crypt.h ttyio.h
162
$(cc) $(cdebug) $(cflags) $(cvars) -DUTIL crypt.c -fo=$@
164
$(O)win32_.obj: win32\win32.c $(ZIP_H) win32\win32zip.h
165
$(cc) $(cdebug) $(cflags) $(cvars) -DUTIL win32\win32.c -fo=$@
167
# Unwanted file removal:
172
cleaner: clean .SYMBOLIC