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

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