home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / zip22.zip / amiga / smakefile < prev    next >
Makefile  |  1997-10-15  |  23KB  |  639 lines

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