home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip532.zip / msdos / makefile.bc < prev    next >
Makefile  |  1996-04-08  |  6KB  |  260 lines

  1. # Makefile for UnZip(SFX) and fUnZip for Borland C++ 2.x-4.x and Turbo C++ 1.0
  2. # Version: 5.20 and later        Alvin Koh, Jim Knoble, Christian Spieler, etc.
  3. #
  4. # Last revised:  8 Apr 96
  5. #
  6. # To compile with Turbo C++ 1.0, set the macro CC_REV to 1 at the command line
  7. # (make -fmsdos/makefile.bc -DCC_REV=1).
  8.  
  9.  
  10. #    GNU make doesn't like the return value from "rem"
  11. #STRIP=rem
  12. STRIP=echo  Ignore this line.
  13. #    If you don't have LZEXE or PKLITE, get one of them. Then define:
  14. #STRIP=lzexe
  15. #    or
  16. #STRIP=pklite
  17. #    This makes a big difference in .exe size (and possibly load time).
  18.  
  19.  
  20. #    Optional nonstandard preprocessor flags (as -DCHECK_EOF or -DDOS_WILD)
  21. #    should be added to the environment via "set LOCAL_UNZIP=-DFOO" or added
  22. #    to the declaration of LOC here:
  23. LOC = $(LOCAL_UNZIP)
  24.  
  25. # Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc.
  26. CPU_TYP = 0
  27.  
  28. # (De)Select inclusion of optimized assembler CRC32 routine:
  29. USE_ASMCRC = 1
  30.  
  31. !if $(CC_REV) == 1
  32. # Turbo C++ 1.0
  33. CC = tcc
  34. !else
  35. # Borland C++ 2.0, 3.0, 3.1 ...
  36. ! if !$(CC_REV)
  37. CC_REV = 3
  38. ! endif
  39. CC = bcc
  40. !endif
  41.  
  42. AS = tasm
  43.  
  44. # "near data" model is sufficient for UnZip and ZipInfo, now that strings moved
  45. # switched to medium model; UnZip code has grown beyond the 64k limit.
  46. UNMODEL = m        # medium model for UnZip and ZipInfo
  47. ASUNMODEL=__MEDIUM__    # keep in sync with UNMODEL definition !!
  48.  
  49. FUMODEL = s        # always use small model for fUnZip
  50. ASFUMODEL=__SMALL__    # keep in sync with FUMODEL definition !!
  51.  
  52. !if $(USE_ASMCRC)
  53. ASMFLG = -DASM_CRC
  54. ASMOBJS = crc_i86.obj
  55. ASMOBJF = crc_i86_.obj
  56. !else
  57. ASMFLG =
  58. ASMOBJS =
  59. ASMOBJF =
  60. !endif
  61.  
  62.  
  63. # compiler flags
  64.  
  65. ASCPUFLAG = __$(CPU_TYP)86
  66. !if $(CPU_TYP) != 0
  67. CC_CPUFLG = -$(CPU_TYP)
  68. !endif
  69. ASFLAGS = -ml -m2 -w0 -D$(ASCPUFLAG) $(LOC)
  70. !if $(CC_REV) == 1
  71. CFLAGS = -O -G -Z -a -d $(CC_CPUFLG) -ff- -k- -P-.C -I. $(ASMFLG) $(LOC)
  72. LDFLAGS = -lxncd        # for tcc
  73. !else
  74. CFLAGS = -O2 $(CC_CPUFLG) -ff- -k- -P-.C -I. $(ASMFLG) $(LOC)
  75. LDFLAGS = -lxncd -l-P        # for bcc
  76. !endif
  77. UNFLAGS = -m$(UNMODEL) $(CFLAGS)
  78. FUFLAGS = -m$(FUMODEL) $(CFLAGS) -K -d
  79.  
  80. # implicit rules
  81.  
  82. .asm.obj:
  83.     $(AS) $(ASFLAGS) -D$(ASUNMODEL) $<
  84.  
  85. .c.obj:
  86.     $(CC) -c $(UNFLAGS) {$< }
  87.  
  88. # list macros
  89.  
  90. unzip_dependencies = \
  91.     unzip.obj \
  92.     crc32.obj \
  93.     crctab.obj \
  94.     crypt.obj \
  95.     envargs.obj \
  96.     explode.obj \
  97.     extract.obj \
  98.     fileio.obj \
  99.     globals.obj \
  100.     inflate.obj \
  101.     list.obj \
  102.     match.obj \
  103.     process.obj \
  104.     ttyio.obj \
  105.     unreduce.obj \
  106.     unshrink.obj \
  107.     zipinfo.obj \
  108.     msdos.obj \
  109.     $(ASMOBJS)
  110.  
  111. funzip_dependencies = \
  112.     funzip.obj \
  113.     crc32_.obj \
  114.     crypt_.obj \
  115.     globals_.obj \
  116.     inflate_.obj \
  117.     ttyio_.obj \
  118.     $(ASMOBJF)
  119.  
  120. unzipsfx_dependencies = \
  121.     unzipsfx.obj \
  122.     crc32.obj \
  123.     crctab.obj \
  124.     crypt.obj \
  125.     extract_.obj \
  126.     fileio.obj \
  127.     globals.obj \
  128.     inflate.obj \
  129.     match.obj \
  130.     process_.obj \
  131.     ttyio.obj \
  132.     msdos_.obj \
  133.     $(ASMOBJS)
  134.  
  135. UNZIP_H = unzip.h unzpriv.h globals.h msdos/doscfg.h
  136.  
  137. # explicit rules
  138.  
  139. all:    unzip.exe funzip.exe unzipsfx.exe
  140.  
  141. unzip.exe:      $(unzip_dependencies)
  142.     $(CC) -m$(UNMODEL) $(LDFLAGS) -eunzip.exe @&&|
  143. unzip.obj
  144. crc32.obj
  145. crctab.obj
  146. crypt.obj
  147. envargs.obj
  148. explode.obj
  149. extract.obj
  150. fileio.obj
  151. $(ASMOBJS)
  152. globals.obj
  153. inflate.obj
  154. list.obj
  155. match.obj
  156. process.obj
  157. ttyio.obj
  158. unreduce.obj
  159. unshrink.obj
  160. zipinfo.obj
  161. msdos.obj
  162. |
  163.     $(STRIP) unzip.exe
  164.  
  165. funzip.exe:     $(funzip_dependencies)
  166.     $(CC) -m$(FUMODEL) $(LDFLAGS) -efunzip.exe @&&|
  167. funzip.obj
  168. $(ASMOBJF)
  169. crc32_.obj
  170. crypt_.obj
  171. globals_.obj
  172. inflate_.obj
  173. ttyio_.obj
  174. |
  175.     $(STRIP) funzip.exe
  176.  
  177. unzipsfx.exe:   $(unzipsfx_dependencies)
  178.     $(CC) -m$(UNMODEL) $(LDFLAGS) -eunzipsfx.exe @&&|
  179. unzipsfx.obj
  180. crc32.obj
  181. crctab.obj
  182. crypt.obj
  183. extract_.obj
  184. fileio.obj
  185. $(ASMOBJS)
  186. globals.obj
  187. inflate.obj
  188. match.obj
  189. process_.obj
  190. ttyio.obj
  191. msdos_.obj
  192. |
  193.     $(STRIP) unzipsfx.exe
  194.  
  195. clean:
  196.     rem Ignore any errors in the following...
  197.     -del *.obj
  198.     -del unzip.exe
  199.     -del funzip.exe
  200.     -del unzipsfx.exe
  201.  
  202. # individual file dependencies
  203.  
  204. crc32.obj:      crc32.c $(UNZIP_H) zip.h
  205. crctab.obj:     crctab.c $(UNZIP_H) zip.h
  206. crypt.obj:      crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h
  207. envargs.obj:    envargs.c $(UNZIP_H)
  208. explode.obj:    explode.c $(UNZIP_H)
  209. extract.obj:    extract.c $(UNZIP_H) crypt.h
  210. fileio.obj:     fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h
  211. globals.obj:    globals.c $(UNZIP_H)
  212. inflate.obj:    inflate.c inflate.h $(UNZIP_H)
  213. list.obj:       list.c $(UNZIP_H)
  214. match.obj:      match.c $(UNZIP_H)
  215. process.obj:    process.c $(UNZIP_H)
  216. ttyio.obj:      ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
  217. unreduce.obj:   unreduce.c $(UNZIP_H)
  218. unshrink.obj:   unshrink.c $(UNZIP_H)
  219. unzip.obj:      unzip.c $(UNZIP_H) crypt.h version.h consts.h
  220. zipinfo.obj:    zipinfo.c $(UNZIP_H)
  221.  
  222. crc_i86.obj:    msdos/crc_i86.asm
  223.     $(AS) $(ASFLAGS) -D$(ASUNMODEL) msdos\crc_i86.asm, $*.obj ;
  224.  
  225. crc_i86_.obj:   msdos/crc_i86.asm
  226.     $(AS) $(ASFLAGS) -D$(ASFUMODEL) msdos\crc_i86.asm, $*.obj ;
  227.  
  228. msdos.obj:      msdos/msdos.c $(UNZIP_H)
  229.     $(CC) -c $(UNFLAGS) msdos/msdos.c
  230.  
  231. funzip.obj:     funzip.c $(UNZIP_H) crypt.h ttyio.h tables.h
  232.     $(CC) -c $(FUFLAGS) funzip.c
  233.  
  234. crc32_.obj:     crc32.c $(UNZIP_H) zip.h
  235.     $(CC) -c $(FUFLAGS) -DFUNZIP -ocrc32_.obj crc32.c
  236.  
  237. crypt_.obj:     crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h
  238.     $(CC) -c $(FUFLAGS) -DFUNZIP -ocrypt_.obj crypt.c
  239.  
  240. globals_.obj:   globals.c $(UNZIP_H)
  241.     $(CC) -c $(FUFLAGS) -DFUNZIP -oglobals_.obj globals.c
  242.  
  243. inflate_.obj:   inflate.c inflate.h $(UNZIP_H) crypt.h
  244.     $(CC) -c $(FUFLAGS) -DFUNZIP -oinflate_.obj inflate.c
  245.  
  246. unzipsfx.obj:   unzip.c $(UNZIP_H) crypt.h version.h consts.h
  247.     $(CC) -c $(UNFLAGS) -DSFX -ounzipsfx.obj unzip.c
  248.  
  249. extract_.obj:   extract.c $(UNZIP_H) crypt.h
  250.     $(CC) -c $(UNFLAGS) -DSFX -oextract_.obj extract.c
  251.  
  252. process_.obj:   process.c $(UNZIP_H)
  253.     $(CC) -c $(UNFLAGS) -DSFX -oprocess_.obj process.c
  254.  
  255. ttyio_.obj:     ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
  256.     $(CC) -c $(FUFLAGS) -DFUNZIP -ottyio_.obj ttyio.c
  257.  
  258. msdos_.obj:     msdos/msdos.c $(UNZIP_H)
  259.     $(CC) -c $(UNFLAGS) -DSFX -omsdos_.obj msdos/msdos.c
  260.