summaryrefslogtreecommitdiff
path: root/amiga/smakefile
blob: ce1317d77b48b19bfb26783847fdabcdc259e0cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
#===========================================================================
# Makefile for Zip, ZipNote, ZipCloak, ZipSplit     AMIGA SAS/C Version 6.58
# Version:  2.3                                   last revised:  07 Jan 2007
#===========================================================================
# -John Bush, <John.Bush@East.Sun.COM>
#         or: <JBush@Bix.COM>

# updated for SAS/C Version 6.56+ and AmigaDOS 3.1 (V40)
# by Haidinger Walter, <walthaid@unix.ict.tuwien.ac.at>

# additional supplements and maintenance by Paul Kienitz

# This makefile should work with at least AmigaDOS 2.04 (V37)  (not tested)
# and will probably not work with AmigaDOS 1.3 (V34)

# If you have any improvements, critics or else please feel free to mail.
# Any response is appreciated. Haidinger Walter <walthaid@unix.ict.tuwien.ac.at>

# Available targets:
# all           builds all executeables below
# zip           builds zip executeable
# zipsplit      builds zipsplit executeable
# zipcloak      builds zipcloak executeable
# zipnote       builds zipnote executeable
# ziplm         builds low memory version of zip executable
# clean         remove all files created by the compilation
# spotless      like clean target but removes binaries too


##########################
# USER MACRO DEFINITIONS #
##########################

# *** NOTE ***
# The assembly version is not implemented yet.
# (Un)commenting the assembler macros has no effect unless the
# file dependencies are changed too.
# Most of the amiga/*.a files do not assmble with 68000 instructions.
# Any help is appreciated, of course.

# Set the processor to generate code for.
# Compiler:    ANY 68000 68010 68020 68030 68040 68060
# Assembler:     0     0     1     2     3     4   n/a
# Defaults: ANY and 0
#
CUSECPU = ANY
AUSECPU = 0

# UNCOMMENT to use 68020 instructions in the assembly version of deflate.o
# Only use if code is generated for 68020 or higher processors above.
# Note: You could use CPUTEST too to enable runtime cpu detection.
# However, it is not recommended since both 68000 and 68020 code will be
# included which would be an unnecessary increase in size.
# (see amiga/deflate.a for more information)
#
#AUSE020 = CPU020

# To disable the assembler replacements and use the standard C source,
# you have to change the Zip and ZipLM dependencies. See below for details.
# (remember that assembler use is *not* implemented yet)

# Uncomment both CUTIL and LUTIL to make use of utility.library of OS 2.04+
# The utility.library is *not* used for UnZipSFX to ensure maximum portability
# between the different Amiga systems (minimal config: 68000 and OS 1.2).
# You can change this by adding the $(LUTIL) macro in the UnZipSFX linking
# rules (See below: Final output targets, UnZipSFX:).
# WARNINGS when using the utility library:
# 1. All Executables will *only* work with AmigaDOS 2.04 (v37) or higher.
# 2. You *need not* compile/link with short-integers using the
#    utility.library. It will crash your machine. See Libraries below.
#
# Default: commented (not used)
#
#CUTIL = UTILLIB DEFINE=_UTILLIB
#LUTIL = WITH SC:LIB/utillib.with    # include necessary linker defines
# Choose one stack-handling method (default=faster)
# StackExtend: Dynamic runtime stack extension. You won't notice stack overflows.
# StackCheck: On a stack overflow a requester appears which allows you to exit.
# Note that either stack watching will slow down your executable because of the
# extra code run on each function entry. On the other hand, you won't crash
# anymore due to stack overflows. However, you should not have *any* stack
# problems with Info-ZIP programs if you raise your stack to 10000 (which I'd
# recommend as a minimum default stack for all applications) or more using the
# shell stack command. Type 'Stack 20000' or add it to your S:Shell-Startup.
# BTW: Typing 'Stack' prints your current stack size.
#
CSTACK = NOSTACKCHECK STACKEXTEND     # slow, but always works
#CSTACK = STACKCHECK NOSTACKEXTEND    # slow, requester & graceful exit
#CSTACK = NOSTACKCHECK NOSTACKEXTEND  # faster but relies on larger stack (>=10K)


#
# LIBRARIES
# ---------

