home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip532.zip / msdos / makefile.msc < prev    next >
Makefile  |  1996-03-31  |  7KB  |  217 lines

  1. #------------------------------------------------------------------------------
  2. # Makefile for UnZip 5.2 and later                      Greg Roelofs and others
  3. # Version:  Microsoft C (5.x and later)                               31 Mar 96
  4. #------------------------------------------------------------------------------
  5.  
  6. # Users of MSC 6/7 and NMAKE can use the Unix Makefile (target msc_dos),
  7. # if desired.  This makefile works just fine, too, however.  OS/2 users
  8. # can cross-compile using os2/makefile.os2 (target mscdos).  Note that
  9. # there is possibly a bug in MSC 6 which screws up funzip (goes into
  10. # infinite loop? --this has not been confirmed in over a year...).  There
  11. # is definitely a bug (internal compiler error) in MSC 6.00 while com-
  12. # piling explode.c (fixed in 6.0a, 6.0ax, 6.0ax2, 7.*, 8.*).
  13.  
  14.  
  15. #    GNU make doesn't like the return value from "rem"
  16. #STRIP=rem
  17. STRIP=echo  Ignore this line.
  18. #    If you don't have LZEXE or PKLITE, get one of them. Then define:
  19. #STRIP=lzexe
  20. #    or
  21. #STRIP=pklite
  22. #    and remove /e from LDFLAGS.
  23. #    This makes a big difference in .exe size (and possibly load time).
  24.  
  25. #    Optional nonstandard preprocessor flags (as -DCHECK_EOF or -DDOS_WILD)
  26. #    should be added to the environment via "set LOCAL_UNZIP=-DFOO" or added
  27. #    to the declaration of LOC here:
  28. LOC = $(LOCAL_UNZIP)
  29.  
  30. # Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc.
  31. CPU_TYP = 0
  32.  
  33. # small model for MSC 6.0 and 7.0?
  34. #UNMODEL=S    # small model for UnZip and UnZipSFX
  35. # with MSC 5.1 and 8.x, small model exceeds 64k code segment; use medium instead
  36. UNMODEL=M    # medium model for UnZip and UnZipSFX
  37. FUMODEL=S    # always use small model for fUnZip
  38.  
  39. # name of Flag to select memory model for assembler compiles, supported
  40. # values are __SMALL__ , __MEDIUM__ , __COMPACT__ , __LARGE__ :
  41. #ASUNMODEL=__SMALL__    # keep in sync with UNMODEL definition !!
  42. # for MSC 5.1 and 8.x use:
  43. ASUNMODEL=__MEDIUM__    # keep in sync with UNMODEL definition !!
  44. ASFUMODEL=__SMALL__    # keep in sync with FUMODEL definition !!
  45.  
  46. # Uncomment the following three macros to use the optimized CRC32 assembler
  47. # routine in UnZip and UnZipSFX:
  48. ASMFLG = -DASM_CRC
  49. ASMOBJS = crc_i86.obj
  50. ASMOBJF = crc_i86_.obj
  51.  
  52. ASCPUFLAG = __$(CPU_TYP)86
  53.  
  54. CC = cl        # -Ox does not work for inflate.c
  55. # add -G2(3,4) for 286 (386, 486) and/or -FPi87 for 80x87:
  56. CFLAGS = -nologo -DMSC $(ASMFLG) $(LOC) -G$(CPU_TYP) -Oait -Gs -I.
  57.  
  58. AS = masm
  59. ASFLAGS = -ml -D$(ASCPUFLAG) $(LOC)
  60.  
  61. LD = Link    # mixed case to disable special handling by GNU Make
  62. # remove /e if you have LZEXE or PKLITE:
  63. LDFLAGS = /nologo/noi/e/st:0x0c00/farcall/packcode
  64. # "/farcall/packcode" are only useful for `large code' memory models
  65. # but should be a "no-op" for small code models.
  66. LDFLAGS2 = ,$*
  67. LDFLAGS2_UN = $(LDFLAGS2);
  68. LDFLAGS2_FU = $(LDFLAGS2);
  69.  
  70. OBJS1 = unzip.obj crc32.obj crctab.obj crypt.obj envargs.obj explode.obj
  71. OBJS2 = extract.obj fileio.obj globals.obj inflate.obj list.obj match.obj
  72. OBJS3 = process.obj ttyio.obj unreduce.obj unshrink.obj zipinfo.obj
  73. OBJS4 = msdos.obj $(ASMOBJS)
  74. OBJS = $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4)
  75.  
  76. OBJX1 = unzipsfx.obj crc32.obj crctab.obj crypt.obj extract_.obj fileio.obj
  77. OBJX2 = globals.obj inflate.obj match.obj process_.obj ttyio.obj
  78. OBJX3 = msdos_.obj $(ASMOBJS)
  79. OBJX = $(OBJX1) $(OBJX2) $(OBJX3)
  80.  
  81. OBJF = funzip.obj crc32_.obj crypt_.obj globals_.obj inflate_.obj ttyio_.obj \
  82.     $(ASMOBJF)
  83.  
  84. UNZIP_H = unzip.h unzpriv.h globals.h msdos/doscfg.h
  85.  
  86.  
  87. default:        unzip.exe funzip.exe unzipsfx.exe
  88.  
  89. #clean:
  90. # As long as the brain damaged old ``Make'' utility from MSC 5.1 and earlier
  91. # (NMAKE from MSC 6.0 + would work !) remains supported, a "clean" target
  92. # cannot be inserted !!
  93.  
  94. # pattern rules for implicit dependencies:
  95. .asm.obj:
  96.     $(AS) $(ASFLAGS) -D$(ASUNMODEL) $<, $@;
  97.  
  98. .c.obj:
  99.     $(CC) -c -A$(UNMODEL) $(CFLAGS) $*.c
  100.  
  101. # individual dependencies and action rules:
  102. crc_i86.obj:    msdos/crc_i86.asm
  103.     $(AS) $(ASFLAGS) -D$(ASUNMODEL) msdos/crc_i86.asm, $@;
  104.  
  105. crc_i86_.obj:   msdos/crc_i86.asm
  106.     $(AS) $(ASFLAGS) -D$(ASFUMODEL) msdos/crc_i86.asm, $@;
  107.  
  108. crc32.obj:      crc32.c $(UNZIP_H) zip.h
  109.  
  110. crc32_.obj:     crc32.c $(UNZIP_H) zip.h
  111.     $(CC) -c -A$(FUMODEL) $(CFLAGS) -DFUNZIP -Focrc32_.obj crc32.c
  112.  
  113. crctab.obj:     crctab.c $(UNZIP_H) zip.h
  114.  
  115. crypt.obj:      crypt.c $(UNZIP_H) crypt.h ttyio.h zip.h
  116.  
  117. crypt_.obj:     crypt.c $(UNZIP_H) crypt.h ttyio.h zip.h
  118.     $(CC) -c -A$(FUMODEL) $(CFLAGS) -DFUNZIP -Focrypt_.obj crypt.c
  119.  
  120. envargs.obj:    envargs.c $(UNZIP_H)
  121.  
  122. explode.obj:    explode.c $(UNZIP_H)
  123.  
  124. extract.obj:    extract.c $(UNZIP_H) crypt.h
  125.  
  126. extract_.obj:   extract.c $(UNZIP_H) crypt.h
  127.     $(CC) -c -A$(UNMODEL) $(CFLAGS) -DSFX -Foextract_.obj extract.c
  128.  
  129. fileio.obj:     fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h
  130.  
  131. funzip.obj:     funzip.c $(UNZIP_H) crypt.h ttyio.h tables.h
  132.     $(CC) -c -A$(FUMODEL) $(CFLAGS) funzip.c
  133.  
  134. globals.obj:    globals.c $(UNZIP_H)
  135.  
  136. globals_.obj:   globals.c $(UNZIP_H)
  137.     $(CC) -c -A$(FUMODEL) $(CFLAGS) -DFUNZIP -Foglobals_.obj globals.c
  138.  
  139. inflate.obj:    inflate.c inflate.h $(UNZIP_H)
  140.  
  141. inflate_.obj:   inflate.c inflate.h $(UNZIP_H) crypt.h
  142.     $(CC) -c -A$(FUMODEL) $(CFLAGS) -DFUNZIP -Foinflate_.obj inflate.c
  143.  
  144. list.obj:       list.c $(UNZIP_H)
  145.  
  146. match.obj:      match.c $(UNZIP_H)
  147.  
  148. msdos.obj:      msdos/msdos.c $(UNZIP_H)
  149.     $(CC) -c -A$(UNMODEL) $(CFLAGS) msdos/msdos.c
  150.  
  151. msdos_.obj:     msdos/msdos.c $(UNZIP_H)
  152.     $(CC) -c -A$(UNMODEL) $(CFLAGS) -DSFX -Fomsdos_.obj msdos/msdos.c
  153.  
  154. process.obj:    process.c $(UNZIP_H)
  155.  
  156. process_.obj:   process.c $(UNZIP_H)
  157.     $(CC) -c -A$(UNMODEL) $(CFLAGS) -DSFX -Foprocess_.obj process.c
  158.  
  159. ttyio.obj:      ttyio.c $(UNZIP_H) crypt.h ttyio.h zip.h
  160.  
  161. ttyio_.obj:     ttyio.c $(UNZIP_H) crypt.h ttyio.h zip.h
  162.     $(CC) -c -A$(FUMODEL) $(CFLAGS) -DFUNZIP -Fottyio_.obj ttyio.c
  163.  
  164. unreduce.obj:   unreduce.c $(UNZIP_H)
  165.  
  166. unshrink.obj:   unshrink.c $(UNZIP_H)
  167.  
  168. unzip.obj:      unzip.c $(UNZIP_H) crypt.h version.h consts.h
  169.  
  170. unzipsfx.obj:   unzip.c $(UNZIP_H) crypt.h version.h consts.h
  171.     $(CC) -c -A$(UNMODEL) $(CFLAGS) -DSFX -Founzipsfx.obj unzip.c
  172.  
  173. zipinfo.obj:    zipinfo.c $(UNZIP_H)
  174.  
  175.  
  176. # MS make:
  177. # -------
  178. unzip.exe:      $(OBJS)
  179.     echo $(OBJS1)+ > unzip.rsp
  180.     echo $(OBJS2)+ >> unzip.rsp
  181.     echo $(OBJS3)+ >> unzip.rsp
  182.     echo $(OBJS4) >> unzip.rsp
  183.     echo $(LDFLAGS2_UN) >> unzip.rsp
  184.     $(LD) $(LDFLAGS) @unzip.rsp
  185.     del unzip.rsp
  186.     $(STRIP) unzip.exe
  187.  
  188. unzipsfx.exe:   $(OBJX)
  189.     echo $(OBJX1)+ > unzipsfx.rsp
  190.     echo $(OBJX2)+ >> unzipsfx.rsp
  191.     echo $(OBJX3) >> unzipsfx.rsp
  192.     echo $(LDFLAGS2_UN) >> unzipsfx.rsp
  193.     $(LD) $(LDFLAGS) @unzipsfx.rsp
  194.     del unzipsfx.rsp
  195.     $(STRIP) unzipsfx.exe
  196.  
  197. funzip.exe:     $(OBJF)
  198.     echo $(OBJF) > funzip.rsp
  199.     echo $(LDFLAGS2_FU) >> funzip.rsp
  200.     $(LD) $(LDFLAGS) @funzip.rsp
  201.     del funzip.rsp
  202.     $(STRIP) funzip.exe
  203.  
  204. # better makes which know how to deal with 128-char limit on command line:
  205. # -----------------------------------------------------------------------
  206. #unzip.exe:      $(OBJS)
  207. #    $(LD) $(LDFLAGS) $(OBJS) $(LDFLAGS2)
  208. #    $(STRIP) unzip.exe
  209. #
  210. #unzipsfx.exe:   $(OBJX)
  211. #    $(LD) $(LDFLAGS) $(OBJX) $(LDFLAGS2)
  212. #    $(STRIP) unzipsfx.exe
  213. #
  214. #funzip.exe:     $(OBJF)
  215. #    $(LD) $(LDFLAGS) $(OBJF) $(LDFLAGS2_FU)
  216. #    $(STRIP) funzip.exe
  217.