makefile.azt 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. # Makefile for Zip, ZipNote, ZipCloak, ZipSplit for Aztec C 5.2
  2. # Also ZipLM, a version of Zip that needs much less free memory
  3. # -- Paul Kienitz, last updated 07 Jan 2007
  4. # Make sure platform is defined correctly, and select memory usage options:
  5. DEFINES = -d AMIGA -d DYN_ALLOC -d ASM_CRC
  6. CC = cc
  7. AS = as
  8. LD = ln
  9. LDLIBS = -lc16
  10. # -------- RELEASE VERSION:
  11. CFLAGS = -psb0e -sabfmnpu -wcr0u $(DEFINES)
  12. # -pbs means unsigned chars and short ints, -sabfmnpu is various small
  13. # optimizations, -wcr0u adjusts type checking strictness
  14. ASOPTS = -n -eAMIGA -eDYN_ALLOC -eCPUTEST -eINT16
  15. LDFLAGS = -m +q
  16. # -------- DEBUG VERSION:
  17. CFLAGD = -bs -psb0e -s0f0n -wcr0u $(DEFINES)
  18. # -bs is include source debugging info, -s0f0n is avoid hard-to-debug
  19. # optimizations
  20. LDFLAGD = -m +q -g -w
  21. # -------- MINIMUM MEMORY USAGE RELEASE VERSION:
  22. WSIZ = WSIZE=4096
  23. LOWFLAGS = $(CFLAGS) -d $(WSIZ) -d SMALL_MEM
  24. LOWASOPTS = $(ASOPTS) -e$(WSIZ) -eSMALL_MEM
  25. # Options used for assembling amiga/deflate.a; must generally match the
  26. # settings in DEFINES.
  27. # -------- MINIMUM MEMORY USAGE DEBUG VERSION:
  28. LOWFLAGD = $(CFLAGD) -d $(WSIZ) -d SMALL_MEM
  29. # the directory where we stick all the object files:
  30. O = obA/
  31. # default C rules
  32. .c.o :
  33. $(CC) $(CFLAGS) -o $@ $*.c
  34. # rules for routines containing entries needed by utilities
  35. .c.oo :
  36. $(CC) $(CFLAGS) -d UTIL -o $@ $*.c
  37. # rules for the low-memory version:
  38. .c.ol :
  39. $(CC) $(LOWFLAGS) -o $@ $*.c
  40. # default C rules for debugging
  41. .c.od :
  42. $(CC) $(CFLAGD) -o $@ $*.c
  43. # debugging rules for routines containing entries needed by utilities
  44. .c.dd :
  45. $(CC) $(CFLAGD) -d UTIL -o $@ $*.c
  46. # rules for the debugging low-memory version:
  47. .c.dl :
  48. $(CC) $(LOWFLAGD) -o $@ $*.c
  49. # object file lists
  50. ZIP_H = zip.h ziperr.h tailor.h amiga/osdep.h amiga/z-stat.h
  51. OBJZ = $(O)zip.o $(O)deflate.o \
  52. $(O)trees.o $(O)zipfile.o $(O)zipup.o $(O)util.o $(O)timezone.o \
  53. $(O)fileio.o $(O)globals.o $(O)crc32.o $(O)crypt.o $(O)ttyio.o \
  54. $(O)amiga.o $(O)amigazip.o $(O)crc_68.o
  55. OBJL = $(O)zip.ol $(O)deflate.ol \
  56. $(O)trees.ol $(O)zipfile.ol $(O)zipup.ol $(O)util.ol $(O)timezone.ol \
  57. $(O)fileio.ol $(O)globals.ol $(O)crc32.ol $(O)crypt.ol $(O)ttyio.ol \
  58. $(O)amiga.ol $(O)amigazip.ol $(O)crc_68.o
  59. OBJU = $(O)zipfile.oo $(O)fileio.oo \
  60. $(O)util.oo $(O)globals.o $(O)amiga.oo $(O)amigazip.oo
  61. OBJN = $(O)zipnote.o $(OBJU)
  62. OBJC = $(O)zipcloak.o $(OBJU) $(O)crc32.oo \
  63. $(O)crypt.oo $(O)ttyio.o
  64. OBJS = $(O)zipsplit.o $(OBJU)
  65. # These are the debuggable versions:
  66. DBJZ = $(O)zip.od $(O)deflate.od \
  67. $(O)trees.od $(O)zipfile.od $(O)zipup.od $(O)util.od $(O)timezone.od \
  68. $(O)fileio.od $(O)globals.od $(O)crc32.od $(O)crypt.od $(O)ttyio.od \
  69. $(O)amiga.od $(O)amigazip.od $(O)crc_68.o
  70. DBJL = $(O)zip.dl $(O)deflate.dl \
  71. $(O)trees.dl $(O)zipfile.dl $(O)zipup.dl $(O)util.dl $(O)timezone.dl \
  72. $(O)fileio.dl $(O)globals.dl $(O)crc32.dl $(O)crypt.dl $(O)ttyio.dl \
  73. $(O)amiga.dl $(O)amigazip.dl $(O)crc_68.o
  74. DBJU = $(O)zipfile.dd $(O)fileio.dd \
  75. $(O)util.dd $(O)globals.od $(O)amiga.dd $(O)amigazip.dd
  76. DBJN = $(O)zipnote.od $(DBJU)
  77. DBJC = $(O)zipcloak.od $(DBJU) $(O)crc32.dd \
  78. $(O)crypt.dd $(O)ttyio.od
  79. DBJS = $(O)zipsplit.od $(DBJU)
  80. # HERE WE GO:
  81. all : Zip ZipNote ZipSplit ZipCloak ZipLM
  82. z : Zip
  83. n : ZipNote
  84. s : ZipSplit
  85. c : ZipCloak
  86. l : ZipLM
  87. # Debug versions:
  88. dall : Zip.dbg ZipNote.dbg ZipSplit.dbg ZipCloak.dbg ZipLM.dbg
  89. dz : Zip.dbg
  90. dn : ZipNote.dbg
  91. ds : ZipSplit.dbg
  92. dc : ZipCloak.dbg
  93. dl : ZipLM.dbg
  94. Zip : $(OBJZ) $(ZIP_H)
  95. $(LD) $(LDFLAGS) -o $@ $(OBJZ) $(LDLIBS)
  96. -@delete Zip.dbg
  97. ZipNote : $(OBJN) $(ZIP_H)
  98. $(LD) $(LDFLAGS) -o $@ $(OBJN) $(LDLIBS)
  99. -@delete ZipNote.dbg
  100. ZipSplit : $(OBJS) $(ZIP_H)
  101. $(LD) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)
  102. -@delete ZipSplit.dbg
  103. ZipCloak : $(OBJC) $(ZIP_H)
  104. $(LD) $(LDFLAGS) -o $@ $(OBJC) $(LDLIBS)
  105. -@delete ZipCloak.dbg
  106. ZipLM : $(OBJL) $(ZIP_H)
  107. $(LD) $(LDFLAGS) -o $@ $(OBJL) $(LDLIBS)
  108. -@delete ZipLM.dbg
  109. Zip.dbg : $(DBJZ) $(ZIP_H)
  110. $(LD) $(LDFLAGD) -o Zip $(DBJZ) $(LDLIBS)
  111. ZipNote.dbg : $(DBJN) $(ZIP_H)
  112. $(LD) $(LDFLAGD) -o ZipNote $(DBJN) $(LDLIBS)
  113. ZipSplit.dbg : $(DBJS) $(ZIP_H)
  114. $(LD) $(LDFLAGD) -o ZipSplit $(DBJS) $(LDLIBS)
  115. ZipCloak.dbg : $(DBJC) $(ZIP_H)
  116. $(LD) $(LDFLAGD) -o ZipCloak $(DBJC) $(LDLIBS)
  117. ZipLM.dbg : $(DBJL) $(ZIP_H)
  118. $(LD) $(LDFLAGD) -o ZipLM $(DBJL) $(LDLIBS)
  119. clean : bugclean
  120. -delete quiet $(OBJZ)
  121. -delete quiet $(OBJL)
  122. -delete quiet $(O)zipnote.o $(O)zipcloak.o $(O)zipsplit.o \
  123. $(O)crypt.oo $(OBJU)
  124. bugclean :
  125. -delete quiet $(DBJZ)
  126. -delete quiet $(DBJL)
  127. -delete quiet $(O)zipnote.od $(O)zipcloak.od $(O)zipsplit.od \
  128. $(O)crypt.dd $(DBJU)
  129. cleaner : clean
  130. -delete quiet Zip ZipNote ZipSplit ZipCloak ZipLM
  131. -delete quiet Zip.dbg ZipNote.dbg ZipSplit.dbg ZipCloak.dbg ZipLM.dbg
  132. # header dependencies:
  133. $(O)zip.o $(O)zipnote.o $(O)zipcloak.o $(O)zipsplit.o $(O)crypt.o $(O)ttyio.o \
  134. $(O)deflate.o $(O)trees.o $(O)zipfile.o $(O)zipup.o $(O)fileio.o $(O)util.o \
  135. $(O)timezone.o $(O)crc32.o $(O)globals.o $(O)amiga.o : $(ZIP_H)
  136. $(O)zip.ol $(O)zipnote.ol $(O)zipcloak.ol $(O)zipsplit.ol $(O)crypt.ol \
  137. $(O)ttyio.ol $(O)deflate.ol $(O)trees.ol $(O)zipfile.ol $(O)zipup.ol \
  138. $(O)fileio.ol $(O)util.ol $(O)timezone.ol $(O)crc32.ol $(O)globals.ol \
  139. $(O)amiga.ol : $(ZIP_H)
  140. $(O)crc32.oo $(O)crypt.oo $(O)zipfile.oo $(O)fileio.oo $(O)util.oo : $(ZIP_H)
  141. $(O)amigazip.o $(O)amigazip.ol $(O)amigazip.oo : amiga/amiga.h $(ZIP_H)
  142. $(O)zip.o $(O)zipnote.o $(O)zipcloak.o $(O)zipsplit.o $(O)zipup.o \
  143. $(O)zip.ol $(O)zipnote.ol $(O)zipcloak.ol $(O)zipsplit.ol \
  144. $(O)zipup.ol : revision.h
  145. $(O)amiga.o $(O)amiga.ol : crypt.h
  146. $(O)crc32.o $(O)crc32.oo $(O)crc32.ol $(O)crypt.o $(O)crypt.oo $(O)crypt.ol \
  147. $(O)zipcloak.o $(O)zipcloak.ol $(O)zip.o $(O)zip.ol \
  148. $(O)zipup.o $(O)zipup.ol \
  149. $(O)zipfile.o $(O)zipfile.oo $(O)zipfile.ol \
  150. $(O)fileio.o $(O)fileio.oo $(O)fileio.ol : crc32.h
  151. $(O)crypt.o $(O)crypt.oo $(O)crypt.ol $(O)ttyio.o $(O)ttyio.ol \
  152. $(O)zipcloak.o $(O)zipcloak.ol $(O)zip.o $(O)zip.ol \
  153. $(O)zipup.o $(O)zipup.ol : crypt.h ttyio.h
  154. $(O)timezone.o $(O)timezone.ol $(O)timezone.od $(O)timezone.dl \
  155. $(O)amiga.o $(O)amiga.ol $(O)amiga.oo : timezone.h
  156. $(O)zipup.o $(O)zipup.ol : amiga/zipup.h
  157. # SPECIAL CASES:
  158. # -mr changes expression parsing; avoids a bogus "expression too complex" error:
  159. $(O)trees.o : trees.c
  160. $(CC) $(CFLAGS) -mr -o $@ trees.c
  161. $(O)trees.ol : trees.c
  162. $(CC) $(LOWFLAGS) -mr -o $@ trees.c
  163. $(O)trees.od : trees.c
  164. $(CC) $(CFLAGD) -mr -o $@ trees.c
  165. $(O)trees.ld : trees.c
  166. $(CC) $(LOWFLAGD) -mr -o $@ trees.c
  167. # Substitute the assembly version of deflate.c: (but not in debug version)
  168. $(O)deflate.o : amiga/deflate.a
  169. $(AS) $(ASOPTS) -o $@ amiga/deflate.a
  170. $(O)deflate.ol : amiga/deflate.a
  171. $(AS) $(LOWASOPTS) -o $@ amiga/deflate.a
  172. # The assembly CRC function:
  173. $(O)crc_68.o : amiga/crc_68.a
  174. $(AS) -n -o $@ amiga/crc_68.a
  175. # Put the Amiga internal version data with today's date into amiga.c:
  176. $(O)amiga.o : amiga/amiga.c amiga/filedate.c amiga/stat.c
  177. rx > env:VersionDate "say '""'translate(date('E'), '.', '/')'""'"
  178. $(CC) $(CFLAGS) -o $@ amiga/amiga.c
  179. delete env:VersionDate
  180. $(O)amiga.ol : amiga/amiga.c amiga/filedate.c amiga/stat.c
  181. rx > env:VersionDate "say '""'translate(date('E'), '.', '/')'""'"
  182. $(CC) $(LOWFLAGS) -o $@ amiga/amiga.c
  183. delete env:VersionDate
  184. $(O)amiga.od : amiga/amiga.c amiga/filedate.c amiga/stat.c
  185. rx > env:VersionDate "say '""'translate(date('E'), '.', '/')'""'"
  186. $(CC) $(CFLAGD) -o $@ amiga/amiga.c
  187. delete env:VersionDate
  188. $(O)amiga.ld : amiga/amiga.c amiga/filedate.c amiga/stat.c
  189. rx > env:VersionDate "say '""'translate(date('E'), '.', '/')'""'"
  190. $(CC) $(LOWFLAGD) -o $@ amiga/amiga.c
  191. delete env:VersionDate
  192. $(O)amiga.oo : amiga/amiga.c amiga/filedate.c amiga/stat.c
  193. rx > env:VersionDate "say '""'translate(date('E'), '.', '/')'""'"
  194. $(CC) $(CFLAGS) -d UTIL -o $@ amiga/amiga.c
  195. delete env:VersionDate
  196. $(O)amiga.dd : amiga/amiga.c amiga/filedate.c amiga/stat.c
  197. rx > env:VersionDate "say '""'translate(date('E'), '.', '/')'""'"
  198. $(CC) $(CFLAGD) -d UTIL -o $@ amiga/amiga.c
  199. delete env:VersionDate
  200. # Put the compiler version number into amigazip.c:
  201. $(O)amigazip.o : amiga/amigazip.c
  202. $(CC) $(CFLAGS) -o $@ -d __VERSION__=5 -d __REVISION__=2 amiga/amigazip.c
  203. $(O)amigazip.ol : amiga/amigazip.c
  204. $(CC) $(LOWFLAGS) -o $@ -d __VERSION__=5 -d __REVISION__=2 amiga/amigazip.c
  205. $(O)amigazip.od : amiga/amigazip.c
  206. $(CC) $(CFLAGD) -o $@ -d __VERSION__=5 -d __REVISION__=2 amiga/amigazip.c
  207. $(O)amigazip.ld : amiga/amigazip.c
  208. $(CC) $(LOWFLAGD) -o $@ -d __VERSION__=5 -d __REVISION__=2 amiga/amigazip.c
  209. $(O)amigazip.oo : amiga/amigazip.c
  210. $(CC) $(CFLAGS) -d UTIL -o $@ -d __VERSION__=5 -d __REVISION__=2 amiga/amigazip.c
  211. $(O)amigazip.dd : amiga/amigazip.c
  212. $(CC) $(CFLAGD) -d UTIL -o $@ -d __VERSION__=5 -d __REVISION__=2 amiga/amigazip.c