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