~ubuntu-branches/ubuntu/precise/unzip/precise-proposed

« back to all changes in this revision

Viewing changes to amiga/smakefile

  • Committer: Bazaar Package Importer
  • Author(s): Santiago Vila
  • Date: 2004-06-06 17:57:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040606175746-nl7p2dgp3aobyc2c
Tags: upstream-5.51
ImportĀ upstreamĀ versionĀ 5.51

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#===========================================================================
 
2
# Makefile for UnZip, ZipInfo, fUnZip, MakeSFX      AMIGA SAS/C Version 6.58
 
3
# Version:  5.5                                     last revised:  13 Feb 01
 
4
#===========================================================================
 
5
# from 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 executables below
 
21
# unzip         builds unzip executable
 
22
# unzipsfx      builds unzipsfx executable
 
23
# funzip        builds funzip executable
 
24
# makesfx       builds makesfx executable
 
25
# clean         remove all files created by the compilation
 
26
# spotless      like clean target but removes binaries too
 
27
 
 
28
 
 
29
##########################
 
30
# USER MACRO DEFINITIONS #
 
31
##########################
 
32
 
 
33
# Set the processor to generate code for UnZip and fUnZip. Specify one of:
 
34
# ANY 68000 68010 68020 68030 68040 68060  (Default: ANY or 68000)
 
35
 
 
36
# Use of the assembly versions is not supported yet since some of the asm
 
37
# source file do not assemble with 68000 instructions.
 
38
# Any help is appreciated of course.
 
39
 
 
40
CUSECPU = ANY
 
41
 
 
42
# Uncomment both CUTIL and LUTIL to make use of utility.library of OS 2.04+
 
43
# The utility.library is *not* used for UnZipSFX to ensure maximum portability
 
44
# between the different Amiga systems (minimal config: 68000 and OS 1.2).
 
45
# You can change this by adding the $(LUTIL) macro in the UnZipSFX linking
 
46
# rules (See below: Final output targets, UnZipSFX:).
 
47
# WARNINGS when using the utility library:
 
48
# 1. All Executables will *only* work with AmigaDOS 2.04 (v37) or higher.
 
49
# 2. You *need not* compile/link with short-integers using the
 
50
#    utility.library. It will crash your machine. See Libraries below.
 
51
#
 
52
# Default: commented (not used)
 
53
#
 
54
#CUTIL = UTILLIB DEFINE=_UTILLIB
 
55
#LUTIL = WITH SC:LIB/utillib.with    # include necessary linker defines
 
56
 
 
57
 
 
58
# Choose one stack-handling method (default=faster)
 
59
# StackExtend: Dynamic runtime stack extension. You won't notice stack overflows.
 
60
# StackCheck: On a stack overflow a requester appears which allows you to exit.
 
61
# Note that either stack watching will slow down your executable because of the
 
62
# extra code run on each function entry. On the other hand, you won't crash
 
63
# anymore due to stack overflows. However, you should not have *any* stack
 
64
# problems with info-zip if you raise your stack to 20000 (which I'd
 
65
# recommend as a minimum default stack for all applications) or more using the
 
66
# shell stack command. Type 'Stack 20000' or add it to your S:Shell-Startup.
 
67
# BTW: Typing 'Stack' prints your current stack size.
 
68
#
 
69
CSTACK = NOSTACKCHECK STACKEXTEND     # slow, but always works
 
70
#CSTACK = STACKCHECK NOSTACKEXTEND    # slow, requester & graceful exit
 
71
#CSTACK = NOSTACKCHECK NOSTACKEXTEND  # faster but relies on larger stack (>=10K)
 
72
 
 
73
#
 
74
# LIBRARIES
 
75
# ---------
 
76
 
 
77
# Choose one DATAOPTS , SASLIB and LSTARTUP
 
78
# Always comment/uncomment all macros of a set.
 
79
 
 
80
# Library to use with near data and 2-byte integers
 
81
# Notes: o  slower than 4-byte integers with 68000 cpu
 
82
#        o  *not* recommended due to poor overall performance
 
83
#        o  see comment in amiga/osdep.h
 
84
#DATAOPTS = DATA=NEAR SHORTINTEGERS DEF=_NEAR_DATA
 
