smakefile 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  1. #===========================================================================
  2. # Makefile for Zip, ZipNote, ZipCloak, ZipSplit AMIGA SAS/C Version 6.58
  3. # Version: 2.3 last revised: 07 Jan 2007
  4. #===========================================================================
  5. # -John Bush, <John.Bush@East.Sun.COM>
  6. # or: <JBush@Bix.COM>
  7. # updated for SAS/C Version 6.56+ and AmigaDOS 3.1 (V40)
  8. # by Haidinger Walter, <walthaid@unix.ict.tuwien.ac.at>
  9. # additional supplements and maintenance by Paul Kienitz
  10. # This makefile should work with at least AmigaDOS 2.04 (V37) (not tested)
  11. # and will probably not work with AmigaDOS 1.3 (V34)
  12. # If you have any improvements, critics or else please feel free to mail.
  13. # Any response is appreciated. Haidinger Walter <walthaid@unix.ict.tuwien.ac.at>
  14. # Available targets:
  15. # all builds all executeables below
  16. # zip builds zip executeable
  17. # zipsplit builds zipsplit executeable
  18. # zipcloak builds zipcloak executeable
  19. # zipnote builds zipnote executeable
  20. # ziplm builds low memory version of zip executable
  21. # clean remove all files created by the compilation
  22. # spotless like clean target but removes binaries too
  23. ##########################
  24. # USER MACRO DEFINITIONS #
  25. ##########################
  26. # *** NOTE ***
  27. # The assembly version is not implemented yet.
  28. # (Un)commenting the assembler macros has no effect unless the
  29. # file dependencies are changed too.
  30. # Most of the amiga/*.a files do not assmble with 68000 instructions.
  31. # Any help is appreciated, of course.
  32. # Set the processor to generate code for.
  33. # Compiler: ANY 68000 68010 68020 68030 68040 68060
  34. # Assembler: 0 0 1 2 3 4 n/a
  35. # Defaults: ANY and 0
  36. #
  37. CUSECPU = ANY
  38. AUSECPU = 0
  39. # UNCOMMENT to use 68020 instructions in the assembly version of deflate.o
  40. # Only use if code is generated for 68020 or higher processors above.
  41. # Note: You could use CPUTEST too to enable runtime cpu detection.
  42. # However, it is not recommended since both 68000 and 68020 code will be
  43. # included which would be an unnecessary increase in size.
  44. # (see amiga/deflate.a for more information)
  45. #
  46. #AUSE020 = CPU020
  47. # To disable the assembler replacements and use the standard C source,
  48. # you have to change the Zip and ZipLM dependencies. See below for details.
  49. # (remember that assembler use is *not* implemented yet)
  50. # Uncomment both CUTIL and LUTIL to make use of utility.library of OS 2.04+
  51. # The utility.library is *not* used for UnZipSFX to ensure maximum portability
  52. # between the different Amiga systems (minimal config: 68000 and OS 1.2).
  53. # You can change this by adding the $(LUTIL) macro in the UnZipSFX linking
  54. # rules (See below: Final output targets, UnZipSFX:).
  55. # WARNINGS when using the utility library:
  56. # 1. All Executables will *only* work with AmigaDOS 2.04 (v37) or higher.
  57. # 2. You *need not* compile/link with short-integers using the
  58. # utility.library. It will crash your machine. See Libraries below.
  59. #
  60. # Default: commented (not used)
  61. #
  62. #CUTIL = UTILLIB DEFINE=_UTILLIB
  63. #LUTIL = WITH SC:LIB/utillib.with # include necessary linker defines
  64. # Choose one stack-handling method (default=faster)
  65. # StackExtend: Dynamic runtime stack extension. You won't notice stack overflows.
  66. # StackCheck: On a stack overflow a requester appears which allows you to exit.
  67. # Note that either stack watching will slow down your executable because of the
  68. # extra code run on each function entry. On the other hand, you won't crash
  69. # anymore due to stack overflows. However, you should not have *any* stack
  70. # problems with Info-ZIP programs if you raise your stack to 10000 (which I'd
  71. # recommend as a minimum default stack for all applications) or more using the
  72. # shell stack command. Type 'Stack 20000' or add it to your S:Shell-Startup.
  73. # BTW: Typing 'Stack' prints your current stack size.
  74. #
  75. CSTACK = NOSTACKCHECK STACKEXTEND # slow, but always works
  76. #CSTACK = STACKCHECK NOSTACKEXTEND # slow, requester & graceful exit
  77. #CSTACK = NOSTACKCHECK NOSTACKEXTEND # faster but relies on larger stack (>=10K)
  78. #
  79. # LIBRARIES
  80. # ---------
  81. # Choose one DATAOPTS , SASLIB , ASMOPTS and LSTARTUP
  82. # Always comment/uncomment all macros of a set.
  83. # Library to use with near data and 2-byte integers
  84. # Notes: o slower than 4-byte integers with 68000 cpu
  85. # o *not* recommended due to poor overall performance
  86. # o see comment in amiga/osdep.h
  87. #DATAOPTS = DATA=NEAR SHORTINTEGERS DEF=_NEAR_DATA
  88. #SASLIB = scs
  89. #ASMOPTS = -dINT16
  90. #LSTARTUP = cres.o
  91. # Library to use with near data and 4-byte integers (DEFAULT)
  92. # *** use this with the utility.library ***
  93. DATAOPTS = DATA=NEAR DEF=_NEAR_DATA
  94. SASLIB = sc
  95. ASMOPTS =
  96. LSTARTUP = cres.o
  97. # Library to use with far data and 2-byte integers
  98. # use if DYN_ALLOC is not defined
  99. # old default - far data always works but is slower
  100. #DATAOPTS = DATA=FAR SHORTINTEGERS DEF=_FAR_DATA
  101. #SASLIB = scsnb
  102. #ASMOPTS = -dINT16
  103. #LSTARTUP = c.o
  104. # Library to use with far data and 4-byte integers
  105. # if everything else fails: try this
  106. #DATAOPTS = DATA=FAR DEF=_FAR_DATA
  107. #SASLIB = scnb
  108. #ASMOPTS =
  109. #LSTARTUP = c.o
  110. #
  111. # DEBUGGING
  112. # ---------
  113. # Default: No debugging information added.
  114. # The three macros below will be overwritten if you choose to add
  115. # debug info, therefore no need to comment.
  116. CDBG = NODEBUG NOPROFILE NOCOVERAGE # default: no debug info
  117. ADBG =
  118. LDBG = STRIPDEBUG # default: no debug info
  119. # Compiler and loader debug flags. Uncomment as needed. Recomment when done.
  120. # Optimization disabled for faster compilation (by using NOOPT)
  121. #CDBG1 = DEF=DEBUG DEF=DEBUG_TIME # enables Info-Zip's debug output
  122. # Enable profiling and coverage when desired. Option COVERAGE commented
  123. # seperately because running coverage may corrupt your drive in case of a
  124. # system crash since a file 'cover.dat' is created in your working directory.
  125. # Note that the use of COVERAGE forces the use of the c.o startup module.
  126. #CDBG2 = PROFILE
  127. #CDBG3 = COVERAGE # must use c.o startup code:
  128. #LSTARTUP = c.o # Uncomment *only* when you use COVERAGE
  129. # *Uncomment* here macros CDBG, ADBG and LDBG to include debugging information
  130. #CDBG = $(CDBG1) $(CDBG2) $(CDBG3) ADDSYM DEBUG=FULLFLUSH STACKCHECK NOOPT
  131. #ADBG = DEBUG
  132. #LDBG = ADDSYM
  133. # Optional use of memwatch.library which can be found in your
  134. # sc:extras/memlib directory. Please read the short docs (memlib.doc).
  135. # Note that memwatch.library has a small bug: MWTerm() displays always
  136. # the first entry.
  137. # Get the latest version from aminet (dev/debug/memlib.lha) or
  138. # contact me to get the patch. Uncomment all macros to use.
  139. #CMEMLIB = DEFINE=MWDEBUG=1 # define to enable library
  140. #LMEMLIB = SC:LIB/memwatch.lib # path to library
  141. #LSTARTUP = c.o # must use c.o with memlib!
  142. #
  143. # MAPPING
  144. # -------
  145. # Map filenames used when mapping (no need to comment)
  146. #
  147. MAPFZ = zip.map # Zip map filename
  148. MAPFN = zipnote.map # ZipNote map filename
  149. MAPFC = zipcloak.map # ZipCloak map filename
  150. MAPFS = zipsplit.map # ZipSplit map filename
  151. MAPFL = ziplm.map # Zip low memory version map filename
  152. # Map file output: Uncomment to highlight and bold headings.
  153. #
  154. #MAPFSTYLE = FANCY
  155. # Map flags for each EXECUTABLE. Uncomment to enable mapping.
  156. # For map options please refer to:
  157. # SAS/C v6 manual, volume 1: user's guide, chapter 8, page 136: map
  158. # Default: all options enabled: f,h,l,o,s,x
  159. # |-> options start here
  160. #LMAPZ = $(MAPFSTYLE) MAP $(MAPFZ) f,h,l,o,s,x # Zip maps
  161. #LMAPN = $(MAPFSTYLE) MAP $(MAPFN) f,h,l,o,s,x # ZipNote maps
  162. #LMAPC = $(MAPFSTYLE) MAP $(MAPFC) f,h,l,o,s,x # ZipCloak maps
  163. #LMAPS = $(MAPFSTYLE) MAP $(MAPFS) f,h,l,o,s,x # ZipSplit maps
  164. #LMAPL = $(MAPFSTYLE) MAP $(MAPFL) f,h,l,o,s,x # Zip lowmem maps
  165. #
  166. # LISTINGS
  167. # --------
  168. # Listfile-extensions for each executable (enter *with* dot)
  169. #
  170. LISTEXTZ = .lst # extension for Zip listfiles
  171. LISTEXTU = .ulst # extension for utility listfiles (ZipNote,ZipCloak,ZipSplit)
  172. LISTEXTL = .llst # extension for Zip low memory listfiles
  173. # List files and cross references for each OBJECT.
  174. # Add/remove flags as needed. Not all listed by default.
  175. # Use LISTINCLUDES to determine the dependencies for smake
  176. #
  177. CLISTOPT = LISTHEADERS LISTMACROS # LISTSYSTEM LISTINCLUDES
  178. CXREFOPT = XHEAD XSYS
  179. #
  180. # Uncomment to enable listing (default: commented)
  181. # *** WARNING: List files require *lots* of disk space!
  182. #
  183. #CLIST = LIST $(CLISTOPT)
  184. #CXREF = XREF $(CXREFOPT)
  185. #
  186. # SUPPRESSED COMPILER WARNINGS
  187. # ----------------------------
  188. # Compiler warnings to ignore
  189. #
  190. # Warning 105 : module does not define any externally-known symbols
  191. # Warning 304 : Dead assignment eliminated...
  192. # Note 306 : ...function inlined...
  193. # Warning 317 : possibly uninitialized variable...
  194. # Comment to enable.
  195. #
  196. CIGNORE = IGNORE=105,304,306,317
  197. #
  198. # OBJECT EXTENSIONS
  199. #
  200. # Extensions used for objects of each executeable.
  201. # Transformation rules require unique extensions.
  202. # Enter *with* dot.
  203. #
  204. O = .o # extension for Zip objects
  205. OU = .uo # extension for utility objects (ZipNote, ZipSplit and ZipCloak)
  206. OL = .lo # extension for low memory Zip objects
  207. # Filename used to store converted options from environment variable
  208. # LOCAL_ZIP. Default: scoptions_local_zip
  209. #
  210. CWITHOPT = scoptions_local_zip
  211. # Filenames to store compiler options to prevent command line overflow
  212. #
  213. # Common options file for Zip and other executables
  214. CFILE = scoptions-zip
  215. # Temp filenames for object lists to load using linker "WITH" command.
  216. OBJLISTZ = zip_objlist.with # Zip object list
  217. OBJLISTN = zipnote_objlist.with # ZipNote object list
  218. OBJLISTC = zipcloak_objlist.with # ZipCloak object list
  219. OBJLISTS = zipsplit_objlist.with # ZipSplit object list
  220. OBJLISTL = ziplm_objlist.with # Zip low-mem object list
  221. # Filenames to store linker options
  222. #
  223. LWITHZ = zip.lnk # zip linker options
  224. LWITHN = zipnote.lnk # zipnote linker options
  225. LWITHC = zipcloak.lnk # zipcloak linker options
  226. LWITHS = zipsplit.lnk # zipsplit linker options
  227. LWITHL = ziplm.lnk # zip low-mem linker options
  228. # Define AMIGA_BETA to print "Beta Notice" up front. See tailor.h.
  229. # Undefine AMIGA_BETA when building a released version.
  230. #CDEFBETA = DEF=AMIGA_BETA
  231. #####################################
  232. # NOTHING TO CHANGE BEYOND HERE ... #
  233. #####################################
  234. # (except for C/asm dependencies)
  235. # Define MEDIUM_MEM for production release (per Paul Kienitz).
  236. # This reduces runtime memory requirement but not speed or compression.
  237. # Note: Do *not* use BIG_MEM or MMAP since it isn't yet supported by the
  238. assembler version of deflate.c : amiga/deflate.a
  239. CUSEMEM = DEF=MEDIUM_MEM
  240. AUSEMEM = -DMEDIUM_MEM # for asm deflate.o, must match above
  241. # Defines for building low-memory use version of Zip
  242. WSIZEL = WSIZE=4096 # deflate.c window size for low-mem version
  243. CLOWMEM = DEF=SMALL_MEM DEF=$(WSIZEL)
  244. ALOWMEM = -DSMALL_MEM -D$(WSIZEL) # for asm deflate.o, must match above
  245. # Compiler definitions
  246. #
  247. CC = sc
  248. #
  249. # Optimizer flags
  250. #
  251. OPTPASSES = 6 # set number of global optimizer passes
  252. #
  253. OPT1 = OPT OPTINL OPTINLOCAL OPTTIME OPTLOOP OPTSCHED
  254. OPT2 = OPTCOMP=$(OPTPASSES) OPTDEP=$(OPTPASSES) OPTRDEP=$(OPTPASSES)
  255. OPT = $(OPT1) $(OPT2)
  256. # Compiler flags
  257. #
  258. CDEFINES = $(CMEMLIB) $(CDEFBETA) DEF=AMIGA
  259. COPTIONS = $(DATAOPTS) CODE=NEAR CPU=$(CUSECPU) VERBOSE PARAMETERS=BOTH NOMINC
  260. COPTIONS = $(COPTIONS) ERRORREXX NOERRORCONSOLE MEMSIZE=HUGE $(CLIST) $(CXREF)
  261. COPTIONS = $(COPTIONS) $(CSTACK) $(CUTIL) STRICT UNSCHAR NOICONS STRINGMERGE
  262. CFLAGS = $(CDEFINES) $(COPTIONS) $(OPT) $(CDBG) $(CIGNORE)
  263. # Linker definitions
  264. # See SASLIB definition above
  265. #
  266. LD = slink
  267. # special linker flags for pure (i.e. resident) binary.
  268. LDFLAGSS = FROM SC:LIB/$(LSTARTUP)
  269. # common linker flags for all other executeables
  270. LDFLAGSC = FROM SC:LIB/c.o
  271. LDFLAGS2 = NOICONS $(LDBG)
  272. LIBFLAGS = LIB $(LMEMLIB) SC:LIB/$(SASLIB).lib SC:LIB/amiga.lib
  273. # Assembler definitions
  274. #
  275. ASM = asm
  276. #
  277. # Options used for assembling amiga/deflate.a
  278. # Must match defines in C-Source.
  279. #
  280. AFLAGS0 = -d__SASC -dSASC -dAMIGA
  281. AFLAGS1 = $(AUSE020) $(ASMOPTS) $(ADBG)
  282. AFLAGS2 = -m$(AUSECPU) -jm -iINCLUDE:
  283. AFLAGS = $(AFLAGS0) $(AFLAGS1) $(AFLAGS2)
  284. ASMOPTSZ = $(AFLAGS) $(AUSEMEM) -dDYN_ALLOC # Zip asm flags
  285. ASMOPTSL = $(AFLAGS) $(ALOWMEM) # Zip low-mem version asm flags
  286. ##################
  287. # TARGET OBJECTS #
  288. ##################
  289. # Zip objects
  290. OBJZ1 = zip$(O) zipfile$(O) zipup$(O) fileio$(O) util$(O) globals$(O)
  291. OBJZ2 = crc32$(O) crypt$(O) timezone$(O) ttyio$(O)
  292. OBJZI = deflate$(O) trees$(O)
  293. OBJZA = amiga$(O) amigazip$(O) stat$(O) filedate$(O)
  294. OBJZ = $(OBJZ1) $(OBJZ2) $(OBJZI) $(OBJZA)
  295. # Shared utility objects for ZipNote, ZipCloak and ZipSplit
  296. OBJU1 = globals$(O)
  297. OBJUU = zipfile$(OU) fileio$(OU) timezone$(O) util$(OU)
  298. OBJUA = amigazip$(OU) amiga$(O) stat$(O) filedate$(O)
  299. OBJU = $(OBJU1) $(OBJUU) $(OBJUA)
  300. # ZipNote objects
  301. OBJN1 = zipnote$(O)
  302. OBJN = $(OBJN1) $(OBJU)
  303. # ZipCloak objects
  304. OBJC1 = zipcloak$(O)
  305. OBJCU = $(OBJU) crypt$(OU)
  306. OBJCS = crc32$(OU) ttyio$(O)
  307. OBJC = $(OBJC1) $(OBJCU) $(OBJCS)
  308. #ZipSplit objects
  309. OBJS1 = zipsplit$(O)
  310. OBJS = $(OBJS1) $(OBJU)
  311. # ZipLM objects
  312. OBJL1 = zip$(OL) zipfile$(OL) zipup$(OL) fileio$(OL) util$(OL) globals$(OL)
  313. OBJL2 = crc32$(OL) crypt$(OL) timezone$(OL) ttyio$(OL)
  314. OBJLI = deflate$(OL) trees$(OL)
  315. OBJLA = amiga$(OL) amigazip$(OL) stat$(OL) filedate$(OL)
  316. OBJL = $(OBJL1) $(OBJL2) $(OBJLI) $(OBJLA)
  317. # Common header files
  318. ZIP_H1 = zip.h ziperr.h tailor.h
  319. ZIP_HA = amiga/osdep.h amiga/z-stat.h
  320. ZIP_H = $(ZIP_H1) $(ZIP_HA)
  321. # Output targets
  322. ZIPS = Zip ZipNote ZipCloak ZipSplit ZipLM
  323. # Temp filenames for object lists to load using linker "WITH" command.
  324. OBJLISTZ = zip_objlist.with # Zip object list
  325. OBJLISTN = zipnote_objlist.with # ZipNote object list
  326. OBJLISTC = zipcloak_objlist.with # ZipCloak object list
  327. OBJLISTS = zipsplit_objlist.with # ZipSplit object list
  328. OBJLISTL = ziplm_objlist.with # Zip low-mem object list
  329. #######################################
  330. # DEFAULT TARGET AND PROCESSING RULES #
  331. #######################################
  332. all: request flush $(ZIPS)
  333. # Zip transformation rules
  334. #
  335. .c$(O):
  336. $(CC) WITH=$(CFILE) $(CUSEMEM) LISTFILE=$>$(LISTEXTZ) OBJNAME=$@ $*.c
  337. # Zip low-memory version transformation rules
  338. #
  339. .c$(OL):
  340. $(CC) WITH=$(CFILE) $(CLOWMEM) LISTFILE=$>$(LISTEXTL) OBJNAME=$@ $*.c
  341. # Utilities (ZipNote, ZipCloak and ZipSplit) transformation rules
  342. #
  343. .c$(OU):
  344. $(CC) WITH=$(CFILE) $(CUSEMEM) DEF=UTIL LISTFILE=$>$(LISTEXTU) OBJNAME=$@ $*.c
  345. #########################
  346. # Final output targets. #
  347. #########################
  348. zip: local_zip CommonFlags $(OBJZ)
  349. @Echo "$(OBJZ)" > $(OBJLISTZ)
  350. Type $(OBJLISTZ)
  351. @Echo "$(LDFLAGSS) $(LUTIL) WITH $(OBJLISTZ) $(LIBFLAGS)" \
  352. "$(LDFLAGS2) $(LMAPZ)" >$(LWITHZ)
  353. Type $(LWITHZ)
  354. $(LD) TO Zip WITH $(LWITHZ)
  355. zipnote: local_zip CommonFlags $(OBJN)
  356. @Echo "$(OBJN)" > $(OBJLISTN)
  357. Type $(OBJLISTN)
  358. @Echo "$(LDFLAGSS) $(LUTIL) WITH $(OBJLISTN) $(LIBFLAGS) " \
  359. "$(LDFLAGS2) $(LMAPN)" >$(LWITHN)
  360. Type $(LWITHN)
  361. $(LD) TO ZipNote WITH $(LWITHN)
  362. zipcloak: local_zip CommonFlags $(OBJC)
  363. @Echo "$(OBJC)" > $(OBJLISTC)
  364. Type $(OBJLISTC)
  365. @Echo "$(LDFLAGSS) $(LUTIL) WITH $(OBJLISTC) $(LIBFLAGS) " \
  366. "$(LDFLAGS2) $(LMAPC)" >$(LWITHC)
  367. Type $(LWITHC)
  368. $(LD) TO ZipCloak WITH $(LWITHC)
  369. zipsplit: local_zip CommonFlags $(OBJS)
  370. @Echo "$(OBJS)" > $(OBJLISTS)
  371. Type $(OBJLISTS)
  372. @Echo "$(LDFLAGSS) $(LUTIL) WITH $(OBJLISTS) $(LIBFLAGS) " \
  373. "$(LDFLAGS2) $(LMAPS)" >$(LWITHS)
  374. Type $(LWITHS)
  375. $(LD) TO ZipSplit WITH $(LWITHS)
  376. ziplm: local_zip CommonFlags $(OBJL)
  377. @Echo "$(OBJL)" > $(OBJLISTL)
  378. Type $(OBJLISTL)
  379. @Echo "$(LDFLAGSS) $(LUTIL) WITH $(OBJLISTL) $(LIBFLAGS) " \
  380. "$(LDFLAGS2) $(LMAPL)" >$(LWITHL)
  381. Type $(LWITHL)
  382. $(LD) TO ZipLM WITH $(LWITHL)
  383. clean:
  384. -Delete >nil: $(OBJZ) quiet
  385. -Delete >nil: $(OBJN) quiet
  386. -Delete >nil: $(OBJC) quiet
  387. -Delete >nil: $(OBJS) quiet
  388. -Delete >nil: $(OBJL) quiet
  389. -Delete >nil: $(OBJLISTZ) $(OBJLISTL) $(OBJLISTN) $(OBJLISTS) $(OBJLISTC) quiet
  390. -Delete >nil: $(MAPFZ) $(MAPFN) $(MAPFC) $(MAPFS) $(MAPFL) quiet
  391. -Delete >nil: \#?$(LISTEXTZ) \#?$(LISTEXTU) \#?$(LISTEXTL) quiet
  392. -Delete >nil: $(CWITHOPT) $(CFILE) quiet
  393. -Delete >nil: $(LWITHZ) $(LWITHN) $(LWITHC) $(LWITHS) $(LWITHL) quiet
  394. -Delete >nil: env:VersionDate quiet
  395. -Delete >nil: \#?.q.?? \#?.tmp \#?.cov quiet
  396. spotless: clean
  397. -Delete >nil: $(ZIPS) quiet
  398. ################
  399. # DEPENDENCIES #
  400. ################
  401. # To change between the assembler and C sources, you have to comment/uncomment
  402. # the approprite lines. C sources are marked by #C-src and assembler sources
  403. # #asm-src at the end.
  404. # Zip dependencies:
  405. #
  406. zip$(O): zip.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h
  407. zipup$(O): zipup.c $(ZIP_H) revision.h crc32.h crypt.h amiga/zipup.h
  408. zipfile$(O): zipfile.c $(ZIP_H) revision.h crc32.h
  409. crypt$(O): crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h
  410. ttyio$(O): ttyio.c $(ZIP_H) crypt.h ttyio.h
  411. deflate$(O): deflate.c $(ZIP_H) #C-src
  412. trees$(O): trees.c $(ZIP_H)
  413. fileio$(O): fileio.c $(ZIP_H) crc32.h
  414. util$(O): util.c $(ZIP_H)
  415. crc32$(O): crc32.c $(ZIP_H) crc32.h
  416. globals$(O): globals.c $(ZIP_H)
  417. timezone$(O): timezone.c $(ZIP_H) timezone.h
  418. # Amiga specific objects
  419. stat$(O): amiga/stat.c amiga/z-stat.h
  420. filedate$(O): amiga/filedate.c crypt.h timezone.h
  421. amiga$(O): amiga/amiga.c ziperr.h
  422. amigazip$(O): amiga/amigazip.c $(ZIP_H) amiga/amiga.h env:Workbench
  423. # Substitute assembly version of deflate.c:
  424. #deflate$(O): amiga/deflate.a #asm-src
  425. # $(ASM) $(ASMOPTSZ) -o$@ $*.a #asm-src
  426. # Utility (ZipNote, ZipCloak, ZipSplit) dependencies:
  427. #
  428. zipnote$(O): zipnote.c $(ZIP_H) revision.h
  429. zipcloak$(O): zipcloak.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h
  430. zipsplit$(O): zipsplit.c $(ZIP_H) revision.h
  431. zipfile$(OU): zipfile.c $(ZIP_H) revision.h crc32.h
  432. fileio$(OU): fileio.c $(ZIP_H) crc32.h
  433. util$(OU): util.c $(ZIP_H)
  434. crc32$(OU): crc32.c $(ZIP_H) crc32.h
  435. crypt$(OU): crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h
  436. # Amiga specific objects
  437. amigazip$(OU): amiga/amigazip.c $(ZIP_H) amiga/amiga.h env:Workbench
  438. # ZipLM dependencies:
  439. #
  440. zip$(OL): zip.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h
  441. zipup$(OL): zipup.c $(ZIP_H) revision.h crc32.h crypt.h amiga/zipup.h
  442. zipfile$(OL): zipfile.c $(ZIP_H) revision.h crc32.h
  443. crypt$(OL): crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h
  444. ttyio$(OL): ttyio.c $(ZIP_H) crypt.h ttyio.h
  445. deflate$(OL): deflate.c $(ZIP_H)
  446. trees$(OL): trees.c $(ZIP_H)
  447. fileio$(OL): fileio.c $(ZIP_H) crc32.h
  448. util$(OL): util.c $(ZIP_H)
  449. crc32$(OL): crc32.c $(ZIP_H)
  450. globals$(OL): globals.c $(ZIP_H)
  451. timezone$(OL): timezone.c $(ZIP_H) timezone.h
  452. # Amiga specific objects
  453. stat$(OL): amiga/stat.c amiga/z-stat.h
  454. filedate$(OL): amiga/filedate.c crypt.h timezone.h
  455. amiga$(OL): amiga/amiga.c ziperr.h
  456. # Substitute assembly version of deflate.c:
  457. #deflate$(OL): amiga/deflate.a
  458. # $(ASM) $(ASMOPTSL) -o$@ $*.a
  459. ########################
  460. # DEPENDECIES END HERE #
  461. ########################
  462. # flush all libraries to provide more mem for compilation
  463. flush:
  464. @Avail flush >nil:
  465. # write common compiler flags to file and echo to user
  466. CommonFlags:
  467. @Echo "$(CFLAGS)" >$(CFILE)
  468. @Type "$(CWITHOPT)" >>$(CFILE)
  469. -Type $(CFILE)
  470. # special rules for adding Amiga internal version number to amiga/amiga.c
  471. amiga$(O):
  472. rx > env:VersionDate "say '""'translate(date('E'),'.','/')'""'"
  473. $(CC) WITH=$(CFILE) $(CUSEMEM) LISTFILE=$>$(LISTEXTZ) OBJNAME=$@ $*.c
  474. -Delete env:VersionDate
  475. amiga$(OL):
  476. rx > env:VersionDate "say '""'translate(date('E'),'.','/')'""'"
  477. $(CC) WITH=$(CFILE) $(CLOWMEM) LISTFILE=$>$(LISTEXTL) OBJNAME=$@ $*.c
  478. -Delete env:VersionDate
  479. # needed in amiga/amigazip.c
  480. # should be set in startup-sequence, but just in case:
  481. # (only works with OS 2.0 and above)
  482. env\:WorkBench:
  483. @Execute < < (Workbench_smk.tmp)
  484. FailAt 21
  485. If not exists ENV:Workbench
  486. Version >nil:
  487. SetEnv Workbench $$Workbench
  488. Endif
  489. <
  490. # Read environment variable LOCAL_ZIP and convert options to SAS format
  491. #
  492. # e.g.: to define FOO_ONE and FOO_TWO enter:
  493. #
  494. # SetEnv LOCAL_ZIP "-DFOO_ONE -DFOO_TWO"
  495. #
  496. # Put the statement into your startup-sequence or (for AmigaDOS 2.0 or higher
  497. # only) make sure LOCAL_ZIP is stored in the ENVARC: directory
  498. # ( Copy ENV:LOCAL_ZIP ENVARC: )
  499. #
  500. local_zip:
  501. @Execute < < (Local_Zip_smk.tmp)
  502. Failat 21
  503. If exists ENV:LOCAL_ZIP
  504. Echo "Using environment variable LOCAL_ZIP !"
  505. Copy >NIL: ENV:LOCAL_ZIP SASCOPTS
  506. Else
  507. Echo "You could use envvar ZIP_OPT to set your special compilation options."
  508. Delete >nil: SASCOPTS quiet
  509. Endif
  510. ; Do not remove the lctosc command! If LOCAL_ZIP is unset, an
  511. ; empty file is created which needed by CommonFlags !
  512. lctosc >$(CWITHOPT)
  513. <
  514. # Echo request to the user
  515. #
  516. request:
  517. @Echo ""
  518. @Echo " This makefile is for use with SAS/C version 6.58."
  519. @Echo " If you still have an older version, please upgrade!"
  520. @Echo " Patches are available on the Aminet under biz/patch/sc\#?."
  521. @Echo ""
  522. @Echo " Just a simple request..."
  523. @Echo " Please give me a mail that you compiled whether you encounter any errors"
  524. @Echo " or not. I'd just like to know how many Amiga users actually make use of"
  525. @Echo " this makefile."
  526. @Echo " If you mail me, I'll put you on my mailing-list and notify you whenever"
  527. @Echo " new versions of Info-Zip are released."
  528. @Echo " Have a look at the makefile for changes like CPU type, UtilLib, etc."
  529. @Echo " Feel free to mail comments, suggestions, etc."
  530. @Echo " Enjoy Info-Zip !"
  531. @Echo " Haidinger Walter, <walthaid@unix.ict.tuwien.ac.at>"
  532. @Echo ""
  533. # Echo help in case of an error
  534. #
  535. .ONERROR:
  536. @Echo ""
  537. @Echo "[sigh] An error running this makefile was detected."
  538. @Echo "This message may also appear if you interrupted smake by pressing CTRL-C."
  539. @Echo "Contact Info-Zip authors at Zip-Bugs@lists.wku.edu or me for help."
  540. @Echo "Haidinger Walter, <walthaid@unix.ict.tuwien.ac.at>"