# Choose one DATAOPTS , SASLIB , ASMOPTS and LSTARTUP
# Always comment/uncomment all macros of a set.

# Library to use with near data and 2-byte integers
# Notes: o  slower than 4-byte integers with 68000 cpu
#        o  *not* recommended due to poor overall performance
#        o  see comment in amiga/osdep.h
#DATAOPTS = DATA=NEAR SHORTINTEGERS DEF=_NEAR_DATA
#SASLIB   = scs
#ASMOPTS  = -dINT16
#LSTARTUP = cres.o

# Library to use with near data and 4-byte integers (DEFAULT)
# *** use this with the utility.library ***
DATAOPTS = DATA=NEAR DEF=_NEAR_DATA
SASLIB   = sc
ASMOPTS  =
LSTARTUP = cres.o

# Library to use with far data and 2-byte integers
# use if DYN_ALLOC is not defined
# old default - far data always works but is slower
#DATAOPTS = DATA=FAR SHORTINTEGERS DEF=_FAR_DATA
#SASLIB   = scsnb
#ASMOPTS  = -dINT16
#LSTARTUP = c.o

# Library to use with far data and 4-byte integers
# if everything else fails: try this
#DATAOPTS = DATA=FAR DEF=_FAR_DATA
#SASLIB   = scnb
#ASMOPTS  =
#LSTARTUP = c.o


#
# DEBUGGING
# ---------

# Default: No debugging information added.
# The three macros below will be overwritten if you choose to add
# debug info, therefore no need to comment.

CDBG = NODEBUG NOPROFILE NOCOVERAGE    # default: no debug info
ADBG =
LDBG = STRIPDEBUG                      # default: no debug info

# Compiler and loader debug flags.  Uncomment as needed.  Recomment when done.
# Optimization disabled for faster compilation (by using NOOPT)

#CDBG1 = DEF=DEBUG DEF=DEBUG_TIME     # enables Info-Zip's debug output

# Enable profiling and coverage when desired. Option COVERAGE commented
# seperately because running coverage may corrupt your drive in case of a
# system crash since a file 'cover.dat' is created in your working directory.
# Note that the use of COVERAGE forces the use of the c.o startup module.

#CDBG2 = PROFILE
#CDBG3 = COVERAGE        # must use c.o startup code:
#LSTARTUP = c.o          # Uncomment *only* when you use COVERAGE

# *Uncomment* here macros CDBG, ADBG and LDBG to include debugging information

#CDBG = $(CDBG1) $(CDBG2) $(CDBG3) ADDSYM DEBUG=FULLFLUSH STACKCHECK NOOPT
#ADBG = DEBUG
#LDBG = ADDSYM

# Optional use of memwatch.library which can be found in your
# sc:extras/memlib directory. Please read the short docs (memlib.doc).
# Note that memwatch.library has a small bug: MWTerm() displays always
# the first entry.
# Get the latest version from aminet (dev/debug/memlib.lha) or
# contact me to get the patch. Uncomment all macros to use.
#CMEMLIB  = DEFINE=MWDEBUG=1       # define to enable library
#LMEMLIB  = SC:LIB/memwatch.lib       # path to library
#LSTARTUP = c.o                    # must use c.o with memlib!


#
# MAPPING
# -------

# Map filenames used when mapping (no need to comment)
#
MAPFZ = zip.map                # Zip      map filename
MAPFN = zipnote.map            # ZipNote  map filename
MAPFC = zipcloak.map           # ZipCloak map filename
MAPFS = zipsplit.map           # ZipSplit map filename
MAPFL = ziplm.map              # Zip low memory version map filename

# Map file output: Uncomment to highlight and bold headings.
#
#MAPFSTYLE = FANCY

# Map flags for each EXECUTABLE. Uncomment to enable mapping.
# For map options please refer to:
# SAS/C v6 manual, volume 1: user's guide, chapter 8, page 136: map
# Default: all options enabled: f,h,l,o,s,x
#                                 |-> options start here
#LMAPZ = $(MAPFSTYLE) MAP $(MAPFZ) f,h,l,o,s,x   # Zip      maps
#LMAPN = $(MAPFSTYLE) MAP $(MAPFN) f,h,l,o,s,x   # ZipNote  maps
#LMAPC = $(MAPFSTYLE) MAP $(MAPFC) f,h,l,o,s,x   # ZipCloak maps
#LMAPS = $(MAPFSTYLE) MAP $(MAPFS) f,h,l,o,s,x   # ZipSplit maps
#LMAPL = $(MAPFSTYLE) MAP $(MAPFL) f,h,l,o,s,x   # Zip lowmem maps