85
#SASLIB   = scs
 
86
#LSTARTUP = cres.o
 
87
 
 
88
# Library to use with near data and 4-byte integers (DEFAULT)
 
89
# *** use this with the utility.library ***
 
90
DATAOPTS = DATA=NEAR DEF=_NEAR_DATA
 
91
SASLIB   = sc
 
92
LSTARTUP = cres.o
 
93
 
 
94
# Library to use with far data and 2-byte integers
 
95
# use if DYN_ALLOC is not defined
 
96
# old default - far data always works but is slower
 
97
#DATAOPTS = DATA=FAR SHORTINTEGERS DEF=_FAR_DATA
 
98
#SASLIB   = scsnb
 
99
#LSTARTUP = c.o
 
100
 
 
101
# Library to use with far data and 4-byte integers
 
102
# if everything else fails: try this
 
103
#DATAOPTS = DATA=FAR DEF=_FAR_DATA
 
104
#SASLIB   = scnb
 
105
#LSTARTUP = c.o
 
106
 
 
107
 
 
108
#
 
109
# DEBUGGING
 
110
# ---------
 
111
 
 
112
# Default: No debugging information added.
 
113
# The two macros below will be overwritten if you choose to add
 
114
# debug info, therefore need to comment.
 
115
CDBG = NODEBUG NOPROFILE NOCOVERAGE    # default: no debug info
 
116
LDBG = STRIPDEBUG                      # default: no debug info
 
117
 
 
118
# Compiler and loader debug flags.  Uncomment as needed.  Recomment when done.
 
119
# Optimization disabled for faster compilation (by using NOOPT)
 
120
#CDBG1 = DEF=DEBUG DEF=DEBUG_TIME     # enables Info-ZIP's debug output
 
121
 
 
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
 
 
130
# *Uncomment* _HERE_ macros CDBG and LDBG to include debugging information
 
131
#CDBG = $(CDBG1) $(CDBG2) $(CDBG3) ADDSYM DEBUG=FULLFLUSH STACKCHECK NOOPT
 
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 memlib has a small bug: MWTerm() displays always the first entry.
 
136
# Get the latest version from aminet (dev/debug/memlib.lha) or
 
137
# contact me to get the patch. Uncomment all macros to use.
 
138
#CMEMLIB  = DEFINE=MWDEBUG=1       # define to enable library
 
139
#LMEMLIB  = SC:LIB/memwatch.lib    # path to library
 
140
#LSTARTUP = c.o                    # must use c.o with memlib!
 
141
 
 
142
 
 
143
#
 
144
# MAPPING
 
145
# -------
 
146
 
 
147
# Map filenames used when mapping (no need to comment)
 
148
#
 
149
MAPFS = unzip.map               # UnZip    map filename
 
150
MAPFX = unzipsfx.map            # UnZipSFX map filename
 
151
MAPFF = funzip.map              # fUnZip   map filename
 
152
MAPFM = makesfx.map             # MakeSFX  map filename
 
153
 
 
154
# Map file output: Uncomment to highlight and bold headings.
 
155
#
 
156
#MAPFSTYLE = FANCY
 
157
 
 
158
# Map flags for each EXECUTABLE. Uncomment to enable mapping.
 
159
# For map options please refer to:
 
160
# SAS/C v6 manual, volume 1: user's guide, chapter 8, page 136: map
 
161
# Default: all options enabled: f,h,l,o,s,x
 
162
#                                 |-> options start here
 
163
#LMAPS = $(MAPFSTYLE) MAP $(MAPFS) f,h,l,o,s,x   # UnZip    maps
 
164
#LMAPX = $(MAPFSTYLE) MAP $(MAPFX) f,h,l,o,s,x   # UnZipSFX maps
 
165
#LMAPF = $(MAPFSTYLE) MAP $(MAPFF) f,h,l,o,s,x   # fUnZip   maps
 
166
#LMAPM = $(MAPFSTYLE) MAP $(MAPFM) f,h,l,o,s,x   # MakeSFX  maps
 
167
 
 
168
 
 
169
#
 
170
# LISTINGS
 
171
# --------
 
172
 
 
173
# Listfile-extensions for each executable (enter *with* dot)
 
174
#
 
