makefile.tc 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. # Makefile for Zip, ZipCloak, ZipNote and ZipSplit for
  2. # Turbo C 2.0. (Thanks to Andrew Cadach <kadach@isi.itfs.nsk.su>)
  3. # To use, do "make -fmakefile.tc"
  4. # WARNING: the small model is not supported. You must use the large model.
  5. # Add -DSMALL_MEM or -DMEDIUM_MEM to the LOC macro if you wish to reduce
  6. # the memory requirements.
  7. # Add -DNO_ASM to CFLAGS and comment out the ASMOBJS definition if
  8. # you do not have tasm.
  9. # Optional nonstandard preprocessor flags (as -DMEDIUM_MEM or -DNO_ASM)
  10. # should be added to the environment via "set LOCAL_ZIP=-DFOO" or added
  11. # to the declaration of LOC here:
  12. LOC = -DDOS -DNO_SECURE_TESTS $(LOCAL_ZIP)
  13. # Zip requires compact or large memory model.
  14. # with 2.1, compact model exceeds 64k code segment; use large model
  15. ZIPMODEL=l # large model for Zip and ZipUtils
  16. # name of Flag to select memory model for assembler compiles, supported
  17. # values are __SMALL__ , __MEDIUM__ , __COMPACT__ , __LARGE__ :
  18. ASMODEL=__LARGE__ # keep in sync with ZIPMODEL definition !!
  19. # Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc.
  20. CPU_TYP = 0
  21. # Uncomment the following macro to use the optimized assembler
  22. # routines in Zip:
  23. ASMOBJS = match.obj crc_i86.obj
  24. ASCPUFLAG = __$(CPU_TYP)86
  25. # ------------- Turbo C 2.0 -------------
  26. MODEL=-m$(ZIPMODEL)
  27. CFLAGS=-w -w-eff -w-def -w-sig -w-cln -a -d -G -O -Z $(MODEL) $(LOC)
  28. UTILFLAGS=-DUTIL $(CFLAGS) -o
  29. CC=tcc
  30. # Old versions of tasm (prior to 2.01) may not like the "-m2" option...
  31. AS=tasm
  32. ASFLAGS=-ml -t -m2 -DDYN_ALLOC -DSS_NEQ_DS -D$(ASCPUFLAG) -D$(ASMODEL) $(LOC)
  33. LD=tcc
  34. LDFLAGS=$(MODEL)
  35. # ------------- Common declarations:
  36. STRIP=rem
  37. # If you don't have UPX, LZEXE, or PKLITE, get one of them. Then define:
  38. # (NOTE: upx needs a 386 or higher system to run the exe compressor)
  39. #STRIP=upx --8086 --best
  40. # or
  41. #STRIP=lzexe
  42. # or (if you've registered PKLITE)
  43. #STRIP=pklite
  44. # This makes a big difference in .exe size (and possibly load time)
  45. # ------------- Used by install rule
  46. # set BIN to the directory you want to install the executables to
  47. BIN = c:\util
  48. # variables
  49. OBJZ = zip.obj crypt.obj ttyio.obj zipfile.obj zipup.obj fileio.obj util.obj \
  50. crc32.obj globals.obj
  51. OBJI = deflate.obj trees.obj $(ASMOBJS) msdos.obj
  52. OBJU = _zipfile.obj _fileio.obj _util.obj globals.obj _msdos.obj
  53. OBJN = zipnote.obj $(OBJU)
  54. OBJC = zipcloak.obj _crc32.obj _crypt.obj ttyio.obj $(OBJU)
  55. OBJS = zipsplit.obj $(OBJU)
  56. ZIP_H = zip.h ziperr.h tailor.h msdos/osdep.h
  57. ZIPS = zip.exe zipnote.exe zipsplit.exe zipcloak.exe
  58. zips: $(ZIPS)
  59. zip.obj: zip.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h
  60. $(CC) -c $(CFLAGS) $*.c
  61. zipfile.obj: zipfile.c $(ZIP_H) crc32.h
  62. $(CC) -c $(CFLAGS) $*.c
  63. zipup.obj: zipup.c $(ZIP_H) revision.h crc32.h crypt.h msdos/zipup.h
  64. $(CC) -c $(CFLAGS) $*.c
  65. fileio.obj: fileio.c $(ZIP_H) crc32.h
  66. $(CC) -c $(CFLAGS) $*.c
  67. util.obj: util.c $(ZIP_H)
  68. $(CC) -c $(CFLAGS) $*.c
  69. globals.obj: globals.c $(ZIP_H)
  70. $(CC) -c $(CFLAGS) $*.c
  71. deflate.obj: deflate.c $(ZIP_H)
  72. $(CC) -c $(CFLAGS) $*.c
  73. trees.obj: trees.c $(ZIP_H)
  74. $(CC) -c $(CFLAGS) $*.c
  75. crc32.obj: crc32.c $(ZIP_H) crc32.h
  76. $(CC) -c $(CFLAGS) $*.c
  77. crypt.obj: crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h
  78. $(CC) -c $(CFLAGS) $*.c
  79. ttyio.obj: ttyio.c $(ZIP_H) crypt.h ttyio.h
  80. $(CC) -c $(CFLAGS) $*.c
  81. msdos.obj: msdos/msdos.c $(ZIP_H)
  82. $(CC) -c $(CFLAGS) msdos/$*.c
  83. zipcloak.obj: zipcloak.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h
  84. $(CC) -c $(CFLAGS) -o$* $*.c
  85. zipnote.obj: zipnote.c $(ZIP_H) revision.h
  86. $(CC) -c $(CFLAGS) -o$* $*.c
  87. zipsplit.obj: zipsplit.c $(ZIP_H) revision.h
  88. $(CC) -c $(CFLAGS) -o$* $*.c
  89. _zipfile.obj: zipfile.c $(ZIP_H) crc32.h
  90. $(CC) -c $(UTILFLAGS)$* zipfile.c
  91. _fileio.obj: fileio.c $(ZIP_H) crc32.h
  92. $(CC) -c $(UTILFLAGS)$* fileio.c
  93. _util.obj: util.c $(ZIP_H)
  94. $(CC) -c $(UTILFLAGS)$* util.c
  95. _crc32.obj: crc32.c $(ZIP_H) crc32.h
  96. $(CC) -c $(UTILFLAGS)$* crc32.c
  97. _crypt.obj: crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h
  98. $(CC) -c $(UTILFLAGS)$* crypt.c
  99. _msdos.obj: msdos/msdos.c $(ZIP_H)
  100. $(CC) -c $(UTILFLAGS)$* msdos/msdos.c
  101. crc_i86.obj: msdos/crc_i86.asm
  102. $(AS) $(ASFLAGS) msdos\crc_i86.asm ;
  103. match.obj: msdos/match.asm
  104. $(AS) $(ASFLAGS) msdos\match.asm ;
  105. # make sure the command line fits in the MS/DOS 128 byte limit:
  106. zip.exe: $(OBJZ) $(OBJI)
  107. rem ignore any warnings in the following renaming commands:
  108. ren _*.obj _*.ob
  109. ren zipcloak.obj *.ob
  110. ren zipnote.obj *.ob
  111. ren zipsplit.obj *.ob
  112. $(LD) $(LDFLAGS) -ezip.exe *.obj
  113. ren _*.ob _*.obj
  114. ren zip???*.ob *.obj
  115. $(STRIP) zip.exe
  116. zipcloak.exe: $(OBJC)
  117. $(LD) $(LDFLAGS) -ezipcloak.exe $(OBJC)
  118. $(STRIP) zipcloak.exe
  119. zipnote.exe: $(OBJN)
  120. $(LD) $(LDFLAGS) -ezipnote.exe $(OBJN)
  121. $(STRIP) zipnote.exe
  122. zipsplit.exe: $(OBJS)
  123. $(LD) $(LDFLAGS) -ezipsplit.exe $(OBJS)
  124. $(STRIP) zipsplit.exe
  125. install: $(ZIPS)
  126. copy /b *.exe $(BIN)
  127. clean:
  128. del *.obj
  129. del *.exe