#
# LISTINGS
# --------

# Listfile-extensions for each executable (enter *with* dot)
#
LISTEXTZ = .lst   # extension for Zip listfiles
LISTEXTU = .ulst  # extension for utility listfiles (ZipNote,ZipCloak,ZipSplit)
LISTEXTL = .llst  # extension for Zip low memory listfiles


# List files and cross references for each OBJECT.
# Add/remove flags as needed. Not all listed by default.
# Use LISTINCLUDES to determine the dependencies for smake
#
CLISTOPT = LISTHEADERS LISTMACROS # LISTSYSTEM LISTINCLUDES
CXREFOPT = XHEAD XSYS
#
# Uncomment to enable listing (default: commented)
# *** WARNING: List files require *lots* of disk space!
#
#CLIST = LIST $(CLISTOPT)
#CXREF = XREF $(CXREFOPT)


#
# SUPPRESSED COMPILER WARNINGS
# ----------------------------

# Compiler warnings to ignore
#
# Warning 105 : module does not define any externally-known symbols
# Warning 304 : Dead assignment eliminated...
# Note    306 : ...function inlined...
# Warning 317 : possibly uninitialized variable...
# Comment to enable.
#
CIGNORE = IGNORE=105,304,306,317


#
# OBJECT EXTENSIONS
#

# Extensions used for objects of each executeable.
# Transformation rules require unique extensions.
# Enter *with* dot.
#
O  = .o     # extension for Zip     objects
OU = .uo    # extension for utility objects (ZipNote, ZipSplit and ZipCloak)
OL = .lo    # extension for low memory Zip objects


# Filename used to store converted options from environment variable
# LOCAL_ZIP. Default: scoptions_local_zip
#
CWITHOPT = scoptions_local_zip


# Filenames to store compiler options to prevent command line overflow
#
# Common options file for Zip and other executables
CFILE = scoptions-zip


# Temp filenames for object lists to load using linker "WITH" command.
OBJLISTZ = zip_objlist.with            # Zip      object list
OBJLISTN = zipnote_objlist.with        # ZipNote  object list
OBJLISTC = zipcloak_objlist.with       # ZipCloak object list
OBJLISTS = zipsplit_objlist.with       # ZipSplit object list
OBJLISTL = ziplm_objlist.with          # Zip low-mem object list


# Filenames to store linker options
#
LWITHZ = zip.lnk                       # zip      linker options
LWITHN = zipnote.lnk                   # zipnote  linker options
LWITHC = zipcloak.lnk                  # zipcloak linker options
LWITHS = zipsplit.lnk                  # zipsplit linker options
LWITHL = ziplm.lnk                     # zip low-mem linker options


# Define AMIGA_BETA to print "Beta Notice" up front.  See tailor.h.
# Undefine AMIGA_BETA when building a released version.
#CDEFBETA = DEF=AMIGA_BETA

#####################################
# NOTHING TO CHANGE BEYOND HERE ... #
#####################################
# (except for C/asm dependencies)

# Define MEDIUM_MEM for production release (per Paul Kienitz).
# This reduces runtime memory requirement but not speed or compression.
# Note: Do *not* use BIG_MEM or MMAP since it isn't yet supported by the
        assembler version of deflate.c : amiga/deflate.a
CUSEMEM = DEF=MEDIUM_MEM
AUSEMEM = -DMEDIUM_MEM       # for asm deflate.o, must match above


# Defines for building low-memory use version of Zip
WSIZEL   = WSIZE=4096     # deflate.c window size for low-mem version
CLOWMEM = DEF=SMALL_MEM DEF=$(WSIZEL)
ALOWMEM = -DSMALL_MEM   -D$(WSIZEL)  # for asm deflate.o, must match above


