home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip531.zip / msdos / makefile.tc < prev    next >
Makefile  |  1996-04-20  |  6KB  |  208 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++)          11 Feb 96
  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 funzip.exe unzipsfx.exe
  74.  
  75. clean:
  76.     rem Ignore any errors in the following...
  77.     del *.ob
  78.     del *.obj
  79.     del unzip.exe
  80.     del funzip.exe
  81.     del unzipsfx.exe
  82.  
  83. .asm.obj:
  84.     $(AS) $(ASFLAGS) -D$(ASUNMODEL) $*.asm
  85.  
  86. .c.obj:
  87.     $(CC) -c $(UCFLAGS) $*.c
  88.  
  89. crc_i86.obj:    msdos/crc_i86.asm
  90.     $(AS) $(ASFLAGS) -D$(ASUNMODEL) msdos\crc_i86.asm, $*.obj ;
  91.  
  92. crc_i86_.obj:   msdos/crc_i86.asm
  93.     $(AS) $(ASFLAGS) -D$(ASFUMODEL) msdos\crc_i86.asm, $*.obj ;
  94.  
  95. crc32.obj:      crc32.c $(UNZIP_H) zip.h
  96.  
  97. crc32_.obj:     crc32.c $(UNZIP_H) zip.h
  98.     $(CC) -c $(FCFLAGS) -DFUNZIP -ocrc32_.obj crc32.c
  99.  
  100. crctab.obj:     crctab.c $(UNZIP_H) zip.h
  101.  
  102. crypt.obj:      crypt.c $(UNZIP_H) crypt.h ttyio.h zip.h
  103.  
  104. crypt_.obj:     crypt.c $(UNZIP_H) crypt.h ttyio.h zip.h
  105.     $(CC) -c $(FCFLAGS) -DFUNZIP -ocrypt_.obj crypt.c
  106.  
  107. envargs.obj:    envargs.c $(UNZIP_H)
  108.  
  109. explode.obj:    explode.c $(UNZIP_H)
  110.  
  111. extract.obj:    extract.c $(UNZIP_H) crypt.h
  112.  
  113. extract_.obj:   extract.c $(UNZIP_H) crypt.h
  114.     $(CC) -c $(UCFLAGS) -DSFX -oextract_.obj extract.c
  115.  
  116. fileio.obj:     fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h
  117.  
  118. funzip.obj:     funzip.c $(UNZIP_H) crypt.h ttyio.h tables.h
  119.     $(CC) -c $(FCFLAGS) funzip.c
  120.  
  121. globals.obj:    globals.c $(UNZIP_H)
  122.  
  123. globals_.obj:   globals.c $(UNZIP_H)
  124.     $(CC) -c $(FCFLAGS) -DFUNZIP -oglobals_.obj globals.c
  125.  
  126. inflate.obj:    inflate.c inflate.h $(UNZIP_H)
  127.  
  128. inflate_.obj:   inflate.c inflate.h $(UNZIP_H) crypt.h
  129.     $(CC) -c $(FCFLAGS) -DFUNZIP -oinflate_.obj inflate.c
  130.  
  131. list.obj:       list.c $(UNZIP_H)
  132.  
  133. match.obj:      match.c $(UNZIP_H)
  134.  
  135. msdos.obj:      msdos/msdos.c $(UNZIP_H)
  136.     $(CC) -c $(UCFLAGS) msdos/msdos.c
  137.  
  138. msdos_.obj:     msdos/msdos.c $(UNZIP_H)
  139.     $(CC) -c $(UCFLAGS) -DSFX -omsdos_.obj msdos/msdos.c
  140.  
  141. process.obj:    process.c $(UNZIP_H)
  142.  
  143. process_.obj:   process.c $(UNZIP_H)
  144.     $(CC) -c $(UCFLAGS) -DSFX -oprocess_.obj process.c
  145.  
  146. ttyio.obj:      ttyio.c $(UNZIP_H) crypt.h ttyio.h zip.h
  147.  
  148. ttyio_.obj:     ttyio.c $(UNZIP_H) crypt.h ttyio.h zip.h
  149.     $(CC) -c $(FCFLAGS) -DFUNZIP -ottyio_.obj ttyio.c
  150.  
  151. unreduce.obj:   unreduce.c $(UNZIP_H)
  152.  
  153. unshrink.obj:   unshrink.c $(UNZIP_H)
  154.  
  155. unzip.obj:      unzip.c $(UNZIP_H) crypt.h version.h consts.h
  156.  
  157. unzipsfx.obj:   unzip.c $(UNZIP_H) crypt.h version.h consts.h
  158.     $(CC) -c $(UCFLAGS) -DSFX -ounzipsfx.obj unzip.c
  159.  
  160. zipinfo.obj:    zipinfo.c $(UNZIP_H)
  161.  
  162.  
  163. # Turbo Make which cannot deal with the MS-DOS 128-byte limit:
  164. # -----------------------------------------------------------
  165. unzip.exe:      $(OBJS)
  166.     rem   Ignore any warnings in the following commands:
  167.         del crc32_.ob
  168.         ren crc32_.obj *.ob
  169.         del crc_i86_.ob
  170.         ren crc_i86_.obj *.ob
  171.     del crypt_.ob
  172.     ren crypt_.obj *.ob
  173.     del extract_.ob
  174.     ren extract_.obj *.ob
  175.     del funzip.ob
  176.     ren funzip.obj *.ob
  177.     del globals_.ob
  178.     ren globals_.obj *.ob
  179.     del inflate_.ob
  180.     ren inflate_.obj *.ob
  181.     del msdos_.ob
  182.     ren msdos_.obj *.ob
  183.     del process_.ob
  184.     ren process_.obj *.ob
  185.     del ttyio_.ob
  186.     ren ttyio_.obj *.ob
  187.     del unzipsfx.ob
  188.     ren unzipsfx.obj *.ob
  189.     $(CC) $(ULDFLAGS) -eunzip.exe *.obj
  190.     ren *.ob *.obj
  191.     $(STRIP) unzip.exe
  192.  
  193. # better makes which know how to deal with 128-char limit on command line:
  194. # -----------------------------------------------------------------------
  195. #unzip.exe:      $(OBJS)
  196. #    $(CC) $(ULDFLAGS) $(OBJS) $(LDFLAGS2)
  197. #    $(STRIP) unzip.exe
  198.  
  199. # both makes:
  200. # ----------
  201. funzip.exe:     $(OBJF)
  202.     $(CC) $(FLDFLAGS) $(OBJF) $(LDFLAGS2)
  203.     $(STRIP) funzip.exe
  204.  
  205. unzipsfx.exe:     $(OBJX)
  206.     $(CC) $(ULDFLAGS) $(OBJX) $(LDFLAGS2)
  207.     $(STRIP) unzipsfx.exe
  208.