makefile.emx 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. # Makefile for Zip, ZipCloak, ZipNote and ZipSplit
  2. # using emx 0.9c+rsxnt for Windows 95/98 and Windows NT and emx 0.9c for DOS.
  3. # By Kai-Uwe Rommel, Chr. Spieler, E-Yen Tan (and others).
  4. # Last updated 18th February 2007.
  5. #
  6. # Supported Make utilities:
  7. # - Microsoft/IBM nmake (e.g. from MSC 6.0 or newer)
  8. # - dmake 3.8 or higher
  9. # - GNU make, at least version 3.68 (GNUish 16-bit port, RSXNT Make 3.75,
  10. # DJGPP v1.12 Make 3.71, some versions of DJGPP v2.x 32-bit Make;
  11. # current DJGPP v2.01 Make 3.76.1 does NOT work)
  12. # - NOT watcom make
  13. # The "smart" Make utilities mentioned below are Christian Spieler's
  14. # enhanced version of GNUish 16-bit Make (3.74) and his adaption of these
  15. # GNU Make sources to EMX (32-bit).
  16. # Supported 32-bit C Compilers (created programs run under WinNT/Win95 only):
  17. # - GNU gcc (emx/rsxnt kit 0.9c or newer)
  18. # Supported Cross-Compilers for MS-DOS:
  19. # - GNU gcc (emx kit 0.9c or newer, 32-bit)
  20. # Supported Assemblers:
  21. # - GNU as with GNU gcc
  22. # To use, enter "make/nmake/dmake -f win32/makefile.emx"
  23. # (this makefile depends on its name being "win32/makefile.emx").
  24. # Add -DDYN_ALLOC to ASFLAGS if you have defined it in tailor.h or CFLAGS
  25. # Note: assembly language modules are really only supported for
  26. # GNU gcc 32-bit compilation.
  27. default:
  28. @echo "Enter $(MAKE) -f win32/makefile.emx target"
  29. @echo "where target is one of:"
  30. @echo " gcc gccso gccdyn gccdebug gcczl gccdos gccdoszl"
  31. @echo " -----------------------------------------------"
  32. @echo "Or, specify a specific target for a partial build,"
  33. @echo "This uses >gcc< setup (win32 statically linked binary)"
  34. # emx 0.9c, gcc, PE format, statically linked C runtime and rsxnt.dll
  35. gcc: all
  36. # emx 0.9c, gcc, PE format, statically linked C runtime, standalone
  37. gccso:
  38. $(MAKE) -f win32/makefile.emx all \
  39. CC="gcc -Zwin32 -Zsys -O2 -m486 -Wall" \
  40. CFLAGS="-DWIN32 -DASM_CRC" \
  41. AS="gcc -Zwin32" \
  42. ASFLAGS="-Di386" \
  43. LDFLAGS="-o ./" \
  44. LDFLAGS2="-ladvapi32 -s" \
  45. OUT="-o" \
  46. OBJ=".o" \
  47. CRCA_O="crc_gcc.o" \
  48. CRCAUO="crcgcc_.o" \
  49. OBJA="matchgcc.o" \
  50. DEF="win32/zip.def"
  51. # emx 0.9c, gcc, PE format, dynamically linked C runtime and rsxnt.dll
  52. gccdyn:
  53. $(MAKE) -f win32/makefile.emx all \
  54. CC="gcc -Zwin32 -Zcrtdll=crtrsxnt -O2 -m486 -Wall" \
  55. CFLAGS="-DWIN32 -DASM_CRC" \
  56. AS="gcc -Zwin32" \
  57. ASFLAGS="-Di386" \
  58. LDFLAGS="-o ./" \
  59. LDFLAGS2="-ladvapi32 -s" \
  60. OUT="-o" \
  61. OBJ=".o" \
  62. CRCA_O="crc_gcc.o" \
  63. CRCAUO="crcgcc_.o" \
  64. OBJA="matchgcc.o" \
  65. DEF="win32/zip.def"
  66. # emx 0.9c, gcc, PE format, with debug info for gdb
  67. gccdebug:
  68. $(MAKE) -f win32/makefile.emx all \
  69. CC="gcc -Zwin32 -O2 -g -Wall" \
  70. CFLAGS="-DWIN32 -DASM_CRC" \
  71. AS="gcc -Zwin32" \
  72. ASFLAGS="-Di386" \
  73. LDFLAGS="-o ./" \
  74. LDFLAGS2="-ladvapi32 -Zsmall-conv" \
  75. OUT="-o" \
  76. OBJ=".o" \
  77. CRCA_O="crc_gcc.o" \
  78. CRCAUO="crcgcc_.o" \
  79. OBJA="matchgcc.o" \
  80. DEF="win32/zip.def"
  81. # emx 0.9c, gcc, PE format,, statically linked zlib, C runtime, and rsxnt.dll
  82. gcczl:
  83. $(MAKE) -f win32/makefile.emx all \
  84. CC="gcc -Zwin32 -O2 -m486 -Wall" \
  85. CFLAGS="-DWIN32 -DUSE_ZLIB" \
  86. AS="gcc -Zwin32" \
  87. ASFLAGS="-Di386 -DUSE_ZLIB" \
  88. LDFLAGS="-o ./" \
  89. LDFLAGS2="-L. -lzlib -ladvapi32 -s" \
  90. OUT="-o" \
  91. OBJ=".o" \
  92. CRCA_O="" \
  93. CRCAUO="" \
  94. OBJA="" \
  95. DEF="win32/zip.def"
  96. # emx 0.9c, gcc, a.out format, for MS-DOS
  97. gccdos:
  98. $(MAKE) -f win32/makefile.emx all \
  99. CC="gcc -O2 -m486 -Wall" \
  100. CFLAGS="-DDOS -DMSDOS -DASM_CRC" \
  101. AS="gcc" \
  102. ASFLAGS="-Di386" \
  103. LDFLAGS="-o ./" \
  104. LDFLAGS2="-s -Zsmall-conv" \
  105. OUT="-o" \
  106. OBJ=".o" \
  107. CRCA_O="crc_gcc.o" \
  108. CRCAUO="crcgcc_.o" \
  109. OBJA="matchgcc.o" \
  110. OBJZS="msdos.o" \
  111. OBJUS="msdos_.o" \
  112. OSDEP_H="msdos/osdep.h" \
  113. ZIPUP_H="msdos/zipup.h"
  114. # emx 0.9c, gcc, a.out format, for MS-DOS, using zlib
  115. gccdoszl:
  116. $(MAKE) -f win32/makefile.emx all \
  117. CC="gcc -O2 -m486 -Wall" \
  118. CFLAGS="-DDOS -DMSDOS -DUSE_ZLIB" \
  119. AS="gcc" \
  120. ASFLAGS="-Di386 -DUSE_ZLIB" \
  121. LDFLAGS="-o ./" \
  122. LDFLAGS2="-L. -lzlib -s -Zsmall-conv" \
  123. OUT="-o" \
  124. OBJ=".o" \
  125. CRCA_O="" \
  126. CRCAUO="" \
  127. OBJA="" \
  128. OBJZS="msdos.o" \
  129. OBJUS="msdos_.o" \
  130. OSDEP_H="msdos/osdep.h" \
  131. ZIPUP_H="msdos/zipup.h"
  132. # VPATH = .;win32
  133. # variables
  134. #default settings for target dependent macros:
  135. # the "gcc" (statically linked Win32 executables) target:
  136. CC=gcc -Zwin32 -O2 -m486 -Wall
  137. CFLAGS=-DWIN32 -DASM_CRC
  138. AS=gcc -Zwin32
  139. ASFLAGS=-Di386
  140. LDFLAGS=-o ./
  141. LDFLAGS2=-ladvapi32 -s -Zsmall-conv
  142. OUT=-o
  143. OBJ=.o
  144. CRCA_O=crc_gcc$(OBJ)
  145. CRCAUO=crcgcc_$(OBJ)
  146. OBJA=matchgcc$(OBJ)
  147. OSDEP_H=win32/osdep.h
  148. ZIPUP_H=win32/zipup.h
  149. DEF=win32/zip.def
  150. DIRSEP = /
  151. AS_DIRSEP = /
  152. RM = del
  153. LOCAL_OPTS = $(LOCAL_ZIP)
  154. CCFLAGS = $(CFLAGS) $(LOCAL_OPTS)
  155. OBJZ1 = zip$(OBJ) zipfile$(OBJ) zipup$(OBJ) fileio$(OBJ) util$(OBJ) \
  156. crc32$(OBJ) $(CRCA_O)
  157. OBJZ2 = globals$(OBJ) deflate$(OBJ) trees$(OBJ) crypt$(OBJ) \
  158. ttyio$(OBJ)
  159. OBJZS = win32zip$(OBJ) win32$(OBJ) nt$(OBJ)
  160. OBJZ = $(OBJZ1) $(OBJZ2) $(OBJZS) $(OBJA)
  161. OBJU1 = zipfile_$(OBJ) fileio_$(OBJ) util_$(OBJ) crc32_$(OBJ) $(CRCAUO) \
  162. globals$(OBJ)
  163. OBJUS = win32_$(OBJ)
  164. OBJU = $(OBJU1) $(OBJUS)
  165. OBJN = zipnote$(OBJ) $(OBJU)
  166. OBJS = zipsplit$(OBJ) $(OBJU)
  167. OBJC1 = zipcloak$(OBJ) crypt_$(OBJ) ttyio$(OBJ)
  168. OBJC = $(OBJC1) $(OBJU)
  169. ZIP_H = zip.h ziperr.h tailor.h $(OSDEP_H)
  170. # rules
  171. .SUFFIXES: .c $(OBJ)
  172. .c$(OBJ):
  173. $(CC) -c -I. $(CCFLAGS) $(OUT)$@ $<
  174. # targets
  175. all: zip.exe zipnote.exe zipsplit.exe zipcloak.exe
  176. zip$(OBJ): zip.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h
  177. zipfile$(OBJ): zipfile.c $(ZIP_H) crc32.h
  178. zipup$(OBJ): zipup.c $(ZIP_H) revision.h crc32.h crypt.h $(ZIPUP_H)
  179. fileio$(OBJ): fileio.c $(ZIP_H) crc32.h
  180. util$(OBJ): util.c $(ZIP_H)
  181. globals$(OBJ): globals.c $(ZIP_H)
  182. deflate$(OBJ): deflate.c $(ZIP_H)
  183. trees$(OBJ): trees.c $(ZIP_H)
  184. crc32$(OBJ): crc32.c $(ZIP_H) crc32.h
  185. crypt$(OBJ): crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h
  186. ttyio$(OBJ): ttyio.c $(ZIP_H) crypt.h ttyio.h
  187. msdos$(OBJ): msdos/msdos.c $(ZIP_H)
  188. $(CC) -c -I. $(CCFLAGS) msdos$(DIRSEP)msdos.c
  189. win32zip$(OBJ): win32/win32zip.c $(ZIP_H) win32/win32zip.h win32/nt.h
  190. $(CC) -c -I. $(CCFLAGS) win32$(DIRSEP)win32zip.c
  191. win32$(OBJ): win32/win32.c $(ZIP_H) win32/win32zip.h
  192. $(CC) -c -I. $(CCFLAGS) win32$(DIRSEP)win32.c
  193. nt$(OBJ): win32/nt.c $(ZIP_H) win32/nt.h
  194. $(CC) -c -I. $(CCFLAGS) win32$(DIRSEP)nt.c
  195. crc_gcc$(OBJ): crc_i386.S # 32bit, GNU AS
  196. $(AS) $(ASFLAGS) -x assembler-with-cpp -c -o $@ crc_i386.S
  197. matchgcc$(OBJ): match.S
  198. $(AS) $(ASFLAGS) -x assembler-with-cpp -c -o $@ match.S
  199. zipcloak$(OBJ): zipcloak.c $(ZIP_H) revision.h crypt.h ttyio.h
  200. zipnote$(OBJ): zipnote.c $(ZIP_H) revision.h
  201. zipsplit$(OBJ): zipsplit.c $(ZIP_H) revision.h
  202. zipfile_$(OBJ): zipfile.c $(ZIP_H) crc32.h
  203. $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ zipfile.c
  204. fileio_$(OBJ): fileio.c $(ZIP_H) crc32.h
  205. $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ fileio.c
  206. util_$(OBJ): util.c $(ZIP_H)
  207. $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ util.c
  208. crc32_$(OBJ): crc32.c $(ZIP_H) crc32.h
  209. $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ crc32.c
  210. crypt_$(OBJ): crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h
  211. $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ crypt.c
  212. msdos_$(OBJ): msdos/msdos.c $(ZIP_H)
  213. $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ msdos$(DIRSEP)msdos.c
  214. win32_$(OBJ): win32/win32.c $(ZIP_H) win32/win32zip.h
  215. $(CC) -c -I. $(CCFLAGS) -DUTIL $(OUT)$@ win32$(DIRSEP)win32.c
  216. crcgcc_$(OBJ): crc_i386.S # 32bit, GNU AS
  217. $(AS) $(ASFLAGS) -DUTIL -x assembler-with-cpp -c -o $@ crc_i386.S
  218. zip.exe: $(OBJZ)
  219. # for DUMB make utilities, uncomment the following commands:
  220. -@$(RM) zip.rsp
  221. @for %%f in ($(OBJZ1)) do echo %%f >> zip.rsp
  222. @for %%f in ($(OBJZ2)) do echo %%f >> zip.rsp
  223. @for %%f in ($(OBJZS) $(OBJA)) do echo %%f >> zip.rsp
  224. $(CC) $(LDFLAGS)$@ @zip.rsp $(LDFLAGS2)
  225. @$(RM) zip.rsp
  226. # smart make utilities (like well done ports of GNU Make) can use this:
  227. # $(CC) $(LDFLAGS)$@ $(OBJZ) $(LDFLAGS2)
  228. zipcloak.exe: $(OBJC)
  229. # for DUMB make utilities, uncomment the following commands:
  230. -@$(RM) zipcloak.rsp
  231. @for %%f in ($(OBJC1)) do echo %%f >> zipcloak.rsp
  232. @for %%f in ($(OBJU1)) do echo %%f >> zipcloak.rsp
  233. @for %%f in ($(OBJUS)) do echo %%f >> zipcloak.rsp
  234. $(CC) $(LDFLAGS)$@ @zipcloak.rsp $(LDFLAGS2)
  235. @$(RM) zipcloak.rsp
  236. # smart make utilities (like well done ports of GNU Make) can use this:
  237. # $(CC) $(LDFLAGS)$@ $(OBJC) $(LDFLAGS2)
  238. zipnote.exe: $(OBJN)
  239. # for DUMB make utilities, uncomment the following commands:
  240. -@$(RM) zipnote.rsp
  241. @for %%f in ($(OBJN)) do echo %%f >> zipnote.rsp
  242. $(CC) $(LDFLAGS)$@ @zipnote.rsp $(LDFLAGS2)
  243. @$(RM) zipnote.rsp
  244. # smart make utilities (like well done ports of GNU Make) can use this:
  245. # $(CC) $(LDFLAGS)$@ $(OBJN) $(LDFLAGS2)
  246. zipsplit.exe: $(OBJS)
  247. # for DUMB make utilities, uncomment the following commands:
  248. -@$(RM) zipsplit.rsp
  249. @for %%f in ($(OBJN)) do echo %%f >> zipsplit.rsp
  250. $(CC) $(LDFLAGS)$@ @zipsplit.rsp $(LDFLAGS2)
  251. @$(RM) zipsplit.rsp
  252. # smart make utilities (like well done ports of GNU Make) can use this:
  253. # $(CC) $(LDFLAGS)$@ $(OBJS) $(LDFLAGS2)