# Compiler definitions
#
CC = sc
#
# Optimizer flags
#
OPTPASSES = 6     # set number of global optimizer passes
#
OPT1 = OPT OPTINL OPTINLOCAL OPTTIME OPTLOOP OPTSCHED
OPT2 = OPTCOMP=$(OPTPASSES) OPTDEP=$(OPTPASSES) OPTRDEP=$(OPTPASSES)
OPT  = $(OPT1) $(OPT2)


# Compiler flags
#
CDEFINES = $(CMEMLIB) $(CDEFBETA) DEF=AMIGA
COPTIONS = $(DATAOPTS) CODE=NEAR CPU=$(CUSECPU) VERBOSE PARAMETERS=BOTH NOMINC
COPTIONS = $(COPTIONS) ERRORREXX NOERRORCONSOLE MEMSIZE=HUGE $(CLIST) $(CXREF)
COPTIONS = $(COPTIONS) $(CSTACK) $(CUTIL) STRICT UNSCHAR NOICONS STRINGMERGE
CFLAGS = $(CDEFINES) $(COPTIONS) $(OPT) $(CDBG) $(CIGNORE)


# Linker definitions
#  See SASLIB definition above
#
LD = slink
# special linker flags for pure (i.e. resident) binary.
LDFLAGSS = FROM SC:LIB/$(LSTARTUP)
# common linker flags for all other executeables
LDFLAGSC = FROM SC:LIB/c.o
LDFLAGS2 = NOICONS $(LDBG)
LIBFLAGS = LIB $(LMEMLIB) SC:LIB/$(SASLIB).lib SC:LIB/amiga.lib


# Assembler definitions
#
ASM = asm
#
# Options used for assembling amiga/deflate.a
# Must match defines in C-Source.
#
AFLAGS0  = -d__SASC -dSASC -dAMIGA
AFLAGS1  = $(AUSE020) $(ASMOPTS) $(ADBG)
AFLAGS2  = -m$(AUSECPU) -jm -iINCLUDE:
AFLAGS   = $(AFLAGS0) $(AFLAGS1) $(AFLAGS2)
ASMOPTSZ = $(AFLAGS) $(AUSEMEM) -dDYN_ALLOC     # Zip asm flags
ASMOPTSL = $(AFLAGS) $(ALOWMEM)                 # Zip low-mem version asm flags


##################
# TARGET OBJECTS #
##################


# Zip objects
OBJZ1 = zip$(O) zipfile$(O) zipup$(O) fileio$(O) util$(O) globals$(O)
OBJZ2 = crc32$(O) crypt$(O) timezone$(O) ttyio$(O)
OBJZI = deflate$(O) trees$(O)
OBJZA = amiga$(O) amigazip$(O) stat$(O) filedate$(O)
OBJZ  = $(OBJZ1) $(OBJZ2) $(OBJZI) $(OBJZA)

# Shared utility objects for ZipNote, ZipCloak and ZipSplit
OBJU1 = globals$(O)
OBJUU = zipfile$(OU) fileio$(OU) timezone$(O) util$(OU)
OBJUA = amigazip$(OU) amiga$(O) stat$(O) filedate$(O)
OBJU  = $(OBJU1) $(OBJUU) $(OBJUA)

# ZipNote objects
OBJN1 = zipnote$(O)
OBJN  = $(OBJN1) $(OBJU)

# ZipCloak objects
OBJC1 = zipcloak$(O)
OBJCU = $(OBJU) crypt$(OU)
OBJCS = crc32$(OU) ttyio$(O)
OBJC  = $(OBJC1) $(OBJCU) $(OBJCS)

#ZipSplit objects
OBJS1 = zipsplit$(O)
OBJS  = $(OBJS1) $(OBJU)

# ZipLM objects
OBJL1 = zip$(OL) zipfile$(OL) zipup$(OL) fileio$(OL) util$(OL) globals$(OL)
OBJL2 = crc32$(OL) crypt$(OL) timezone$(OL) ttyio$(OL)
OBJLI = deflate$(OL) trees$(OL)
OBJLA = amiga$(OL) amigazip$(OL) stat$(OL) filedate$(OL)
OBJL  = $(OBJL1) $(OBJL2) $(OBJLI) $(OBJLA)

