Makefile.lcc 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. # Makefile for UnZip, fUnZip and UnZipSFX using LCC-Win32.
  2. # By E-Yen Tan (3 June 1998).
  3. # Last updated 20 Jul 2008 (Christian Spieler).
  4. #
  5. # This version includes rules to build the 32-bit windll DLL.
  6. # This compiler evaluates #include locations relative to current working dir,
  7. # not relative to the location of the file containing the #include directive.
  8. # As a consequence, a "-Iwin32" option is required to allow compilation of
  9. # the WIN32 specific sources.
  10. CC=lcc
  11. CCFLAGS=-Zp8 -O -DWIN32 $(AS_FLAGS)
  12. #DLLFLAG=
  13. DLLFLAG=-DWINDLL -DDLL -I./windll
  14. AS=lcc
  15. ASFLAGS=
  16. LD = lcclnk
  17. #DLLLDFLAG=
  18. DLLLDFLAG=-dll -entry DllMain
  19. LDFLAGS=-s -o ./
  20. LDFLAGS2=
  21. OUT=-Fo
  22. OBJ=.obj
  23. CP=copy
  24. RM=del
  25. # Optional macros should be declared below.
  26. # (LCC's Make is unable to read the LOCAL_UNZIP environment variable.)
  27. LOC = $(ASMFLG)
  28. # Options to select optimized assembler code for CRC32 calculation.
  29. #ifdef NOASM
  30. #ASMFLG=
  31. #CRCA_O=
  32. #CRCA_OF=
  33. #CRCA_OL=
  34. #CRCA_OG=
  35. #CRCA_OX=
  36. #else
  37. ASMFLG=-DASM_CRC
  38. CRCA_O=crc_lcc$(OBJ)
  39. CRCA_OF=$(CRCA_O)
  40. CRCA_OL=$(CRCA_O)
  41. CRCA_OG=$(CRCA_O)
  42. CRCA_OX=$(CRCA_O)
  43. #endif
  44. CFLAGS = $(CCFLAGS) $(LOC)
  45. CFLAGS_UN = $(CFLAGS)
  46. CFLAGS_SX = $(CFLAGS) -DSFX
  47. CFLAGS_FU = $(CFLAGS) -DFUNZIP
  48. CFLAGS_DL = $(CFLAGS) $(DLLFLAG)
  49. CFLAGS_SL = $(CFLAGS) $(DLLFLAG) -DUNZIPLIB -DSFX
  50. CFLAGS_GX = $(CFLAGS) -I./windll -I./windll/guisfx -DSFX
  51. # The system specific files are defined here:
  52. OBJUS=win32$(OBJ) win32i64$(OBJ) nt$(OBJ)
  53. OBJXS=win32_$(OBJ) win32i64_$(OBJ) nt_$(OBJ)
  54. OBJFS=win32f$(OBJ) win32i64f$(OBJ)
  55. OBJDS=win32l$(OBJ) win32i64l$(OBJ) ntl$(OBJ)
  56. OBLXS=win32g$(OBJ) win32i64g$(OBJ) ntg$(OBJ) windllg$(OBJ)
  57. OSDEP_H=win32/w32cfg.h
  58. WINDLL_H=windll/windll.h windll/structs.h windll/decs.h
  59. DLLDEF=.\windll\windll_lc.def # lcclink requires backslashes as dir-sep!!
  60. WINDLL_IMP_H = windll/decs.h windll/structs.h
  61. OBJU1 = unzip$(OBJ) crc32$(OBJ) $(CRCA_O) crypt$(OBJ) envargs$(OBJ)
  62. OBJU2 = explode$(OBJ) extract$(OBJ) fileio$(OBJ) globals$(OBJ)
  63. OBJU3 = inflate$(OBJ) list$(OBJ) match$(OBJ) process$(OBJ) ttyio$(OBJ)
  64. OBJU4 = ubz2err$(OBJ) unreduce$(OBJ) unshrink$(OBJ) zipinfo$(OBJ)
  65. OBJU = $(OBJU1) $(OBJU2) $(OBJU3) $(OBJU4) $(OBJUS)
  66. OBJX1 = unzipsf_$(OBJ) crc32_$(OBJ) $(CRCA_OX) crypt_$(OBJ)
  67. OBJX2 = extract_$(OBJ) fileio_$(OBJ) globals_$(OBJ) inflate_$(OBJ)
  68. OBJX3 = match_$(OBJ) process_$(OBJ) ttyio_$(OBJ) ubz2err_$(OBJ)
  69. OBJX = $(OBJX1) $(OBJX2) $(OBJX3) $(OBJXS)
  70. OBJF = funzip$(OBJ) crc32f$(OBJ) $(CRCA_OF) cryptf$(OBJ) inflatef$(OBJ) \
  71. globalsf$(OBJ) ttyiof$(OBJ) $(OBJFS)
  72. OBJDLL = windll$(OBJ) windll32.res api$(OBJ)
  73. OBJD1 = crc32l$(OBJ) $(CRCA_OL) cryptl$(OBJ)
  74. OBJD2 = explodel$(OBJ) extractl$(OBJ) fileiol$(OBJ) globalsl$(OBJ)
  75. OBJD3 = inflatel$(OBJ) listl$(OBJ) matchl$(OBJ) processl$(OBJ)
  76. OBJD4 = ubz2errl$(OBJ) unreducl$(OBJ) unshrnkl$(OBJ) zipinfol$(OBJ)
  77. OBJD = $(OBJDLL) $(OBJD1) $(OBJD2) $(OBJD3) $(OBJD4) $(OBJDS)
  78. OBLX1 = apig$(OBJ) crc32g$(OBJ) $(CRCA_OG) cryptg$(OBJ)
  79. OBLX2 = extractg$(OBJ) fileiog$(OBJ) globalsg$(OBJ) inflateg$(OBJ)
  80. OBLX3 = matchg$(OBJ) processg$(OBJ) ubz2errg$(OBJ)
  81. OBLX = $(OBLX1) $(OBLX2) $(OBLX3) $(OBLXS)
  82. OBGX = sfxwiz$(OBJ)
  83. UNZIP_H = unzip.h unzpriv.h globals.h $(OSDEP_H)
  84. # rules
  85. .SUFFIXES: .c $(OBJ)
  86. .c$(OBJ):
  87. $(CC) -c $(CFLAGS_UN) $(OUT)$@ $<
  88. .asm$(OBJ):
  89. $(AS) $(ASFLAGS) $(OUT)$@ $<
  90. # targets
  91. unzips: unzip.exe funzip.exe unzipsfx.exe
  92. dll: unzip32.dll
  93. dllsample: uzexampl.exe
  94. guisfx: SFXWiz32.exe
  95. all: unzips dll dllsample guisfx
  96. unzip.exe: $(OBJU) winapp.res
  97. $(LD) $(LDFLAGS)$@ $(DEF) $(OBJU) winapp.res $(LDFLAGS2)
  98. funzip.exe: $(OBJF)
  99. $(LD) $(LDFLAGS)$@ $(DEF) $(OBJF) $(LDFLAGS2)
  100. unzipsfx.exe: $(OBJX)
  101. $(LD) $(LDFLAGS)$@ $(DEF) $(OBJX) $(LDFLAGS2)
  102. unzip32.dll: $(DLLDEF) $(OBJD)
  103. $(LD) $(DLLLDFLAG) $(LDFLAGS)$@ $(DLLDEF) $(OBJD) $(LDFLAGS2)
  104. unzsfx32.lib: $(OBLX)
  105. lcclib $@ $(OBLX)
  106. SFXWiz32.exe: $(OBGX) sfxwiz.res unzsfx32.lib
  107. $(LD) -subsystem windows $(LDFLAGS)$@ \
  108. $(OBGX) sfxwiz.res unzsfx32.lib
  109. uzexampl.exe: uzexampl$(OBJ)
  110. $(LD) $(LDFLAGS)$@ $(DEF) uzexampl$(OBJ) version.lib $(LDFLAGS2)
  111. # dependencies
  112. api$(OBJ): api.c $(UNZIP_H) unzvers.h
  113. apihelp$(OBJ): apihelp.c $(UNZIP_H) unzvers.h
  114. crc32$(OBJ): crc32.c $(UNZIP_H) zip.h crc32.h
  115. envargs$(OBJ): envargs.c $(UNZIP_H)
  116. explode$(OBJ): explode.c $(UNZIP_H)
  117. extract$(OBJ): extract.c $(UNZIP_H) crc32.h crypt.h
  118. fileio$(OBJ): fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h
  119. globals$(OBJ): globals.c $(UNZIP_H)
  120. inflate$(OBJ): inflate.c $(UNZIP_H)
  121. list$(OBJ): list.c $(UNZIP_H)
  122. match$(OBJ): match.c $(UNZIP_H)
  123. process$(OBJ): process.c $(UNZIP_H) crc32.h
  124. ttyio$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
  125. ubz2err$(OBJ): ubz2err.c $(UNZIP_H)
  126. unreduce$(OBJ): unreduce.c $(UNZIP_H)
  127. unshrink$(OBJ): unshrink.c $(UNZIP_H)
  128. unzip$(OBJ): unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
  129. zipinfo$(OBJ): zipinfo.c $(UNZIP_H)
  130. funzip$(OBJ): funzip.c $(UNZIP_H) crc32.h crypt.h ttyio.h
  131. $(CC) -c $(CFLAGS) $(OUT)$@ funzip.c
  132. uzexampl$(OBJ): windll/uzexampl.c windll/uzexampl.h
  133. $(CC) -c $(CFLAGS_UN) -I./windll $(OUT)$@ windll/uzexampl.c
  134. win32$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h unzvers.h
  135. $(CC) -c $(CFLAGS_UN) -Iwin32 $(OUT)$@ win32/win32.c
  136. win32i64$(OBJ): win32/win32i64.c $(UNZIP_H)
  137. $(CC) -c $(CFLAGS_UN) -Iwin32 $(OUT)$@ win32/win32i64.c
  138. nt$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h
  139. $(CC) -c $(CFLAGS_UN) -Iwin32 $(OUT)$@ win32/nt.c
  140. crc_lcc$(OBJ): win32/crc_lcc.asm
  141. $(AS) $(ASFLAGS) $(OUT)$@ win32/crc_lcc.asm
  142. crypt$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h
  143. $(CC) -c $(CFLAGS_UN) $(OUT)$@ crypt.c
  144. winapp.res: win32/winapp.rc unzvers.h
  145. - lrc -v -r -I./win32 -DWIN32 -o$@ win32/winapp.rc
  146. crc32f$(OBJ): crc32.c $(UNZIP_H) zip.h crc32.h
  147. $(CC) -c $(CFLAGS_FU) $(OUT)$@ crc32.c
  148. cryptf$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
  149. $(CC) -c $(CFLAGS_FU) $(OUT)$@ crypt.c
  150. globalsf$(OBJ): globals.c $(UNZIP_H)
  151. $(CC) -c $(CFLAGS_FU) $(OUT)$@ globals.c
  152. inflatef$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h
  153. $(CC) -c $(CFLAGS_FU) $(OUT)$@ inflate.c
  154. ttyiof$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
  155. $(CC) -c $(CFLAGS_FU) $(OUT)$@ ttyio.c
  156. win32f$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h
  157. $(CC) -c $(CFLAGS_FU) -Iwin32 $(OUT)$@ win32/win32.c
  158. win32i64f$(OBJ): win32/win32i64.c $(UNZIP_H)
  159. $(CC) -c $(CFLAGS_FU) -Iwin32 $(OUT)$@ win32/win32i64.c
  160. crc32_$(OBJ): crc32.c $(UNZIP_H) zip.h crc32.h
  161. $(CC) -c $(CFLAGS_SX) $(OUT)$@ crc32.c
  162. crypt_$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
  163. $(CC) -c $(CFLAGS_SX) $(OUT)$@ crypt.c
  164. extract_$(OBJ): extract.c $(UNZIP_H) crc32.h crypt.h
  165. $(CC) -c $(CFLAGS_SX) $(OUT)$@ extract.c
  166. fileio_$(OBJ): fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h
  167. $(CC) -c $(CFLAGS_SX) $(OUT)$@ fileio.c
  168. globals_$(OBJ): globals.c $(UNZIP_H)
  169. $(CC) -c $(CFLAGS_SX) $(OUT)$@ globals.c
  170. inflate_$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h
  171. $(CC) -c $(CFLAGS_SX) $(OUT)$@ inflate.c
  172. match_$(OBJ): match.c $(UNZIP_H)
  173. $(CC) -c $(CFLAGS_SX) $(OUT)$@ match.c
  174. process_$(OBJ): process.c $(UNZIP_H) crc32.h
  175. $(CC) -c $(CFLAGS_SX) $(OUT)$@ process.c
  176. ttyio_$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
  177. $(CC) -c $(CFLAGS_SX) $(OUT)$@ ttyio.c
  178. ubz2err_$(OBJ): ubz2err.c $(UNZIP_H)
  179. $(CC) -c $(CFLAGS_SX) $(OUT)$@ ubz2err.c
  180. unzipsf_$(OBJ): unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
  181. $(CC) -c $(CFLAGS_SX) $(OUT)$@ unzip.c
  182. win32_$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h
  183. $(CC) -c $(CFLAGS_SX) -Iwin32 $(OUT)$@ win32/win32.c
  184. win32i64_$(OBJ): win32/win32i64.c $(UNZIP_H)
  185. $(CC) -c $(CFLAGS_SX) -Iwin32 $(OUT)$@ win32/win32i64.c
  186. nt_$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h
  187. $(CC) -c $(CFLAGS_SX) -Iwin32 $(OUT)$@ win32/nt.c
  188. # DLL compilation section
  189. api$(OBJ): api.c $(UNZIP_H) $(WINDLL_H) unzvers.h
  190. $(CC) -c $(CFLAGS_DL) $(OUT)$@ api.c
  191. crc32l$(OBJ): crc32.c $(UNZIP_H) zip.h crc32.h
  192. $(CC) -c $(CFLAGS_DL) $(OUT)$@ crc32.c
  193. cryptl$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
  194. $(CC) -c $(CFLAGS_DL) $(OUT)$@ crypt.c
  195. explodel$(OBJ): explode.c $(UNZIP_H)
  196. $(CC) -c $(CFLAGS_DL) $(OUT)$@ explode.c
  197. extractl$(OBJ): extract.c $(UNZIP_H) crc32.h crypt.h
  198. $(CC) -c $(CFLAGS_DL) $(OUT)$@ extract.c
  199. fileiol$(OBJ): fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h
  200. $(CC) -c $(CFLAGS_DL) $(OUT)$@ fileio.c
  201. globalsl$(OBJ): globals.c $(UNZIP_H)
  202. $(CC) -c $(CFLAGS_DL) $(OUT)$@ globals.c
  203. inflatel$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h
  204. $(CC) -c $(CFLAGS_DL) $(OUT)$@ inflate.c
  205. listl$(OBJ): list.c $(UNZIP_H) $(WINDLL_H)
  206. $(CC) -c $(CFLAGS_DL) $(OUT)$@ list.c
  207. matchl$(OBJ): match.c $(UNZIP_H)
  208. $(CC) -c $(CFLAGS_DL) $(OUT)$@ match.c
  209. processl$(OBJ): process.c $(UNZIP_H) crc32.h
  210. $(CC) -c $(CFLAGS_DL) $(OUT)$@ process.c
  211. ubz2errl$(OBJ): ubz2err.c $(UNZIP_H)
  212. $(CC) -c $(CFLAGS_DL) $(OUT)$@ ubz2err.c
  213. unreducl$(OBJ): unreduce.c $(UNZIP_H)
  214. $(CC) -c $(CFLAGS_DL) $(OUT)$@ unreduce.c
  215. unshrnkl$(OBJ): unshrink.c $(UNZIP_H)
  216. $(CC) -c $(CFLAGS_DL) $(OUT)$@ unshrink.c
  217. zipinfol$(OBJ): zipinfo.c $(UNZIP_H)
  218. $(CC) -c $(CFLAGS_DL) $(OUT)$@ zipinfo.c
  219. win32l$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h
  220. $(CC) -c $(CFLAGS_DL) -Iwin32 $(OUT)$@ win32/win32.c
  221. win32i64l$(OBJ): win32/win32i64.c $(UNZIP_H)
  222. $(CC) -c $(CFLAGS_DL) -Iwin32 $(OUT)$@ win32/win32i64.c
  223. ntl$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h
  224. $(CC) -c $(CFLAGS_DL) -Iwin32 $(OUT)$@ win32/nt.c
  225. windll$(OBJ): windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h
  226. $(CC) -c $(CFLAGS_DL) $(OUT)$@ windll/windll.c
  227. windll32.res: windll/windll.rc unzvers.h
  228. - lrc -v -r $(DLLFLAG) -DWIN32 -o$@ windll/windll.rc
  229. # SFX Lib compilation section
  230. apig$(OBJ): api.c $(UNZIP_H) $(WINDLL_H) unzvers.h
  231. $(CC) -c $(CFLAGS_SL) $(OUT)$@ api.c
  232. crc32g$(OBJ): crc32.c $(UNZIP_H) zip.h crc32.h
  233. $(CC) -c $(CFLAGS_SL) $(OUT)$@ crc32.c
  234. cryptg$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
  235. $(CC) -c $(CFLAGS_SL) $(OUT)$@ crypt.c
  236. extractg$(OBJ): extract.c $(UNZIP_H) $(WINDLL_H) crc32.h crypt.h
  237. $(CC) -c $(CFLAGS_SL) $(OUT)$@ extract.c
  238. fileiog$(OBJ): fileio.c $(UNZIP_H) $(WINDLL_H) crc32.h crypt.h ttyio.h ebcdic.h
  239. $(CC) -c $(CFLAGS_SL) $(OUT)$@ fileio.c
  240. globalsg$(OBJ): globals.c $(UNZIP_H)
  241. $(CC) -c $(CFLAGS_SL) $(OUT)$@ globals.c
  242. inflateg$(OBJ): inflate.c inflate.h $(UNZIP_H)
  243. $(CC) -c $(CFLAGS_SL) $(OUT)$@ inflate.c
  244. matchg$(OBJ): match.c $(UNZIP_H)
  245. $(CC) -c $(CFLAGS_SL) $(OUT)$@ match.c
  246. processg$(OBJ): process.c $(UNZIP_H) $(WINDLL_H) crc32.h
  247. $(CC) -c $(CFLAGS_SL) $(OUT)$@ process.c
  248. ubz2errg$(OBJ): ubz2err.c $(UNZIP_H)
  249. $(CC) -c $(CFLAGS_SL) $(OUT)$@ ubz2err.c
  250. win32g$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h
  251. $(CC) -c $(CFLAGS_SL) -Iwin32 $(OUT)$@ win32/win32.c
  252. win32i64g$(OBJ): win32/win32i64.c $(UNZIP_H)
  253. $(CC) -c $(CFLAGS_SL) -Iwin32 $(OUT)$@ win32/win32i64.c
  254. ntg$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h
  255. $(CC) -c $(CFLAGS_SL) -Iwin32 $(OUT)$@ win32/nt.c
  256. windllg$(OBJ): windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h
  257. $(CC) -c $(CFLAGS_SL) $(OUT)$@ windll/windll.c
  258. sfxwiz$(OBJ): windll/guisfx/sfxwiz.c windll/guisfx/dialog.h $(WINDLL_IMP_H)
  259. $(CC) -c $(CFLAGS_GX) $(OUT)$@ windll/guisfx/sfxwiz.c
  260. sfxwiz.res: windll/guisfx/sfxwiz.rc
  261. - lrc -v -r -Iwindll/guisfx -DWIN32 -o$@ windll/guisfx/sfxwiz.rc