Debian Codegraph @

msdos/makefile.tc

raw
1 # Makefile for Zip, ZipCloak, ZipNote and ZipSplit for
2 # Turbo C 2.0. (Thanks to Andrew Cadach <[email protected]>)
3
4 # To use, do "make -fmakefile.tc"
5
6 # WARNING: the small model is not supported. You must use the large model.
7 # Add -DSMALL_MEM or -DMEDIUM_MEM to the LOC macro if you wish to reduce
8 # the memory requirements.
9 # Add -DNO_ASM to CFLAGS and comment out the ASMOBJS definition if
10 # you do not have tasm.
11
12 # Optional nonstandard preprocessor flags (as -DMEDIUM_MEM or -DNO_ASM)
13 # should be added to the environment via "set LOCAL_ZIP=-DFOO" or added
14 # to the declaration of LOC here:
15 LOC = -DDOS -DNO_SECURE_TESTS $(LOCAL_ZIP)
16
17 # Zip requires compact or large memory model.
18 # with 2.1, compact model exceeds 64k code segment; use large model
19 ZIPMODEL=l # large model for Zip and ZipUtils
20
21 # name of Flag to select memory model for assembler compiles, supported
22 # values are __SMALL__ , __MEDIUM__ , __COMPACT__ , __LARGE__ :
23 ASMODEL=__LARGE__ # keep in sync with ZIPMODEL definition !!
24
25 # Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc.
26 CPU_TYP = 0
27
28 # Uncomment the following macro to use the optimized assembler
29 # routines in Zip:
30 ASMOBJS = match.obj crc_i86.obj
31
32 ASCPUFLAG = __$(CPU_TYP)86
33
34 # ------------- Turbo C 2.0 -------------
35 MODEL=-m$(ZIPMODEL)
36 CFLAGS=-w -w-eff -w-def -w-sig -w-cln -a -d -G -O -Z $(MODEL) $(LOC)
37 UTILFLAGS=-DUTIL $(CFLAGS) -o
38 CC=tcc
39
40 # Old versions of tasm (prior to 2.01) may not like the "-m2" option...
41 AS=tasm
42 ASFLAGS=-ml -t -m2 -DDYN_ALLOC -DSS_NEQ_DS -D$(ASCPUFLAG) -D$(ASMODEL) $(LOC)
43
44 LD=tcc
45 LDFLAGS=$(MODEL)
46
47 # ------------- Common declarations:
48 STRIP=rem
49 # If you don't have UPX, LZEXE, or PKLITE, get one of them. Then define:
50 # (NOTE: upx needs a 386 or higher system to run the exe compressor)
51 #STRIP=upx --8086 --best
52 # or
53 #STRIP=lzexe
54 # or (if you've registered PKLITE)
55 #STRIP=pklite
56 # This makes a big difference in .exe size (and possibly load time)
57
58 # ------------- Used by install rule
59 # set BIN to the directory you want to install the executables to
60 BIN = c:\util
61
62 # variables
63 OBJZ = zip.obj crypt.obj ttyio.obj zipfile.obj zipup.obj fileio.obj util.obj \
64 crc32.obj globals.obj
65
66 OBJI = deflate.obj trees.obj $(ASMOBJS) msdos.obj
67
68 OBJU = _zipfile.obj _fileio.obj _util.obj globals.obj _msdos.obj
69 OBJN = zipnote.obj $(OBJU)
70 OBJC = zipcloak.obj _crc32.obj _crypt.obj ttyio.obj $(OBJU)
71 OBJS = zipsplit.obj $(OBJU)
72
73 ZIP_H = zip.h ziperr.h tailor.h msdos/osdep.h
74
75 ZIPS = zip.exe zipnote.exe zipsplit.exe zipcloak.exe
76
77 zips: $(ZIPS)
78
79 zip.obj: zip.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h
80 $(CC) -c $(CFLAGS) $*.c
81
82 zipfile.obj: zipfile.c $(ZIP_H) crc32.h
83 $(CC) -c $(CFLAGS) $*.c
84
85 zipup.obj: zipup.c $(ZIP_H) revision.h crc32.h crypt.h msdos/zipup.h
86 $(CC) -c $(CFLAGS) $*.c
87
88 fileio.obj: fileio.c $(ZIP_H) crc32.h
89 $(CC) -c $(CFLAGS) $*.c
90
91 util.obj: util.c $(ZIP_H)
92 $(CC) -c $(CFLAGS) $*.c
93
94 globals.obj: globals.c $(ZIP_H)
95 $(CC) -c $(CFLAGS) $*.c
96
97 deflate.obj: deflate.c $(ZIP_H)
98 $(CC) -c $(CFLAGS) $*.c
99
100 trees.obj: trees.c $(ZIP_H)
101 $(CC) -c $(CFLAGS) $*.c
102
103 crc32.obj: crc32.c $(ZIP_H) crc32.h
104 $(CC) -c $(CFLAGS) $*.c
105
106 crypt.obj: crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h
107 $(CC) -c $(CFLAGS) $*.c
108
109 ttyio.obj: ttyio.c $(ZIP_H) crypt.h ttyio.h
110 $(CC) -c $(CFLAGS) $*.c
111
112 msdos.obj: msdos/msdos.c $(ZIP_H)
113 $(CC) -c $(CFLAGS) msdos/$*.c
114
115 zipcloak.obj: zipcloak.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h
116 $(CC) -c $(CFLAGS) -o$* $*.c
117
118 zipnote.obj: zipnote.c $(ZIP_H) revision.h
119 $(CC) -c $(CFLAGS) -o$* $*.c
120
121 zipsplit.obj: zipsplit.c $(ZIP_H) revision.h
122 $(CC) -c $(CFLAGS) -o$* $*.c
123
124 _zipfile.obj: zipfile.c $(ZIP_H) crc32.h
125 $(CC) -c $(UTILFLAGS)$* zipfile.c
126
127 _fileio.obj: fileio.c $(ZIP_H) crc32.h
128 $(CC) -c $(UTILFLAGS)$* fileio.c
129
130 _util.obj: util.c $(ZIP_H)
131 $(CC) -c $(UTILFLAGS)$* util.c
132
133 _crc32.obj: crc32.c $(ZIP_H) crc32.h
134 $(CC) -c $(UTILFLAGS)$* crc32.c
135
136 _crypt.obj: crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h
137 $(CC) -c $(UTILFLAGS)$* crypt.c
138
139 _msdos.obj: msdos/msdos.c $(ZIP_H)
140 $(CC) -c $(UTILFLAGS)$* msdos/msdos.c
141
142 crc_i86.obj: msdos/crc_i86.asm
143 $(AS) $(ASFLAGS) msdos\crc_i86.asm ;
144
145 match.obj: msdos/match.asm
146 $(AS) $(ASFLAGS) msdos\match.asm ;
147
148 # make sure the command line fits in the MS/DOS 128 byte limit:
149 zip.exe: $(OBJZ) $(OBJI)
150 rem ignore any warnings in the following renaming commands:
151 ren _*.obj _*.ob
152 ren zipcloak.obj *.ob
153 ren zipnote.obj *.ob
154 ren zipsplit.obj *.ob
155 $(LD) $(LDFLAGS) -ezip.exe *.obj
156 ren _*.ob _*.obj
157 ren zip???*.ob *.obj
158 $(STRIP) zip.exe
159
160 zipcloak.exe: $(OBJC)
161 $(LD) $(LDFLAGS) -ezipcloak.exe $(OBJC)
162 $(STRIP) zipcloak.exe
163
164 zipnote.exe: $(OBJN)
165 $(LD) $(LDFLAGS) -ezipnote.exe $(OBJN)
166 $(STRIP) zipnote.exe
167
168 zipsplit.exe: $(OBJS)
169 $(LD) $(LDFLAGS) -ezipsplit.exe $(OBJS)
170 $(STRIP) zipsplit.exe
171
172 install: $(ZIPS)
173 copy /b *.exe $(BIN)
174
175 clean:
176 del *.obj
177 del *.exe