175
LISTEXTS = .lst         # extension for UnZip and MakeSFX listfiles
 
176
LISTEXTX = .xlst        # extension for UnZipSFX listfiles
 
177
LISTEXTF = .flst        # extension for fUnZip listfiles
 
178
 
 
179
 
 
180
# List files and cross references for each OBJECT.
 
181
# Add/remove flags as needed. All listed by default.
 
182
# Use LISTINCLUDES only to determine the dependencies for smake
 
183
#
 
184
CLISTOPT = LISTHEADERS LISTMACROS # LISTSYSTEM LISTINCLUDES
 
185
CXREFOPT = XHEAD XSYS
 
186
#
 
187
# Uncomment to enable listing (default: commented)
 
188
# *** WARNING: List files require *lots* of disk space!
 
189
#
 
190
#CLIST = LIST $(CLISTOPT)
 
191
#CXREF = XREF $(CXREFOPT)
 
192
 
 
193
 
 
194
#
 
195
# SUPPRESSED COMPILER WARNINGS
 
196
# ----------------------------
 
197
 
 
198
# Compiler warnings to ignore
 
199
#
 
200
# Warning 105 : module does not define any externally-known symbols
 
201
# Warning 304 : Dead assignment eliminated...
 
202
# Note    306 : ...function inlined...
 
203
# Warning 317 : possibly uninitialized variable...
 
204
# Comment to enable.
 
205
#
 
206
CIGNORE = IGNORE=105,304,306,317
 
207
 
 
208
 
 
209
#
 
210
# OBJECT EXTENSIONS
 
211
#
 
212
 
 
213
# Extensions used for objects of each executeable.
 
214
# Transformation rules require unique extensions.
 
215
# Enter *with* dot.
 
216
#
 
217
O  = .o         # general extension for objects
 
218
OX = .xo        # extension for special UnZipSFX objects
 
219
OF = .fo        # extension for special fUnZip objects
 
220
 
 
221
 
 
222
# Filename used to store converted options from environment variable
 
223
# LOCAL_UNZIP. Default: scoptions_local_unzip
 
224
#
 
225
CWITHOPT = scoptions_local_unzip
 
226
 
 
227
 
 
228
# Filenames to store compiler options to prevent command line overflow
 
229
#
 
230
# Options file for UnZip and fUnZip
 
231
CFILEC = scoptions-unzip
 
232
# Options file for UnZipSFX
 
233
CFILEX = scoptions-unzipsfx
 
234
# Special options for MakeSFX
 
235
CFILEM = scoptions-makesfx
 
236
 
 
237
 
 
238
# Temp filenames for object lists to load using linker "WITH" command.
 
239
#
 
240
OBJLISTS = unzip_objlist.with            # UnZip    object list
 
241
OBJLISTX = unzipsfx_objlist.with         # UnZipSFX object list
 
242
OBJLISTF = funzip_objlist.with           # fUnZip   object list
 
243
OBJLISTM = makesfx_objlist.with          # MakeSFX  object list
 
244
 
 
245
 
 
246
# Filenames to store linker options
 
247
#
 
248
LWITHS = unzip.lnk                       # UnZip    linker options
 
249
LWITHX = unzipsfx.lnk                    # UnZipSFX linker options
 
250
LWITHF = funzip.lnk                      # fUnZip   linker options
 
251
LWITHM = makesfx.lnk                     # MakeSFX  linker options
 
252
 
 
253
 
 
254
######################################
 
255
#  NOTHING TO CHANGE BEYOND HERE ... #
 
256
######################################
 
257
 
 
258
 
 
259
# Compiler definitions
 
260
#
 
261
CC = sc
 
262
#
 
263
# Optimizer flags
 
264
#
 
265
OPTPASSES = 6     # set number of global optimizer passes
 
266
#
 
267
OPT1 = OPT OPTINL OPTINLOCAL OPTTIME OPTLOOP OPTSCHED
 
268
OPT2 = OPTCOMP=$(OPTPASSES) OPTDEP=$(OPTPASSES) OPTRDEP=$(OPTPASSES)
 
269
OPT  = $(OPT1) $(OPT2)
 
270
 
 
271
# Compiler flags
 
272
#
 
273
# cpu flags for UnZip and fUnZip
 
