Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. #==============================================================================
  2. # Makefile for UnZip, UnZipSFX and fUnZip:  Atari ST             Chris Herborth
  3. # Version:  UnZip 5.20+, MiNT, GNU C                           25 December 2006
  4. #==============================================================================
  5.  
  6. # Based on the original unix Makefile and modified by Chris Herborth
  7. # (cherborth@semprini.waterloo-rdp.on.ca), Nov.13/93.
  8.  
  9. # Be sure to test your new UnZip (and UnZipSFX and fUnZip); successful com-
  10. # pilation does not always imply a working program.
  11.  
  12.  
  13. #####################
  14. # MACRO DEFINITIONS #
  15. #####################
  16.  
  17. # Defaults most systems use (use LOCAL_UNZIP in environment to add flags,
  18. # such as -DDOSWILD).
  19.  
  20. # UnZip flags
  21. # NOTE: 'cgcc' is my cross-compiler; you'll probably use 'gcc' instead.
  22. CC = cgcc
  23. LD = cgcc
  24. LOC = $(LOCAL_UNZIP) -ansi -D__MINT__ -U__STRICT_ANSI__
  25.  
  26. CF = -mbaserel -mpcrel -O2 -fomit-frame-pointer -I. $(LOC)
  27. # CF = -O -I. $(LOC)
  28. # CF = -mbaserel -O -I. $(LOC)
  29. LF = -mbaserel -mpcrel -o unzip.ttp
  30. LF2 = -s -lbiio
  31.  
  32. # UnZipSFX flags
  33. XC = -DSFX
  34. XL = -mbaserel -mpcrel -o unzipsfx.ttp
  35. XL2 = $(LF2)
  36.  
  37. # fUnZip flags
  38. FC = -DFUNZIP
  39. FL = -mbaserel -mpcrel -o funzip.ttp
  40. FL2 = $(LF2)
  41.  
  42. # general-purpose stuff
  43. CP = cp
  44. LN = ln -s
  45. RM = rm -f
  46. E = .ttp
  47. O = .o
  48. M = atari
  49. SHELL = /bin/sh
  50.  
  51. # object files
  52. OBJS1 = unzip$O crc32$O crypt$O envargs$O explode$O
  53. OBJS2 = extract$O fileio$O globals$O inflate$O list$O match$O
  54. OBJS3 = process$O ttyio$O ubz2err$O unreduce$O unshrink$O zipinfo$O
  55. OBJS = $(OBJS1) $(OBJS2) $(OBJS3) $M$O
  56. LOBJS = $(OBJS)
  57. OBJX = unzipsfx$O crc32$O crypt_$O extract_$O fileio_$O \
  58.         globals_$O inflate_$O match_$O process_$O ttyio_$O ubz2err_$O $M_$O
  59. OBJF = funzip$O crc32$O cryptf$O globalsf$O inflatef$O ttyiof$O
  60.  
  61. UNZIP_H = unzip.h unzpriv.h globals.h
  62.  
  63. # installation
  64. INSTALL = cp#   probably can change this to 'install' if you have it
  65. # on some systems, manext=l and MANDIR=/usr/man/man$(manext) may be appropriate
  66. manext = 1
  67. MANDIR = /usr/local/man/man$(manext)#   where to install man pages
  68. BINDIR = /usr/local/bin#                where to install executables
  69. #
  70. UNZIPS = unzip$E funzip$E unzipsfx$E zipinfo$E
  71. MANS = unzip.$(manext) unzipsfx.$(manext) zipinfo.$(manext) funzip.$(manext)
  72. DOCS = unzip.txt unzipsfx.txt zipinfo.txt funzip.txt
  73. # this is a little ugly...
  74. INSTALLED = $(BINDIR)/unzip$E $(BINDIR)/zipinfo$E $(BINDIR)/funzip$E \
  75.         $(BINDIR)/unzipsfx$E $(MANDIR)/unzipsfx.$(manext) \
  76.         $(MANDIR)/unzip.$(manext) $(MANDIR)/zipinfo.$(manext) \
  77.         $(MANDIR)/funzip.$(manext)
  78.  
  79. ###############################################
  80. # BASIC COMPILE INSTRUCTIONS AND DEPENDENCIES #
  81. ###############################################
  82.  
  83. .c$O:
  84.         $(CC) -c $(CF) $*.c
  85.  
  86.  
  87. all:            unzips
  88. unzips:         $(UNZIPS)
  89. docs:           $(DOCS)
  90. unzipsman:      unzips docs
  91. unzipsdocs:     unzips docs
  92.  
  93.  
  94. clean:
  95.         rm -f $(OBJS) $(OBJF) $(OBJX) $(UNZIPS)
  96.  
  97. install:        $(UNZIPS) $(MANS)
  98.         $(INSTALL) $(UNZIPS) $(BINDIR)
  99.         $(LN) $(BINDIR)/unzip$E $(BINDIR)/zipinfo$E
  100.         $(INSTALL) man/unzip.1 $(MANDIR)/unzip.$(manext)
  101.         $(INSTALL) man/unzipsfx.1 $(MANDIR)/unzipsfx.$(manext)
  102.         $(INSTALL) man/zipinfo.1 $(MANDIR)/zipinfo.$(manext)
  103.         $(INSTALL) man/funzip.1 $(MANDIR)/funzip.$(manext)
  104.  
  105. # alternatively, could use zip method:  -cd $(BINDIR); rm -f $(UNZIPS)  [etc.]
  106. uninstall:
  107.         rm -f $(INSTALLED)
  108.  
  109.  
  110. unzip$E:        $(OBJS)                 # add `&' if parallel makes supported
  111.         $(LD) $(LF) $(LOBJS) $(LF2)
  112.  
  113. unzipsfx$E:     $(OBJX)                 # add `&' if parallel makes supported
  114.         $(LD) $(XL) $(OBJX) $(XL2)
  115.  
  116. funzip$E:       $(OBJF)                 # add `&' if parallel makes supported
  117.         $(LD) $(FL) $(OBJF) $(FL2)
  118.  
  119. zipinfo$E:      unzip$E
  120.         @echo\
  121.  '  This is a Unix-inspired target.  If your filesystem does not support'
  122.         @echo\
  123.  '  symbolic links, copy unzip.ttp to zipinfo.ttp rather than linking it,'
  124.         @echo\
  125.  '  or else invoke as "unzip -Z".'
  126.         $(LN) unzip$E zipinfo$E
  127.  
  128.  
  129. crc32$O:        crc32.c $(UNZIP_H) zip.h crc32.h
  130. crypt$O:        crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
  131. envargs$O:      envargs.c $(UNZIP_H)
  132. explode$O:      explode.c $(UNZIP_H)
  133. extract$O:      extract.c $(UNZIP_H) crc32.h crypt.h
  134. fileio$O:       fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h
  135. funzip$O:       funzip.c $(UNZIP_H) crc32.h crypt.h ttyio.h
  136. globals$O:      globals.c $(UNZIP_H)
  137. inflate$O:      inflate.c inflate.h $(UNZIP_H)
  138. list$O:         list.c $(UNZIP_H)
  139. match$O:        match.c $(UNZIP_H)
  140. process$O:      process.c $(UNZIP_H) crc32.h
  141. ttyio$O:        ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
  142. ubz2err$O:      ubz2err.c $(UNZIP_H)
  143. unreduce$O:     unreduce.c $(UNZIP_H)
  144. unshrink$O:     unshrink.c $(UNZIP_H)
  145. unzip$O:        unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
  146. zipinfo$O:      zipinfo.c $(UNZIP_H)
  147.  
  148. # unzipsfx only
  149. crypt_$O:       crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
  150.         $(CP) crypt.c crypt_.c
  151.         $(CC) -c $(CF) $(XC) crypt_.c
  152.         $(RM) crypt_.c
  153.  
  154. extract_$O:     extract.c $(UNZIP_H) crc32.h crypt.h
  155.         $(CP) extract.c extract_.c
  156.         $(CC) -c $(CF) $(XC) extract_.c
  157.         $(RM) extract_.c
  158.  
  159. fileio_$O:      fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h
  160.         $(CP) fileio.c fileio_.c
  161.         $(CC) -c $(CF) $(XC) fileio_.c
  162.         $(RM) fileio_.c
  163.  
  164. globals_$O:     globals.c $(UNZIP_H)
  165.         $(CP) globals.c globals_.c
  166.         $(CC) -c $(CF) $(XC) globals_.c
  167.         $(RM) globals_.c
  168.  
  169. inflate_$O:     inflate.c inflate.h $(UNZIP_H) crypt.h
  170.         $(CP) inflate.c inflate_.c
  171.         $(CC) -c $(CF) $(XC) inflate_.c
  172.         $(RM) inflate_.c
  173.  
  174. match_$O:       match.c $(UNZIP_H)
  175.         $(CP) match.c match_.c
  176.         $(CC) -c $(CF) $(XC) match_.c
  177.         $(RM) match_.c
  178.  
  179. process_$O:     process.c $(UNZIP_H) crc32.h
  180.         $(CP) process.c process_.c
  181.         $(CC) -c $(CF) $(XC) process_.c
  182.         $(RM) process_.c
  183.  
  184. ttyio_$O:       ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
  185.         $(CP) ttyio.c ttyio_.c
  186.         $(CC) -c $(CF) $(XC) ttyio_.c
  187.         $(RM) ttyio_.c
  188.  
  189. ubz2err_$O:     ubz2err.c $(UNZIP_H)
  190.         $(CP) ubz2err.c ubz2err_.c
  191.         $(CC) -c $(CF) $(XC) ubz2err_.c
  192.         $(RM) ubz2err_.c
  193.  
  194. unzipsfx$O:     unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
  195.         $(CP) unzip.c unzip_.c
  196.         $(CC) -c $(CF) $(XC) unzip_.c
  197.         $(RM) unzip_.c
  198.  
  199.  
  200. # funzip only
  201. cryptf$O:       crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
  202.         $(CP) crypt.c cryptf.c
  203.         $(CC) -c $(CF) $(FC) cryptf.c
  204.         $(RM) cryptf.c
  205.  
  206. globalsf$O:     globals.c $(UNZIP_H)
  207.         $(CP) globals.c globalsf.c
  208.         $(CC) -c $(CF) $(FC) globalsf.c
  209.         $(RM) globalsf.c
  210.  
  211. inflatef$O:     inflate.c inflate.h $(UNZIP_H) crypt.h
  212.         $(CP) inflate.c inflatef.c
  213.         $(CC) -c $(CF) $(FC) inflatef.c
  214.         $(RM) inflatef.c
  215.  
  216. ttyiof$O:       ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
  217.         $(CP) ttyio.c ttyiof.c
  218.         $(CC) -c $(CF) $(FC) ttyiof.c
  219.         $(RM) ttyiof.c
  220.  
  221.  
  222. # system-specific code
  223. atari$O:        atari/atari.c $(UNZIP_H)                # Atari only
  224.         $(CC) -c $(CF) atari/atari.c
  225.  
  226. atari_$O:       atari/atari.c $(UNZIP_H)                # unzipsfx only
  227.         $(CP) atari/atari.c atari_.c
  228.         $(CC) -c $(CF) $(XC) atari_.c
  229.         $(RM) atari_.c
  230.