Subversion Repositories Kolibri OS

Rev

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

  1. # Makefile for UnZip 5.53 and later:  Human68k with gcc        NIIMI Satoshi
  2. #
  3. # The original Makefile maybe works fine, but X680x0 is too slow
  4. # to process it.  So I split out needed part.
  5. #
  6. # Last revised:  25 Dec 06
  7. #
  8. # 1999/09/23: Modified by Shimazaki Ryo.
  9.  
  10. ifeq "$(TARGET)" "X68030"
  11. COPT = -m68020-40
  12. AOPT = -m68020
  13. LDFLAGS = -L/usr/local/lib/lib060
  14. endif
  15.  
  16. CC = gcc2
  17. CFLAGS = $(COPT) -Wall -O2 -I. -fomit-frame-pointer -fstrength-reduce \
  18.          -DHAVE_TWONCALL_H -D__DOS_INLINE__ -DASM_CRC -DASM_INFLATECODES
  19. #LDFLAGS = -Wl,-x
  20. LIBS = -lhmem -lttyi -lsignal
  21.  
  22. AS = g2as
  23. ASFLAGS = $(AOPT) -1 -c4 -y
  24.  
  25. # UnZipSFX flags
  26. XC = -DSFX
  27.  
  28. # fUnZip flags
  29. FC = -DFUNZIP
  30.  
  31. # object files
  32. OBJS = unzip.o crc32.o crc_68.o crypt.o envargs.o explode.o extract.o \
  33.         fileio.o globals.o inflate.o flate.o list.o match.o process.o \
  34.         ttyio.o ubz2err.o unreduce.o unshrink.o zipinfo.o human68k.o
  35. OBJX = unzipsfx.o crc32_.o crc_68.o crypt_.o extract_.o fileio_.o globals_.o \
  36.         inflate_.o flate_.o match_.o process_.o ttyio_.o ubz2err_.o human68k_.o
  37. OBJF = funzip.o crc32f.o crc_68.o cryptf.o globalsf.o inflatef.o flatef.o \
  38.         ttyiof.o
  39.  
  40. UNZIP_H = unzip.h unzpriv.h globals.h
  41.  
  42. UNZIPS = unzip.x unzipsfx.x funzip.x
  43. DOCS = unzip.txt unzipsfx.txt zipinfo.txt funzip.txt
  44.  
  45. .c.o:
  46.         $(CC) $(CFLAGS) -I. -c $< -o $@
  47.  
  48. # for debugging
  49. .c.s:
  50.         $(CC) $(CFLAGS) -c $< -o $@
  51.  
  52. all:            unzips
  53. unzips:         $(UNZIPS)
  54. docs:           $(DOCS)
  55. unzipsman:      unzips docs
  56. unzipsdocs:     unzips docs
  57.  
  58. clean:
  59.         rm -f $(OBJS) $(OBJF) $(OBJX) $(UNZIPS)
  60.  
  61. unzip.x: $(OBJS)
  62.         $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
  63.  
  64. unzipsfx.x: $(OBJX)
  65.         $(CC) $(LDFLAGS) -o $@ $(OBJX) $(LIBS)
  66.  
  67. funzip.x: $(OBJF)
  68.         $(CC) $(LDFLAGS) -o $@ $(OBJF) $(LIBS)
  69.  
  70. crc32.o:        crc32.c $(UNZIP_H) zip.h crc32.h
  71. crypt.o:        crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h
  72. envargs.o:      envargs.c $(UNZIP_H)
  73. explode.o:      explode.c $(UNZIP_H)
  74. extract.o:      extract.c $(UNZIP_H) crc32.h crypt.h
  75. fileio.o:       fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h
  76. funzip.o:       funzip.c $(UNZIP_H) crc32.h crypt.h ttyio.hh
  77. globals.o:      globals.c $(UNZIP_H)
  78. inflate.o:      inflate.c inflate.h $(UNZIP_H)
  79. list.o:         list.c $(UNZIP_H)
  80. match.o:        match.c $(UNZIP_H)
  81. process.o:      process.c $(UNZIP_H) crc32.h
  82. ttyio.o:        ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
  83. ubz2err.o:      ubz2err.c $(UNZIP_H)
  84. unreduce.o:     unreduce.c $(UNZIP_H)
  85. unshrink.o:     unshrink.c $(UNZIP_H)
  86. unzip.o:        unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
  87. zipinfo.o:      zipinfo.c $(UNZIP_H)
  88.  
  89.  
  90. # unzipsfx
  91. crc32_.o:       crc32.c $(UNZIP_H) zip.h crc32.h
  92.         $(CC) $(CFLAGS) $(XC) -c $< -o $@
  93.  
  94. crypt_.o:       crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h
  95.         $(CC) $(CFLAGS) $(XC) -c $< -o $@
  96.  
  97. extract_.o:     extract.c $(UNZIP_H) crc32.h crypt.h
  98.         $(CC) $(CFLAGS) $(XC) -c $< -o $@
  99.  
  100. fileio_.o:      fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h
  101.         $(CC) $(CFLAGS) $(XC) -c $< -o $@
  102.  
  103. globals_.o:     globals.c $(UNZIP_H)
  104.         $(CC) $(CFLAGS) $(XC) -c $< -o $@
  105.  
  106. inflate_.o:     inflate.c inflate.h $(UNZIP_H) crypt.h
  107.         $(CC) $(CFLAGS) $(XC) -c $< -o $@
  108.  
  109. match_.o:       match.c $(UNZIP_H)
  110.         $(CC) $(CFLAGS) $(XC) -c $< -o $@
  111.  
  112. process_.o:     process.c $(UNZIP_H) crc32.h
  113.         $(CC) $(CFLAGS) $(XC) -c $< -o $@
  114.  
  115. ttyio_.o:       ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
  116.         $(CC) $(CFLAGS) $(XC) -c $< -o $@
  117.  
  118. ubz2err_.o:     ubz2err.c $(UNZIP_H)
  119.         $(CC) $(CFLAGS) $(XC) -c $< -o $@
  120.  
  121. unzipsfx.o:     unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
  122.         $(CC) $(CFLAGS) $(XC) -c $< -o $@
  123.  
  124.  
  125. # funzip
  126. crc32f.o:       crc32.c $(UNZIP_H) zip.h crc32.h
  127.         $(CC) $(CFLAGS) $(FC) -c $< -o $@
  128.  
  129. cryptf.o:       crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
  130.         $(CC) $(CFLAGS) $(FC) -c $< -o $@
  131.  
  132. globalsf.o:     globals.c $(UNZIP_H)
  133.         $(CC) $(CFLAGS) $(FC) -c $< -o $@
  134.  
  135. inflatef.o:     inflate.c inflate.h $(UNZIP_H) crypt.h
  136.         $(CC) $(CFLAGS) $(FC) -c $< -o $@
  137.  
  138. ttyiof.o:       ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
  139.         $(CC) $(CFLAGS) $(FC) -c $< -o $@
  140.  
  141.  
  142. human68k.o:     human68k/human68k.c $(UNZIP_H)
  143.         $(CC) $(CFLAGS) -I. -c human68k/human68k.c -o $@
  144.  
  145. human68k_.o:    human68k/human68k.c $(UNZIP_H)                  # unzipsfx
  146.         $(CC) $(CFLAGS) $(XC) -I. -c human68k/human68k.c -o $@
  147.  
  148. crc_68.o:       human68k/crc_68.s
  149.         $(AS) $(ASFLAGS) $< -o $@
  150.  
  151. flate.o:        human68k/flate.s human68k/g_offs.mac
  152.         $(AS) $(ASFLAGS) $< -o $@
  153.  
  154. flate_.o:       human68k/flate.s human68k/g_offs_.mac           # unzipsfx
  155.         $(AS) $(ASFLAGS) $< -o $@ -sSFX
  156.  
  157. flatef.o:       human68k/flate.s human68k/g_offsf.mac           # funzip
  158.         $(AS) $(ASFLAGS) $< -o $@ -sFUNZIP
  159.  
  160. human68k/g_offs.mac:    human68k/gbloffs.x
  161.         human68k/mkgoff.x >! $@
  162.  
  163. human68k/g_offs_.mac:   human68k/gbloffs_.x                     # unzipsfx
  164.         human68k/mkgoff_.x >! $@
  165.  
  166. human68k/g_offsf.mac:   human68k/gbloffsf.x                     # funzip
  167.         human68k/mkgofff.x >! $@
  168.  
  169. human68k/gbloffs.x:     gbloffs.c $(UNZIP_H) crypt.h
  170.         $(CC) $(CFLAGS) gbloffs.c -o $@
  171.  
  172. human68k/gbloffs_.x:    gbloffs.c $(UNZIP_H) crypt.h            # unzipsfx
  173.         $(CC) $(CFLAGS) gbloffs.c -o $@ $(XC)
  174.  
  175. human68k/gbloffsf.x:    gbloffs.c $(UNZIP_H) crypt.h            # funzip
  176.         $(CC) $(CFLAGS) gbloffs.c -o $@ $(FC)
  177.  
  178. # the test zipfile
  179. TESTZIP = testmake.zip
  180.  
  181. # test some basic features of the build
  182. test:   check
  183.  
  184. check:  unzips
  185.         @if test ! -f $(TESTZIP); then \
  186.             echo "#####  ERROR:  can't find test file $(TESTZIP)"; exit 1; fi
  187. #
  188.         @echo "#####  testing extraction"
  189.         @./unzip -bo $(TESTZIP) testmake.zipinfo
  190.         @if test ! -f testmake.zipinfo ; then \
  191.             echo "#####  ERROR:  file extraction from $(TESTZIP) failed"; \
  192.             exit 1; fi
  193. #
  194.         @echo '#####  testing zipinfo (unzip -Z)'
  195.         @./unzip -Z $(TESTZIP) > testmake.unzip-Z
  196.         @if diff testmake.unzip-Z testmake.zipinfo; then echo "OK."; else \
  197.             echo "#####  WARNING:  zipinfo output doesn't match stored version"; \
  198.             echo '#####     (If the only difference is the file times, compare your'; \
  199.             echo '#####      timezone with the Central European timezone, which is one'; \
  200.             echo '#####      hour east of Greenwich but effectively 2 hours east'; \
  201.             echo '#####      during summer Daylight Savings Time.  The upper two'; \
  202.             echo '#####      lines should correspond to your local time when the'; \
  203.             echo '#####      files were created, on 19 November 1998 at 10:46pm CET.'; \
  204.             echo '#####      If the times are consistent, please ignore this warning.)'; \
  205.             fi
  206.         @rm -f testmake.unzip-Z testmake.zipinfo
  207. #
  208.         @echo '#####  testing unzip -d exdir option'
  209.         @./unzip -bo $(TESTZIP) -d testun notes
  210.         @cat testun/notes
  211. #
  212.         @echo '#####  testing unzip -o and funzip (ignore funzip warning)'
  213.         @./unzip -boq $(TESTZIP) notes -d testun
  214.         @./funzip < $(TESTZIP) > testun/notes2
  215.         @if diff testun/notes testun/notes2; then true; else \
  216.             echo '#####  ERROR:  funzip output disagrees with unzip'; fi
  217. #
  218.         @echo '#####  testing unzipsfx (self-extractor)'
  219.         @cat unzipsfx.x $(TESTZIP) > testsfx.x
  220.         @chmod 0700 testsfx.x
  221.         @./testsfx -bo notes
  222.         @if diff notes testun/notes; then true; else \
  223.             echo '#####  ERROR:  unzipsfx file disagrees with unzip'; fi
  224.         @rm -f testsfx.x notes testun/notes testun/notes2
  225.         @rmdir testun
  226. #
  227.         @echo '#####  testing complete.'
  228.  
  229. # EOF
  230.