Debian Codegraph @

msdos/makefile.emx

raw
1 # Makefile for Zip, ZipCloak, ZipNote and ZipSplit
2 # using emx 0.9c for DOS.
3 # By Kai-Uwe Rommel, Chr. Spieler, E-Yen Tan (and others).
4 # Last updated 7th January 2007.
5 #
6 # This Makefile is a stripped down version of win32/Makefile.emx that
7 # builds executables applying the default MSDOS emx setup. For variant
8 # targets (using zlib), and cross-compilation for WIN32 or OS/2, take a
9 # look into "win32/makefile.emx" resp. "os2/makefile.os2".
10 #
11 # Supported Make utilities:
12 # - Microsoft/IBM nmake (e.g. from MSC 6.0 or newer)
13 # - dmake 3.8 or higher
14 # - GNU make, at least version 3.68 (GNUish 16-bit port, RSXNT Make 3.75 in a
15 # Win95/WinNT DOS box, DJGPP v1.12 Make 3.71, some versions of DJGPP v2.x
16 # 32-bit Make; current DJGPP v2.01 Make 3.76.1 does NOT work)
17 # - NOT watcom make
18 # The "smart" Make utilities mentioned below are Christian Spieler's
19 # enhanced version of GNUish 16-bit Make (3.74) and his adaption of these
20 # GNU Make sources to EMX (32-bit).
21
22 # Supported 32-bit C Compilers for MSDOS:
23 # - GNU gcc (emx kit 0.9c or newer, 32-bit)
24
25 # Supported Assemblers:
26 # - GNU as with GNU gcc
27
28
29 # To use, enter "make/nmake/dmake -f msdos/makefile.emx"
30 # (this makefile depends on its name being "msdos/makefile.emx").
31
32 # emx 0.9c, gcc, a.out format, for MS-DOS
33 CC=gcc -O2 -m486 -Wall
34 CFLAGS=-DDOS -DMSDOS -DASM_CRC
35 AS=gcc
36 ASFLAGS=-Di386
37 LDFLAGS=-o ./
38 LDFLAGS2=-s -Zsmall-conv
39 OUT=-o
40 OBJ=.o
41 CRCA_O=crc_gcc.o
42 OBJA=matchgcc.o
43 OBJZS=msdos.o
44 OBJUS=msdos_.o
45 OSDEP_H=msdos/osdep.h
46 ZIPUP_H=msdos/zipup.h
47
48 #default settings for target dependent macros:
49 DIRSEP = /
50 AS_DIRSEP = /
51 RM = del
52 LOCAL_OPTS = $(LOCAL_ZIP)
53 CCFLAGS = $(CFLAGS) $(LOCAL_OPTS)
54
55
56 OBJZ1 = zip$(OBJ) zipfile$(OBJ) zipup$(OBJ) fileio$(OBJ) util$(OBJ) \
57 crc32$(OBJ) $(CRCA_O)
58 OBJZ2 = globals$(OBJ) deflate$(OBJ) trees$(OBJ) crypt$(OBJ) \
59 ttyio$(OBJ)
60 OBJZ = $(OBJZ1) $(OBJZ2) $(OBJZS) $(OBJA)
61
62 OBJU1 = zipfile_$(OBJ) fileio_$(OBJ) util_$(OBJ) globals$(OBJ)
63 OBJU = $(OBJU1) $(OBJUS)
64
65 OBJN = zipnote$(OBJ) $(OBJU)
66 OBJS = zipsplit$(OBJ) $(OBJU)
67 OBJC1 = zipcloak$(OBJ) crc32_$(OBJ) crypt_$(OBJ) ttyio$(OBJ)
68 OBJC = $(OBJC1) $(OBJU)
69
70 ZIP_H = zip.h ziperr.h tailor.h $(OSDEP_H)
71
72 # rules
73
74 .SUFFIXES: .c $(OBJ)
75
76 .c$(OBJ):
77 $(CC) -c -I. $(CCFLAGS) $(OUT)$@ $<
78
79 # targets
80
81 all: zip.exe zipnote.exe zipsplit.exe zipcloak.exe
82
83 zip$(OBJ): zip.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h
84 zipfile$(OBJ): zipfile.c $(ZIP_H) crc32.h
85 zipup$(OBJ): zipup.c $(ZIP_H) revision.h crc32.h crypt.h $(ZIPUP_H)
86 fileio$(OBJ): fileio.c $(ZIP_H) crc32.h
87 util$(OBJ): util.c $(ZIP_H)
88 globals$(OBJ): globals.c $(ZIP_H)
89 deflate$(OBJ): deflate.c $(ZIP_H)
90 trees$(OBJ): trees.c $(ZIP_H)
91 crc32$(OBJ): crc32.c $(ZIP_H) crc32.h
92 crypt$(OBJ): crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h
93 ttyio$(OBJ): ttyio.c $(ZIP_H) crypt.h ttyio.h
94
95 msdos$(OBJ): msdos/msdos.c $(ZIP_H)
96 $(CC) -c -I. $(CCFLAGS) msdos$(DIRSEP)msdos.c
97
98 win32zip$(OBJ): win32/win32zip.c $(ZIP_H) win32/win32zip.h win32/nt.h
99 $(CC) -c -I. $(CCFLAGS) win32$(DIRSEP)win32zip.c
100
101 win32$(OBJ): win32/win32.c $(ZIP_H) win32/win32zip.h
102 $(CC) -c -I. $(CCFLAGS) win32$(DIRSEP)win32.c
103
104 nt$(OBJ): win32/nt.c $(ZIP_H) win32/nt.h
105 $(CC) -c -I. $(CCFLAGS) win32$(DIRSEP)nt.c
106
107 crc_gcc$(OBJ): crc_i386.S # 32bit, GNU AS
108 $(AS) $(ASFLAGS) -x assembler-with-cpp -c -o $@ crc_i386.S
109
110 matchgcc$(OBJ): match.S
111 $(AS) $(ASFLAGS) -x assembler-with-cpp -c -o $@ match.S
112
113 zipcloak$(OBJ): zipcloak.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h
114 zipnote$(OBJ): zipnote.c $(ZIP_H) revision.h
115 zipsplit$(OBJ): zipsplit.c $(ZIP_H) revision.h
116
117 zipfile_$(OBJ): zipfile.c $(ZIP_H) crc32.h
118 $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ zipfile.c
119
120 fileio_$(OBJ): fileio.c $(ZIP_H) crc32.h
121 $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ fileio.c
122
123 util_$(OBJ): util.c $(ZIP_H)
124 $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ util.c
125
126 crc32_$(OBJ): crc32.c $(ZIP_H) crc32.h
127 $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ crc32.c
128
129 crypt_$(OBJ): crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h
130 $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ crypt.c
131
132 msdos_$(OBJ): msdos/msdos.c $(ZIP_H)
133 $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ msdos$(DIRSEP)msdos.c
134
135 win32_$(OBJ): win32/win32.c $(ZIP_H) win32/win32zip.h
136 $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ win32$(DIRSEP)win32.c
137
138 # This next bit is nasty, but is needed to overcome the MS-DOS command
139 # line limit as response files for emx's gcc seem to only work if each
140 # file is on a different line. DJGPP doesn't do this (if you are at all
141 # interested).
142
143 zip.exe: $(OBJZ)
144 # for DUMB make utilities, uncomment the following commands:
145 -@$(RM) zip.rsp
146 @for %%f in ($(OBJZ1)) do echo %%f >> zip.rsp
147 @for %%f in ($(OBJZ2)) do echo %%f >> zip.rsp
148 @for %%f in ($(OBJZS) $(OBJA)) do echo %%f >> zip.rsp
149 $(CC) $(LDFLAGS)$@ @zip.rsp $(LDFLAGS2)
150 @$(RM) zip.rsp
151 # smart make utilities (like well done ports of GNU Make) can use this:
152 # $(CC) $(LDFLAGS)$@ $(OBJZ) $(LDFLAGS2)
153
154 zipcloak.exe: $(OBJC)
155 # for DUMB make utilities, uncomment the following commands:
156 -@$(RM) zipcloak.rsp
157 @for %%f in ($(OBJC1)) do echo %%f >> zipcloak.rsp
158 @for %%f in ($(OBJU1)) do echo %%f >> zipcloak.rsp
159 @for %%f in ($(OBJUS)) do echo %%f >> zipcloak.rsp
160 $(CC) $(LDFLAGS)$@ @zipcloak.rsp $(LDFLAGS2)
161 @$(RM) zipcloak.rsp
162 # smart make utilities (like well done ports of GNU Make) can use this:
163 # $(CC) $(LDFLAGS)$@ $(OBJC) $(LDFLAGS2)
164
165 zipnote.exe: $(OBJN)
166 $(CC) $(LDFLAGS)$@ $(OBJN) $(LDFLAGS2)
167
168 zipsplit.exe: $(OBJS)
169 $(CC) $(LDFLAGS)$@ $(OBJS) $(LDFLAGS2)