274
CCPUOPTSF = CPU=$(CUSECPU) $(CUTIL)
 
275
# cpu flags for UnzipSFX and MakeSFX (ensures portability to all Amigas)
 
276
CCPUOPTXM = CPU=ANY
 
277
 
 
278
CDEFINES = $(CMEMLIB) $(CDEFINES) DEF=AMIGA DEF=PROTO
 
279
COPTIONS = CODE=NEAR NMINC VERBOSE STRINGMERGE PARAMETERS=BOTH
 
280
COPTIONS = $(COPTIONS) ERRORREXX NOERRORCONSOLE MEMSIZE=HUGE $(CLIST) $(CXREF)
 
281
COPTIONS = $(COPTIONS) $(CSTACK) STRICT UNSCHAR NOICONS
 
282
COPTIONS = $(COPTIONS) $(CIGNORE) $(OPT) $(CDBG)
 
283
# common compiler flags
 
284
CFLAGSC  = $(CDEFINES) $(DATAOPTS) $(COPTIONS)
 
285
# special compiler flags with $(DATAOPTS) excluded
 
286
CFLAGSS  = $(CDEFINES) $(COPTIONS)
 
287
 
 
288
# Linker definitions
 
289
#  See SASLIB definition above
 
290
#
 
291
LD = slink
 
292
# special linker flags for UnZip to create pure (i.e. resident) binary.
 
293
LDFLAGSS = FROM SC:LIB/$(LSTARTUP)
 
294
# common linker flags for all other executeables
 
295
LDFLAGSC = FROM SC:LIB/c.o
 
296
 
 
297
LDFLAGS2 = NOICONS $(LDBG)
 
298
# special linker flags to select library set above
 
299
LIBFLAGSS = LIB $(LMEMLIB) SC:LIB/$(SASLIB).lib SC:LIB/amiga.lib
 
300
# common linker flags
 
301
LIBFLAGSC = LIB $(LMEMLIB) SC:LIB/sc.lib SC:LIB/amiga.lib
 
302
 
 
303
 
 
304
##################
 
305
# TARGET OBJECTS #
 
306
##################
 
307
 
 
308
 
 
309
# UnZip Objects
 
310
OBJS1 = unzip$(O) crc32$(O) crctab$(O) crypt$(O) envargs$(O) explode$(O)
 
311
OBJS2 = extract$(O) fileio$(O) globals$(O) list$(O) inflate$(O) match$(O)
 
312
OBJS3 = process$(O) ttyio$(O) unreduce$(O) unshrink$(O) zipinfo$(O)
 
313
OBJSA = amiga$(O) timezone$(O)
 
314
OBJS  = $(OBJS1) $(OBJS2) $(OBJS3) $(OBJSA)
 
315
 
 
316
# UnZipSFX Objects
 
317
OBJX1 = unzip$(OX) extract$(OX) inflate$(OX) match$(OX) process$(OX)
 
318
OBJXI = crypt$(OX) crc32$(O) crctab$(OX) fileio$(OX) globals$(OX) ttyio$(OX)
 
319
OBJXA = amiga$(OX) timezone$(OX)
 
320
OBJX  = $(OBJX1) $(OBJXI) $(OBJXA)
 
321
 
 
322
# fUnZip Objects
 
323
OBJF1 = funzip$(O)
 
324
OBJF2 = crc32$(OF) crypt$(OF) globals$(OF) inflate$(OF) ttyio$(OF)
 
325
OBJFA = filedate$(OF) stat$(O)
 
326
OBJF  = $(OBJF1) $(OBJF2) $(OBJFA)
 
327
 
 
328
# MakeSFX Objects
 
329
OBJM = makesfx$(O)
 
330
 
 
331
# Common header files
 
332
UNZIP_H1 = unzip.h unzpriv.h globals.h
 
333
UNZIP_HA = amiga/amiga.h amiga/z-stat.h
 
334
UNZIP_H  = $(UNZIP_H1) $(UNZIP_HA)
 
335
 
 
336
# Output targets
 
337
UNZIPS = UnZip UnZipSFX fUnZip MakeSFX
 
338
 
 
339
 
 
340
#######################################
 
341
# DEFAULT TARGET AND PROCESSING RULES #
 
342
#######################################
 
