home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip540.zip / msdos / makefile.tc < prev    next >
Makefile  |  1997-09-28  |  6KB  |  224 lines

  1. #------------------------------------------------------------------------------
  2. # Makefile for UnZip 5.2 and later                             Jean-loup Gailly
  3. # Version:  Turbo C (edit and use makefile.bc for Turbo C++)          28 Sep 97
  4. #------------------------------------------------------------------------------
  5.  
  6. #    GNU make doesn't like the return value from "rem"
  7. #STRIP=rem
  8. STRIP=echo  Ignore this line. :-)
  9. #    If you don't have LZEXE or PKLITE, get one of them. Then define:
  10. #STRIP=lzexe
  11. #    or
  12. #STRIP=pklite
  13. #    This makes a big difference in .exe size (and possibly load time).
  14.  
  15. #    Optional nonstandard preprocessor flags (as -DCHECK_EOF or -DDOS_WILD)
  16. #    should be added to the environment via "set LOCAL_UNZIP=-DFOO" or added
  17. #    to the declaration of LOC here:
  18. LOC = $(LOCAL_UNZIP)
  19.  
  20. # Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc.
  21. CPU_TYP = 0
  22.  
  23. # memory model for UnZip (conflicting reports on whether Turbo C can or
  24. # cannot put strings into far memory; for now assume it can and use small
  25. # model *with* ZipInfo enabled...if fails, either define NO_ZIPINFO or
  26. # use large model)   [GRR 940712:  sigh, no go--inflate fails.  Back to
  27. # large model...]
  28. #UNMODEL = s
  29. UNMODEL = l
  30. # funzip is always small-model
  31. FUMODEL = s
  32.  
  33. # name of Flag to select memory model for assembler compiles, supported
  34. # values are __SMALL__ , __MEDIUM__ , __COMPACT__ , __LARGE__ :
  35. ASUNMODEL=__LARGE__    # keep in sync with UNMODEL definition !!
  36. ASFUMODEL=__SMALL__    # keep in sync with FUMODEL definition !!
  37.  
  38. # Uncomment the following three macros to use the optimized CRC32 assembler
  39. # routine in UnZip and UnZipSFX:
  40. ASMFLG = -DASM_CRC
  41. ASMOBJS = crc_i86.obj
  42. ASMOBJF = crc_i86_.obj
  43.  
  44. CC = tcc
  45.  
  46. AS = tasm
  47.  
  48. ASCPUFLAG = __$(CPU_TYP)86
  49. ASFLAGS = -ml -m2 -w0 -D$(ASCPUFLAG) $(LOC)
  50. CFLAGS = -O -Z -I. -DFar= $(ASMFLG) $(LOC)
  51. UCFLAGS = -m$(UNMODEL) $(CFLAGS)
  52. ULDFLAGS = -m$(UNMODEL)
  53. FCFLAGS = -m$(FUMODEL) $(CFLAGS)
  54. FLDFLAGS = -m$(FUMODEL)
  55.  
  56. LDFLAGS2 =
  57.  
  58. OBJS = unzip.obj crc32.obj crctab.obj crypt.obj envargs.obj explode.obj \
  59.     extract.obj fileio.obj globals.obj inflate.obj list.obj match.obj \
  60.     process.obj ttyio.obj unreduce.obj unshrink.obj zipinfo.obj \
  61.     msdos.obj $(ASMOBJS)
  62.  
  63. OBJX = unzipsfx.obj crc32.obj crctab.obj crypt.obj extract_.obj fileio.obj \
  64.     globals.obj inflate.obj match.obj process_.obj ttyio.obj \
  65.     msdos_.obj $(ASMOBJS)
  66.  
  67. OBJF = funzip.obj crc32_.obj crypt_.obj globals_.obj inflate_.obj ttyio_.obj \
  68.     $(ASMOBJF)
  69.  
  70. UNZIP_H = unzip.h unzpriv.h globals.h msdos/doscfg.h
  71.  
  72.  
  73. default:        unzip.exe unzipsfx.exe funzip.exe
  74.  
  75. clean:
  76.     rem Ignore any errors in the following...
  77.     del *.ob
  78.     del *.obu
  79.     del *.obj
  80.     del unzip.exe
  81.     del funzip.exe
  82.     del unzipsfx.exe
  83.  
  84. .asm.obj:
  85.     $(AS) $(ASFLAGS) -D$(ASUNMODEL) $*.asm
  86.  
  87. .c.obj:
  88.     $(CC) -c $(UCFLAGS) $*.c
  89.  
  90. crc_i86.obj:    msdos/crc_i86.asm
  91.     $(AS) $(ASFLAGS) -D$(ASUNMODEL) msdos\crc_i86.asm, $*.obj ;
  92.  
  93. crc_i86_.obj:   msdos/crc_i86.asm
  94.     $(AS) $(ASFLAGS) -D$(ASFUMODEL) msdos\crc_i86.asm, $*.obj ;
  95.  
  96. crc32.obj:      crc32.c $(UNZIP_H) zip.h
  97.  
  98. crc32_.obj:     crc32.c $(UNZIP_H) zip.h
  99.     $(CC) -c $(FCFLAGS) -DFUNZIP -ocrc32_.obj crc32.c
  100.  
  101. crctab.obj:     crctab.c $(UNZIP_H) zip.h
  102.  
  103. crypt.obj:      crypt.c $(UNZIP_H) crypt.h ttyio.h zip.h
  104.  
  105. crypt_.obj:     crypt.c $(UNZIP_H) crypt.h ttyio.h zip.h
  106.     $(CC) -c $(FCFLAGS) -DFUNZIP -ocrypt_.obj crypt.c
  107.  
  108. envargs.obj:    envargs.c $(UNZIP_H)
  109.  
  110. explode.obj:    explode.c $(UNZIP_H)
  111.  
  112. extract.obj:    extract.c $(UNZIP_H) crypt.h
  113.  
  114. extract_.obj:   extract.c $(UNZIP_H) crypt.h
  115.     $(CC) -c $(UCFLAGS) -DSFX -oextract_.obj extract.c
  116.  
  117. fileio.obj:     fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h
  118.  
  119. funzip.obj:     funzip.c $(UNZIP_H) crypt.h ttyio.h tables.h
  120.     $(CC) -c $(FCFLAGS) funzip.c
  121.  
  122. globals.obj:    globals.c $(UNZIP_H)
  123.  
  124. globals_.obj:   globals.c $(UNZIP_H)
  125.     $(CC) -c $(FCFLAGS) -DFUNZIP -oglobals_.obj globals.c
  126.  
  127. inflate.obj:    inflate.c inflate.h $(UNZIP_H)
  128.  
  129. inflate_.obj:   inflate.c inflate.h $(UNZIP_H) crypt.h
  130.     $(CC) -c $(FCFLAGS) -DFUNZIP -oinflate_.obj inflate.c
  131.  
  132. list.obj:       list.c $(UNZIP_H)
  133.  
  134. match.obj:      match.c $(UNZIP_H)
  135.  
  136. msdos.obj:      msdos/msdos.c $(UNZIP_H)
  137.     $(CC) -c $(UCFLAGS) msdos/msdos.c
  138.  
  139. msdos_.obj:     msdos/msdos.c $(UNZIP_H)
  140.     $(CC) -c $(UCFLAGS) -DSFX -omsdos_.obj msdos/msdos.c
  141.  
  142. process.obj:    process.c $(UNZIP_H)
  143.  
  144. process_.obj:   process.c $(UNZIP_H)
  145.     $(CC) -c $(UCFLAGS) -DSFX -oprocess_.obj process.c
  146.  
  147. ttyio.obj:      ttyio.c $(UNZIP_H) crypt.h ttyio.h zip.h
  148.  
  149. ttyio_.obj:     ttyio.c $(UNZIP_H) crypt.h ttyio.h zip.h
  150.     $(CC) -c $(FCFLAGS) -DFUNZIP -ottyio_.obj ttyio.c
  151.  
  152. unreduce.obj:   unreduce.c $(UNZIP_H)
  153.  
  154. unshrink.obj:   unshrink.c $(UNZIP_H)
  155.  
  156. unzip.obj:      unzip.c $(UNZIP_H) crypt.h version.h consts.h
  157.  
  158. unzipsfx.obj:   unzip.c $(UNZIP_H) crypt.h version.h consts.h
  159.     $(CC) -c $(UCFLAGS) -DSFX -ounzipsfx.obj unzip.c
  160.  
  161. zipinfo.obj:    zipinfo.c $(UNZIP_H)
  162.  
  163.  
  164. # Turbo Make, which cannot deal with the MS-DOS 128-byte limit:
  165. # ------------------------------------------------------------
  166. unzip.exe:      $(OBJS)
  167.     rem   Ignore any warnings in the following commands:
  168.     del *.ob
  169.     ren crc32_.obj *.ob
  170.     ren crc_i86_.obj *.ob
  171.     ren crypt_.obj *.ob
  172.     ren extract_.obj *.ob
  173.     ren funzip.obj *.ob
  174.     ren globals_.obj *.ob
  175.     ren inflate_.obj *.ob
  176.     ren msdos_.obj *.ob
  177.     ren process_.obj *.ob
  178.     ren ttyio_.obj *.ob
  179.     ren unzipsfx.obj *.ob
  180.     $(CC) $(ULDFLAGS) -eunzip.exe *.obj
  181.     ren *.ob *.obj
  182.     @$(STRIP) unzip.exe
  183.  
  184. # GRR 970901
  185. unzipsfx.exe:      $(OBJX)
  186.     rem   Ignore any warnings in the following commands:
  187.     del *.ob
  188.     ren crc32_.obj *.ob
  189.     ren crc_i86_.obj *.ob
  190.     ren crypt_.obj *.ob
  191.     ren envargs.obj *.ob
  192.     ren explode.obj *.ob
  193.     ren extract.obj *.ob
  194.     ren funzip.obj *.ob
  195.     ren globals_.obj *.ob
  196.     ren inflate_.obj *.ob
  197.     ren list.obj *.ob
  198.     ren msdos.obj *.ob
  199.     ren process.obj *.ob
  200.     ren ttyio_.obj *.ob
  201.     ren unreduce.obj *.ob
  202.     ren unshrink.obj *.ob
  203.     ren unzip.obj *.ob
  204.     ren zipinfo.obj *.ob
  205.     $(CC) $(ULDFLAGS) -eunzipsfx.exe *.obj
  206.     ren *.ob *.obj
  207.     @$(STRIP) unzipsfx.exe
  208.  
  209. # better makes that know how to deal with 128-char limit on command line:
  210. # ----------------------------------------------------------------------
  211. #unzip.exe:      $(OBJS)
  212. #    $(CC) $(ULDFLAGS) $(OBJS) $(LDFLAGS2)
  213. #    @$(STRIP) unzip.exe
  214. #
  215. #unzipsfx.exe:     $(OBJX)
  216. #    $(CC) $(ULDFLAGS) $(OBJX) $(LDFLAGS2)
  217. #    @$(STRIP) unzipsfx.exe
  218.  
  219. # both makes:
  220. # ----------
  221. funzip.exe:     $(OBJF)
  222.     $(CC) $(FLDFLAGS) $(OBJF) $(LDFLAGS2)
  223.     @$(STRIP) funzip.exe
  224.