home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / zip22.zip / msdos / makefile.tc < prev    next >
Makefile  |  1997-07-20  |  5KB  |  174 lines

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