343
 
 
344
all: request flush $(UNZIPS)
 
345
 
 
346
# UnZip transformation rules
 
347
#
 
348
.c$(O) :
 
349
        $(CC) WITH=$(CFILEC) LISTFILE=$>$(LISTEXTS) OBJNAME=$@ $*.c
 
350
 
 
351
# UnZipSFX transformation rules
 
352
#
 
353
.c$(OX):
 
354
        $(CC) DEF=SFX WITH=$(CFILEC) LISTFILE=$>$(LISTEXTX) OBJNAME=$@ $*.c
 
355
 
 
356
# fUnZip transformation rules
 
357
#
 
358
.c$(OF):
 
359
        $(CC) DEF=FUNZIP WITH=$(CFILEC) LISTFILE=$>$(LISTEXTF) OBJNAME=$@ $*.c
 
360
 
 
361
 
 
362
#########################
 
363
# Final output targets. #
 
364
#########################
 
365
 
 
366
unzip:    local_unzip CommonFlags $(OBJS)
 
367
          @Echo "$(OBJS)" >$(OBJLISTS)
 
368
          Type $(OBJLISTS)
 
369
# -----
 
370
# Note:   Change $(LDFLAGSS) to $(LDFLAGSC) if DYN_ALLOC is *not* defined.
 
371
# -----
 
372
          @Echo "$(LDFLAGSS) $(LUTIL) WITH $(OBJLISTS) $(LIBFLAGSS) " \
 
373
                "$(LDFLAGS2) $(LMAPS)" >$(LWITHS)
 
374
          Type $(LWITHS)
 
375
          $(LD) TO UnZip    WITH $(LWITHS)
 
376
 
 
377
funzip:   local_unzip CommonFlags $(OBJF)
 
378
          @Echo "$(OBJF)" >$(OBJLISTF)
 
379
          Type $(OBJLISTF)
 
380
          @Echo "$(LDFLAGSC) $(LUTIL) WITH $(OBJLISTF) $(LIBFLAGSS) " \
 
381
                "$(LDFLAGS2) $(LMAPF)" >$(LWITHF)
 
382
          Type $(LWITHF)
 
383
          $(LD) TO fUnZip   WITH $(LWITHF)
 
384
 
 
385
unzipsfx: local_unzip SFXFlags $(OBJX)
 
386
          @Echo "$(OBJX)" >$(OBJLISTX)
 
387
          Type $(OBJLISTX)
 
388
# ----
 
389
# Note:   Insert $(LUTIL) here, to use utility library with UnZipSFX.
 
390
# -----                      vvvvvvv
 
391
          @Echo "$(LDFLAGSC)          WITH $(OBJLISTX) $(LIBFLAGSS) " \
 
392
                "$(LDFLAGS2) $(LMAPX)" >$(LWITHX)
 
393
          Type $(LWITHX)
 
394
          $(LD) TO UnZipSFX WITH $(LWITHX)
 
395
 
 
396
 
 
397
makesfx:  MakeSFXFlags $(OBJM)
 
398
          @Echo "$(OBJM)" >$(OBJLISTM)
 
399
          Type $(OBJLISTM)
 
400
          @Echo "$(LDFLAGSC) $(LUTIL) WITH $(OBJLISTM) $(LIBFLAGSC) " \
 
401
                "$(LDFLAGS2) $(LMAPM)" >$(LWITHM)
 
402
          Type $(LWITHM)
 
403
          # never use short-integers with MakeSFX !
 
404
          $(LD) TO MakeSFX  WITH $(LWITHM)
 
405
 
 
406
clean:
 
407
        -Delete >nil: $(OBJS) quiet
 
408
        -Delete >nil: $(OBJX) quiet
 
409
        -Delete >nil: $(OBJF) quiet
 
410
        -Delete >nil: $(OBJM) quiet
 
411
        -Delete >nil: $(OBJLISTS) $(OBJLISTX) $(OBJLISTF) $(OBJLISTM) quiet
 
412
        -Delete >nil: $(MAPFS) $(MAPFX) $(MAPFF) $(MAPFM) quiet
 
413
        -Delete >nil: \#?$(LISTEXTS) \#?$(LISTEXTX) \#?$(LISTEXTF) quiet
 