# Common header files
ZIP_H1 = zip.h ziperr.h tailor.h
ZIP_HA = amiga/osdep.h amiga/z-stat.h
ZIP_H  = $(ZIP_H1) $(ZIP_HA)

# Output targets
ZIPS  = Zip ZipNote ZipCloak ZipSplit ZipLM


# Temp filenames for object lists to load using linker "WITH" command.
OBJLISTZ = zip_objlist.with            # Zip      object list
OBJLISTN = zipnote_objlist.with        # ZipNote  object list
OBJLISTC = zipcloak_objlist.with       # ZipCloak object list
OBJLISTS = zipsplit_objlist.with       # ZipSplit object list
OBJLISTL = ziplm_objlist.with          # Zip low-mem object list

#######################################
# DEFAULT TARGET AND PROCESSING RULES #
#######################################

all: request flush $(ZIPS)

# Zip transformation rules
#
.c$(O):
      $(CC) WITH=$(CFILE) $(CUSEMEM) LISTFILE=$>$(LISTEXTZ) OBJNAME=$@ $*.c

# Zip low-memory version transformation rules
#
.c$(OL):
      $(CC) WITH=$(CFILE) $(CLOWMEM) LISTFILE=$>$(LISTEXTL) OBJNAME=$@ $*.c

# Utilities (ZipNote, ZipCloak and ZipSplit) transformation rules
#
.c$(OU):
      $(CC) WITH=$(CFILE) $(CUSEMEM) DEF=UTIL LISTFILE=$>$(LISTEXTU) OBJNAME=$@ $*.c


#########################
# Final output targets. #
#########################


zip:      local_zip CommonFlags $(OBJZ)
          @Echo "$(OBJZ)" > $(OBJLISTZ)
          Type $(OBJLISTZ)
          @Echo "$(LDFLAGSS) $(LUTIL) WITH $(OBJLISTZ) $(LIBFLAGS)" \
                "$(LDFLAGS2) $(LMAPZ)" >$(LWITHZ)
          Type $(LWITHZ)
          $(LD) TO Zip      WITH $(LWITHZ)

zipnote:  local_zip CommonFlags $(OBJN)
          @Echo "$(OBJN)" > $(OBJLISTN)
          Type $(OBJLISTN)
          @Echo "$(LDFLAGSS) $(LUTIL) WITH $(OBJLISTN) $(LIBFLAGS) " \
                "$(LDFLAGS2) $(LMAPN)" >$(LWITHN)
          Type $(LWITHN)
          $(LD) TO ZipNote  WITH $(LWITHN)

zipcloak: local_zip CommonFlags $(OBJC)
          @Echo "$(OBJC)" > $(OBJLISTC)
          Type $(OBJLISTC)
          @Echo "$(LDFLAGSS) $(LUTIL) WITH $(OBJLISTC) $(LIBFLAGS) " \
                "$(LDFLAGS2) $(LMAPC)" >$(LWITHC)
          Type $(LWITHC)
          $(LD) TO ZipCloak WITH $(LWITHC)

zipsplit: local_zip CommonFlags $(OBJS)
          @Echo "$(OBJS)" > $(OBJLISTS)
          Type $(OBJLISTS)
          @Echo "$(LDFLAGSS) $(LUTIL) WITH $(OBJLISTS) $(LIBFLAGS) " \
                "$(LDFLAGS2) $(LMAPS)" >$(LWITHS)
          Type $(LWITHS)
          $(LD) TO ZipSplit WITH $(LWITHS)

ziplm:    local_zip CommonFlags $(OBJL)
          @Echo "$(OBJL)" > $(OBJLISTL)
          Type $(OBJLISTL)
          @Echo "$(LDFLAGSS) $(LUTIL) WITH $(OBJLISTL) $(LIBFLAGS) " \
                "$(LDFLAGS2) $(LMAPL)" >$(LWITHL)
          Type $(LWITHL)
          $(LD) TO ZipLM    WITH $(LWITHL)


