makefile.msc 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. # Makefile for Zip, ZipCloak, ZipNote and ZipSplit for
  2. # Microsoft C 5.1 and above.
  3. # To use, do "make makefile.msc"
  4. # Add -DSMALL_MEM or -DMEDIUM_MEM to the LOC macro if you wish to reduce
  5. # the memory requirements.
  6. # Add -DNO_ASM to CFLAGS and comment out the ASMOBJS definition if
  7. # you do not have masm.
  8. #
  9. # If you want link Zip against zlib to replace the built-in deflate routines,
  10. # the following changes are required:
  11. # - in the definition of "LOC", add "-DUSE_ZLIB" and remove "-DNO_SECURE_TESTS"
  12. # - comment out the "ASMOBJS" symbol definition
  13. # - modify the linking command blocks for zip and zipcloak according to
  14. # the following scheme:
  15. # add a command line "echo ,,,zlib_$(ZIPMODEL); >> zip[c].rsp" just
  16. # before the "$(LD)..." line; and remove the semicolon character from the
  17. # "echo ..." line immediately preceding the just inserted command
  18. # Optional nonstandard preprocessor flags (as -DMEDIUM_MEM or -DNO_ASM)
  19. # should be added to the environment via "set LOCAL_ZIP=-DFOO" or added
  20. # to the declaration of LOC here:
  21. LOC = -DDOS -DDYN_ALLOC -DNO_SECURE_TESTS $(LOCAL_ZIP)
  22. # Zip requires compact or large memory model.
  23. # with 2.1, compact model exceeds 64k code segment; use large model
  24. ZIPMODEL=L # large model for Zip and ZipUtils
  25. # name of Flag to select memory model for assembler compiles, supported
  26. # values are __SMALL__ , __MEDIUM__ , __COMPACT__ , __LARGE__ :
  27. ASMODEL=__LARGE__ # keep in sync with ZIPMODEL definition !!
  28. # Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc.
  29. CPU_TYP = 0
  30. # Uncomment the following macro to use the optimized assembler
  31. # routines in Zip:
  32. ASMOBJS = match.obj crc_i86.obj
  33. ASCPUFLAG = __$(CPU_TYP)86
  34. # ------------- Microsoft C 5.1, 6.0, 7.0 and VC++ Pro 1.0 -------------
  35. CC=cl
  36. MODEL=-A$(ZIPMODEL)
  37. FP=
  38. # With the feature additions of Zip 3, the default data segment gets occupied
  39. # with too much initialized data to fit into 64k. As a workaround, for some
  40. # source files with large amount of message strings, -Gt<num> is used to
  41. # force data items of size <num> or larger into their own data segments.
  42. COMMON_CFLAGS=-nologo -I. $(MODEL) $(FP) -DMSC $(LOC) -W3 -G$(CPU_TYP)
  43. CFLAGS=$(COMMON_CFLAGS) -Ox
  44. SPECFLAGS=$(COMMON_CFLAGS) -Oaict -Gs
  45. # For MSC/C++ 7.0 and VC++ no special flags are needed:
  46. # SPECFLAGS=$(CFLAGS)
  47. UTILFLAGS=-DUTIL $(CFLAGS) -Fo
  48. AS=masm
  49. ASFLAGS=-ml -t -D$(ASCPUFLAG) -D$(ASMODEL) $(LOC)
  50. # For MSC 6.0, use:
  51. #AS=ml
  52. #ASFLAGS=-c -D$(ASCPUFLAG) -D$(ASMODEL) $(LOC)
  53. # Supress -DDYN_ALLOC in ASFLAGS if you have suppressed it in CFLAGS
  54. LD=link
  55. LDFLAGS=/noi/farcall/packcode/e/st:0x1400/m
  56. # If you use an exe packer as recommended below, remove /e from LDFLAGS
  57. # ------------- Common declarations:
  58. STRIP=rem
  59. # If you don't have UPX, LZEXE, or PKLITE, get one of them. Then define:
  60. # (NOTE: upx needs a 386 or higher system to run the exe compressor)
  61. #STRIP=upx --8086 --best
  62. # or
  63. #STRIP=lzexe
  64. # or (if you've registered PKLITE)
  65. #STRIP=pklite
  66. # and remove /e from LDFLAGS.
  67. # This makes a big difference in .exe size (and possibly load time)
  68. # ------------- Used by install rule
  69. # set BIN to the directory you want to install the executables to
  70. BIN = c:\util
  71. # variables
  72. OBJZ = zip.obj crypt.obj ttyio.obj zipfile.obj zipup.obj fileio.obj util.obj \
  73. crc32.obj globals.obj
  74. OBJI = deflate.obj trees.obj $(ASMOBJS) msdos.obj
  75. OBJU = zipfile_.obj fileio_.obj util_.obj globals.obj msdos_.obj
  76. OBJN = zipnote.obj $(OBJU)
  77. OBJC = zipcloak.obj crc32_.obj crypt_.obj ttyio.obj $(OBJU)
  78. OBJS = zipsplit.obj $(OBJU)
  79. ZIP_H = zip.h ziperr.h tailor.h msdos/osdep.h
  80. ZIPS = zip.exe zipnote.exe zipsplit.exe zipcloak.exe
  81. zips: $(ZIPS)
  82. zip.obj: zip.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h
  83. $(CC) -c $(CFLAGS) -Gt65 $*.c
  84. # MSC 5.1 generates bad code on zipfile with -Ox
  85. zipfile.obj: zipfile.c $(ZIP_H) crc32.h
  86. $(CC) -c $(SPECFLAGS) $*.c
  87. zipup.obj: zipup.c $(ZIP_H) revision.h crc32.h crypt.h msdos/zipup.h
  88. $(CC) -c $(CFLAGS) $*.c
  89. fileio.obj: fileio.c $(ZIP_H) crc32.h
  90. $(CC) -c $(CFLAGS) $*.c
  91. util.obj: util.c $(ZIP_H)
  92. $(CC) -c $(CFLAGS) $*.c
  93. globals.obj: globals.c $(ZIP_H)
  94. $(CC) -c $(CFLAGS) $*.c
  95. deflate.obj: deflate.c $(ZIP_H)
  96. $(CC) -c $(CFLAGS) $*.c
  97. trees.obj: trees.c $(ZIP_H)
  98. $(CC) -c $(CFLAGS) $*.c
  99. crc32.obj: crc32.c $(ZIP_H) crc32.h
  100. $(CC) -c $(CFLAGS) $*.c
  101. crypt.obj: crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h
  102. $(CC) -c $(CFLAGS) $*.c
  103. ttyio.obj: ttyio.c $(ZIP_H) crypt.h ttyio.h
  104. $(CC) -c $(CFLAGS) $*.c
  105. msdos.obj: msdos/msdos.c $(ZIP_H)
  106. $(CC) -c $(CFLAGS) msdos/$*.c
  107. zipcloak.obj: zipcloak.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h
  108. $(CC) -c $(CFLAGS) $*.c
  109. zipnote.obj: zipnote.c $(ZIP_H) revision.h
  110. $(CC) -c $(CFLAGS) $*.c
  111. # MSC 5.1 dies on zipsplit with -Ox
  112. zipsplit.obj: zipsplit.c $(ZIP_H) revision.h
  113. $(CC) -c $(SPECFLAGS) $*.c
  114. # MSC 5.1 generates bad code on zipfile with -Ox
  115. zipfile_.obj: zipfile.c $(ZIP_H) crc32.h
  116. $(CC) -c $(SPECFLAGS) -DUTIL -Fo$@ zipfile.c
  117. fileio_.obj: fileio.c $(ZIP_H) crc32.h
  118. $(CC) -c $(UTILFLAGS)$@ fileio.c
  119. util_.obj: util.c $(ZIP_H)
  120. $(CC) -c $(UTILFLAGS)$@ util.c
  121. crc32_.obj: crc32.c $(ZIP_H) crc32.h
  122. $(CC) -c $(UTILFLAGS)$@ crc32.c
  123. crypt_.obj: crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h
  124. $(CC) -c $(UTILFLAGS)$@ crypt.c
  125. msdos_.obj: msdos/msdos.c $(ZIP_H)
  126. $(CC) -c $(UTILFLAGS)$@ msdos/msdos.c
  127. crc_i86.obj: msdos/crc_i86.asm
  128. $(AS) $(ASFLAGS) msdos\crc_i86.asm ;
  129. match.obj: msdos/match.asm
  130. $(AS) $(ASFLAGS) msdos\match.asm ;
  131. # we must cut the command line to fit in the MS/DOS 128 byte limit:
  132. zip.exe: $(OBJZ) $(OBJI)
  133. echo $(OBJZ)+ > zip.rsp
  134. echo $(OBJI); >> zip.rsp
  135. $(LD) $(LDFLAGS) @zip.rsp
  136. del zip.rsp
  137. $(STRIP) zip.exe
  138. zipcloak.exe: $(OBJC)
  139. echo $(OBJC); > zipc.rsp
  140. $(LD) $(LDFLAGS) @zipc.rsp
  141. del zipc.rsp
  142. $(STRIP) zipcloak.exe
  143. zipnote.exe: $(OBJN)
  144. echo $(OBJN); > zipn.rsp
  145. $(LD) $(LDFLAGS) @zipn.rsp
  146. del zipn.rsp
  147. $(STRIP) zipnote.exe
  148. zipsplit.exe: $(OBJS)
  149. echo $(OBJS); > zips.rsp
  150. $(LD) $(LDFLAGS) @zips.rsp
  151. del zips.rsp
  152. $(STRIP) zipsplit.exe
  153. # No `install' and `clean' target possible as long as MSC's old MAKE utility
  154. # is supported (MSC 5.1 Make always tries to update ALL targets. The result
  155. # is that install and clean are always executed, unless an error occured.)
  156. #install: $(ZIPS)
  157. # copy /b *.exe $(BIN)
  158. #
  159. #clean:
  160. # del *.obj
  161. # del *.exe