414
        -Delete >nil: $(CWITHOPT) $(CFILEC) $(CFILEX) $(CFILEM) quiet
 
415
        -Delete >nil: SCOPTIONS SASCOPTS quiet
 
416
        -Delete >nil: $(LWITHS) $(LWITHX) $(LWITHF) $(LWITHM) quiet
 
417
        -Delete >nil: \#?.q.?? \#?.tmp \#?.cov quiet
 
418
 
 
419
spotless: clean
 
420
        -Delete >nil: $(UNZIPS) quiet
 
421
 
 
422
 
 
423
# UnZip dependencies:
 
424
# (objects not needed by Amiga port are commented)
 
425
 
 
426
# special rule for adding Amiga internal version number to UnZip
 
427
amiga$(O):          amiga/amiga.c amiga/filedate.c amiga/stat.c $(UNZIP_H) crypt.h timezone.h env:Workbench
 
428
stat$(O):           amiga/stat.c     amiga/z-stat.h
 
429
filedate$(O):       amiga/filedate.c crypt.h timezone.h
 
430
api$(O):            api.c      $(UNZIP_H) unzvers.h #zlib.h
 
431
apihelp$(O):        apihelp.c  $(UNZIP_H) unzvers.h
 
432
crc32$(O):          crc32.c    $(UNZIP_H) zip.h
 
433
crctab$(O):         crctab.c   $(UNZIP_H) zip.h
 
434
crypt$(O):          crypt.c    $(UNZIP_H) zip.h crypt.h ttyio.h
 
435
envargs$(O):        envargs.c  $(UNZIP_H)
 
436
explode$(O):        explode.c  $(UNZIP_H)
 
437
extract$(O):        extract.c  $(UNZIP_H) crypt.h
 
438
fileio$(O):         fileio.c   $(UNZIP_H) crypt.h ttyio.h ebcdic.h
 
439
globals$(O):        globals.c  $(UNZIP_H)
 
440
inflate$(O):        inflate.c  $(UNZIP_H) inflate.h #zlib.h
 
441
list$(O):           list.c     $(UNZIP_H)
 
442
match$(O):          match.c    $(UNZIP_H)
 
443
process$(O):        process.c  $(UNZIP_H)
 
444
timezone$(O):       timezone.c $(UNZIP_H) zip.h timezone.h
 
445
ttyio$(O):          ttyio.c    $(UNZIP_H) zip.h crypt.h ttyio.h
 
446
unreduce$(O):       unreduce.c $(UNZIP_H)
 
447
unshrink$(O):       unshrink.c $(UNZIP_H)
 
448
unzip$(O):          unzip.c    $(UNZIP_H) crypt.h unzvers.h consts.h #zlib.h
 
449
#unzipstb$(O):       unzipstb.c $(UNZIP_H) unzvers.h
 
450
zipinfo$(O):        zipinfo.c  $(UNZIP_H)
 
451
 
 
452
 
 
453
# UnZipSFX dependencies:
 
454
#
 
455
# special rule for adding Amiga internal version number to UnZipSFX
 
456
amiga$(OX):      amiga/amiga.c amiga/filedate.c amiga/stat.c $(UNZIP_H) crypt.h timezone.h
 
457
unzip$(OX):      unzip.c    $(UNZIP_H) crypt.h unzvers.h consts.h
 
458
crctab$(OX):     crctab.c   $(UNZIP_H) zip.h
 
459
crypt$(OX):      crypt.c    $(UNZIP_H) zip.h crypt.h ttyio.h
 
460
extract$(OX):    extract.c  $(UNZIP_H) crypt.h
 
461
fileio$(OX):     fileio.c   $(UNZIP_H) crypt.h ttyio.h ebcdic.h
 
462
globals$(OX):    globals.c  $(UNZIP_H)
 
463
inflate$(OX):    inflate.c  $(UNZIP_H) inflate.h #zlib.h
 
464
match$(OX):      match.c    $(UNZIP_H)
 
465
process$(OX):    process.c  $(UNZIP_H)
 
466
timezone$(OX):   timezone.c $(UNZIP_H) zip.h timezone.h
 
467
ttyio$(OX):      ttyio.c    $(UNZIP_H) zip.h crypt.h ttyio.h
 