clean:
        -Delete >nil: $(OBJZ) quiet
        -Delete >nil: $(OBJN) quiet
        -Delete >nil: $(OBJC) quiet
        -Delete >nil: $(OBJS) quiet
        -Delete >nil: $(OBJL) quiet
        -Delete >nil: $(OBJLISTZ) $(OBJLISTL) $(OBJLISTN) $(OBJLISTS) $(OBJLISTC) quiet
        -Delete >nil: $(MAPFZ) $(MAPFN) $(MAPFC) $(MAPFS) $(MAPFL) quiet
        -Delete >nil: \#?$(LISTEXTZ) \#?$(LISTEXTU) \#?$(LISTEXTL) quiet
        -Delete >nil: $(CWITHOPT) $(CFILE) quiet
        -Delete >nil: $(LWITHZ) $(LWITHN) $(LWITHC) $(LWITHS) $(LWITHL) quiet
        -Delete >nil: env:VersionDate quiet
        -Delete >nil: \#?.q.?? \#?.tmp \#?.cov quiet

spotless: clean
        -Delete >nil: $(ZIPS) quiet


################
# DEPENDENCIES #
################

# To change between the assembler and C sources, you have to comment/uncomment
# the approprite lines. C sources are marked by #C-src and assembler sources
# #asm-src at the end.
# Zip dependencies:
#

zip$(O):        zip.c      $(ZIP_H) revision.h crc32.h crypt.h ttyio.h
zipup$(O):      zipup.c    $(ZIP_H) revision.h crc32.h crypt.h amiga/zipup.h
zipfile$(O):    zipfile.c  $(ZIP_H) revision.h crc32.h
crypt$(O):      crypt.c    $(ZIP_H) crypt.h crc32.h ttyio.h
ttyio$(O):      ttyio.c    $(ZIP_H) crypt.h ttyio.h
deflate$(O):    deflate.c  $(ZIP_H)                          #C-src
trees$(O):      trees.c    $(ZIP_H)
fileio$(O):     fileio.c   $(ZIP_H) crc32.h
util$(O):       util.c     $(ZIP_H)
crc32$(O):      crc32.c    $(ZIP_H) crc32.h
globals$(O):    globals.c  $(ZIP_H)
timezone$(O):   timezone.c $(ZIP_H) timezone.h
# Amiga specific objects
stat$(O):       amiga/stat.c     amiga/z-stat.h
filedate$(O):   amiga/filedate.c crypt.h timezone.h
amiga$(O):      amiga/amiga.c    ziperr.h
amigazip$(O):   amiga/amigazip.c $(ZIP_H) amiga/amiga.h env:Workbench
# Substitute assembly version of deflate.c:
#deflate$(O):  amiga/deflate.a                               #asm-src
#        $(ASM) $(ASMOPTSZ) -o$@ $*.a                        #asm-src


# Utility (ZipNote, ZipCloak, ZipSplit) dependencies:
#
zipnote$(O):    zipnote.c  $(ZIP_H) revision.h
zipcloak$(O):   zipcloak.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h
zipsplit$(O):   zipsplit.c $(ZIP_H) revision.h
zipfile$(OU):   zipfile.c  $(ZIP_H) revision.h crc32.h
fileio$(OU):    fileio.c   $(ZIP_H) crc32.h
util$(OU):      util.c     $(ZIP_H)
crc32$(OU):     crc32.c    $(ZIP_H) crc32.h
crypt$(OU):     crypt.c    $(ZIP_H) crypt.h crc32.h ttyio.h
# Amiga specific objects
amigazip$(OU):   amiga/amigazip.c $(ZIP_H) amiga/amiga.h env:Workbench

# ZipLM dependencies:
#
zip$(OL):       zip.c      $(ZIP_H) revision.h crc32.h crypt.h ttyio.h
zipup$(OL):     zipup.c    $(ZIP_H) revision.h crc32.h crypt.h amiga/zipup.h
zipfile$(OL):   zipfile.c  $(ZIP_H) revision.h crc32.h
crypt$(OL):     crypt.c    $(ZIP_H) crypt.h crc32.h ttyio.h
ttyio$(OL):     ttyio.c    $(ZIP_H) crypt.h ttyio.h
deflate$(OL):   deflate.c  $(ZIP_H)
trees$(OL):     trees.c    $(ZIP_H)
fileio$(OL):    fileio.c   $(ZIP_H) crc32.h
util$(OL):      util.c     $(ZIP_H)
crc32$(OL):     crc32.c    $(ZIP_H)
globals$(OL):   globals.c  $(ZIP_H)
timezone$(OL):  timezone.c $(ZIP_H) timezone.h
# Amiga specific objects
stat$(OL):      amiga/stat.c     amiga/z-stat.h
filedate$(OL):  amiga/filedate.c crypt.h timezone.h
amiga$(OL):     amiga/amiga.c    ziperr.h
# Substitute assembly version of deflate.c:
#deflate$(OL): amiga/deflate.a
#        $(ASM) $(ASMOPTSL) -o$@ $*.a


########################
# DEPENDECIES END HERE #
########################

# flush all libraries to provide more mem for compilation
flush:
        @Avail flush >nil:

# write common compiler flags to file and echo to user
CommonFlags:
        @Echo "$(CFLAGS)"    >$(CFILE)
        @Type "$(CWITHOPT)" >>$(CFILE)
        -Type $(CFILE)


# special rules for adding Amiga internal version number to amiga/amiga.c
amiga$(O):
         rx > env:VersionDate "say '""'translate(date('E'),'.','/')'""'"
         $(CC) WITH=$(CFILE) $(CUSEMEM) LISTFILE=$>$(LISTEXTZ) OBJNAME=$@ $*.c
         -Delete env:VersionDate

amiga$(OL):
         rx > env:VersionDate "say '""'translate(date('E'),'.','/')'""'"
         $(CC) WITH=$(CFILE) $(CLOWMEM) LISTFILE=$>$(LISTEXTL) OBJNAME=$@ $*.c
         -Delete env:VersionDate


# needed in amiga/amigazip.c
# should be set in startup-sequence, but just in case:
# (only works with OS 2.0 and above)

env\:WorkBench:
        @Execute < < (Workbench_smk.tmp)
           FailAt 21
           If not exists ENV:Workbench
              Version >nil:
              SetEnv Workbench $$Workbench
           Endif
        <


# Read environment variable LOCAL_ZIP and convert options to SAS format
#
# e.g.: to define FOO_ONE and FOO_TWO enter:
#
# SetEnv LOCAL_ZIP "-DFOO_ONE -DFOO_TWO"
#
# Put the statement into your startup-sequence or (for AmigaDOS 2.0 or higher
# only) make sure LOCAL_ZIP is stored in the ENVARC: directory
# ( Copy ENV:LOCAL_ZIP ENVARC: )
#

local_zip:
        @Execute < < (Local_Zip_smk.tmp)
           Failat 21
           If exists ENV:LOCAL_ZIP
              Echo "Using environment variable LOCAL_ZIP !"
              Copy >NIL: ENV:LOCAL_ZIP SASCOPTS
           Else
              Echo "You could use envvar ZIP_OPT to set your special compilation options."
              Delete >nil: SASCOPTS quiet
           Endif
           ; Do not remove the lctosc command! If LOCAL_ZIP is unset, an
           ; empty file is created which needed by CommonFlags !
           lctosc >$(CWITHOPT)
        <



# Echo request to the user
#
request:
        @Echo ""
        @Echo " This makefile is for use with SAS/C version 6.58."
        @Echo " If you still have an older version, please upgrade!"
        @Echo " Patches are available on the Aminet under biz/patch/sc\#?."
        @Echo ""
        @Echo " Just a simple request..."
        @Echo " Please give me a mail that you compiled whether you encounter any errors"
        @Echo " or not. I'd just like to know how many Amiga users actually make use of"
        @Echo " this makefile."
        @Echo " If you mail me, I'll put you on my mailing-list and notify you whenever"
        @Echo " new versions of Info-Zip are released."
        @Echo " Have a look at the makefile for changes like CPU type, UtilLib, etc."
        @Echo " Feel free to mail comments, suggestions, etc."
        @Echo " Enjoy Info-Zip !"
        @Echo " Haidinger Walter, <walthaid@unix.ict.tuwien.ac.at>"
        @Echo ""


# Echo help in case of an error
#
.ONERROR:
        @Echo ""
        @Echo "[sigh] An error running this makefile was detected."
        @Echo "This message may also appear if you interrupted smake by pressing CTRL-C."
        @Echo "Contact Info-Zip authors at Zip-Bugs@lists.wku.edu or me for help."
        @Echo "Haidinger Walter, <walthaid@unix.ict.tuwien.ac.at>"