468
 
 
469
 
 
470
# fUnZip dependencies:
 
471
#
 
472
funzip$(O):      funzip.c   $(UNZIP_H) crypt.h ttyio.h tables.h
 
473
crc32$(OF):      crc32.c    $(UNZIP_H) zip.h
 
474
crypt$(OF):      crypt.c    $(UNZIP_H) zip.h crypt.h ttyio.h
 
475
globals$(OF):    globals.c  $(UNZIP_H)
 
476
inflate$(OF):    inflate.c  $(UNZIP_H) inflate.h crypt.h #zlib.h
 
477
ttyio$(OF):      ttyio.c    $(UNZIP_H) zip.h crypt.h ttyio.h
 
478
filedate$(OF):   amiga/filedate.c crypt.h
 
479
 
 
480
 
 
481
# MakeSFX dependencies
 
482
#
 
483
# special transformation rules to never use shortintegers:
 
484
makesfx$(O):      amiga/makesfx.c
 
485
        $(CC) WITH=$(CFILEM) LISTFILE=$>$(LISTEXTS) OBJNAME=$@ $*.c
 
486
 
 
487
 
 
488
########################
 
489
# DEPENDECIES END HERE #
 
490
########################
 
491
 
 
492
# flush all libraries to provide more mem for compilation
 
493
flush:
 
494
        @Avail flush >nil:
 
495
 
 
496
# write common compiler flags to file and echo to user
 
497
CommonFlags:
 
498
        @Echo "$(CFLAGSC)" "$(CCPUOPTSF)" >$(CFILEC)
 
499
        @Type "$(CWITHOPT)"              >>$(CFILEC)
 
500
        -Type $(CFILEC)
 
501
 
 
502
SFXFlags:
 
503
        @Echo "$(CFLAGSC)" "$(CCPUOPTXM)" >$(CFILEX)
 
504
        @Type "$(CWITHOPT)"              >>$(CFILEX)
 
505
        -Type $(CFILEX)
 
506
 
 
507
# write special MakeSFX flags
 
508
MakeSFXFlags:
 
509
        @Echo "$(CFLAGSS) $(CCPUOPTXM) DATA=NEAR NOSHORTINTEGERS" >$(CFILEM)
 
510
        # not really needed but if someday used:
 
511
        @Type "$(CWITHOPT)" >>$(CFILEM)
 
512
        -Type $(CFILEM)
 
513
 
 
514
 
 
515
# special rule for adding Amiga internal version number to amiga.c
 
516
amiga$(O):
 
517
        rx > env:VersionDate "say '""'translate(date('E'),'.','/')'""'"
 
518
        $(CC) WITH=$(CFILEC) LISTFILE=$>$(LISTEXTS) OBJNAME=$@ $*.c
 
519
        -Delete env:VersionDate
 
520
 
 
521
 
 
522
# needed in amiga/amiga.c
 
523
# should be set in startup-sequence, but just in case:
 
524
# (only works with OS 2.04 and above)
 
525
 
 
526
env\:WorkBench:
 
527
        @Execute < < (Workbench_smk.tmp)
 
528
           FailAt 21
 
529
           If not exists ENV:Workbench
 
530
              Version >nil:
 
531
              SetEnv Workbench $$Workbench
 
532
           Endif
 
533
        <
 
534
 
 
535
 
 
536
# #################
 
537
# ### LOCAL_UNZIP ###
 
538
# #################
 
539
#
 
540
# Read environment variable LOCAL_UNZIP and convert options from old Lattice
 
541
# v5 to new SAS/C v6 format. You may also use the new DEFINE= syntax but
 
542
# be sure not to mix v5 and v6 options, otherwise lctosc will be confused.
 
543
#
 
544
# e.g.: to define FOO_ONE and FOO_TWO enter:
 
545
#
 
546
# SetEnv LOCAL_UNZIP "-DFOO_ONE -DFOO_TWO"
 
547
#
 
548
# To make this permanent, i.e. survive an reboot, put the statement into
 
549
# your startup-sequence or (for AmigaDOS 2.0 or higher only) make sure
 
550
# LOCAL_UNZIP is stored in the ENVARC: directory too. To do this, simply
 
551
# copy the file from ENV: to ENVARC:
 
552
#   Copy ENV:LOCAL_UNZIP ENVARC:
 
553
#
 
554
# For a list of all valid non-standard compilation options see the INSTALL
 
555
# file in the root zip tree. Please read the notes there before using the
 
556
# non-standard options.
 
557
#
 
558
# e.g.: To use the non-standard timezone environment variable "INFOZIP_TZ"
 
559
#       (or another arbitary name) instead of "TZ", type in your shell:
 
560
#
 
561
#       Setenv LOCAL_UNZIP "-DTZ_ENVVAR=*"INFOZIP_TZ*""
 
562
#
 
563
# Note that you need to escape the quotes of INFOZIP_TZ with leading stars.
 
564
# To verify that LOCAL_UNZIP has been saved correctly, use the Getenv command:
 
565
#
 
566
#       Getenv LOCAL_UNZIP
 
567
#
 
568
# ...should display:
 
569
#
 
570
#       -DTZ_ENVVAR="INFOZIP_TZ"
 
571
#
 
572
 
 
573
local_unzip:
 
574
        @Execute < < (Local_UnZip_smk.tmp)
 
575
           Failat 21
 
576
           Echo ""
 
577
           If exists ENV:LOCAL_UNZIP
 
578
              Echo "Using environment variable LOCAL_UNZIP !"
 
579
              Echo "LOCAL_UNZIP: " NOLINE
 
580
              GetEnv LOCAL_UNZIP
 
581
              Copy >NIL: ENV:LOCAL_UNZIP SASCOPTS
 
582
           Else
 
583
              Echo "You could use envvar LOCAL_UNZIP to set your special compilation options."
 
584
              Echo "See the makefile for more information (LOCAL_UNZIP section)."
 
585
              Delete >nil: SASCOPTS quiet
 
586
           Endif
 
587
           Echo ""
 
588
           ; Do not remove the lctosc command! If LOCAL_UNZIP is unset, an
 
589
           ; empty file is created which needed by CommonFlags !
 
590
           ; Moreover, lctosc also accepts new v6 options, i.e. only changes
 
591
           ; known v5 options. Try `lctosc -Dfoo' and `lctosc DEFINE=foo'.
 
592
           ; However, you *must not* mix v5 and v6 options!
 
593
           lctosc > $(CWITHOPT)
 
594
           ; Now make sure that env:sc/scoptions are NOT used
 
595
           ; we just create an empty file. The options are stored elsewhere.
 
596
           Echo > SCOPTIONS "" NOLINE
 
597
        <
 
598
 
 
599
 
 
600
 
 
601
# Echo request to the user
 
602
#
 
603
request:
 
604
        @Echo ""
 
605
        @Echo " This makefile is for use with SAS/C version 6.58."
 
606
        @Echo " If you still have an older version, please upgrade!"
 
607
        @Echo " Patches are available on the Aminet under biz/patch/sc\#?."
 
608
        @Echo ""
 
609
        @Echo " Just a simple request..."
 
610
        @Echo " Please give me a mail that you compiled whether you encounter any errors"
 
611
        @Echo " or not. I'd just like to know how many Amiga users actually make use of"
 
612
        @Echo " this makefile."
 
613
        @Echo " If you mail me, I'll put you on my mailing-list and notify you whenever"
 
614
        @Echo " new versions of Info-Zip are released."
 
615
        @Echo " Have a look at the makefile for changes like CPU type, UtilLib, Stack, etc."
 
616
        @Echo " Feel free to mail comments, suggestions, critics..."
 
617
        @Echo " Enjoy Info-Zip !"
 
618
        @Echo " Haidinger Walter, <walthaid@unix.ict.tuwien.ac.at>"
 
619
        @Echo ""
 
620
 
 
621
# Echo help in case of an error
 
622
#
 
623
.ONERROR:
 
624
        @Echo ""
 
625
        @Echo "[sigh] An error running this makefile was detected."
 
626
        @Echo "This message may also appear if you interrupted smake by pressing CTRL-C."
 
627
        @Echo "Contact Info-ZIP authors at Zip-Bugs@lists.wku.edu or me for help."
 
628
        @Echo "Haidinger Walter, <walthaid@unix.ict.tuwien.ac.at>"