home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / zip21.zip / win32 / makefile.wat < prev    next >
Makefile  |  1996-04-01  |  5KB  |  167 lines

  1. # WMAKE makefile for Windows 95 and Windows NT (Intel only)
  2. # using Watcom C/C++ v10.5, by Paul Kienitz, last revised 19 Jan 96.
  3. # Makes Zip.exe, ZipNote.exe, ZipCloak.exe, and ZipSplit.exe.
  4. #
  5. # Invoke from Zip source dir with "WMAKE -F WIN32\MAKEFILE.WAT [targets]"
  6. # To build with debug info use "WMAKE DEBUG=1 ..."
  7. # To build without any assembly modules use "WMAKE NOASM=1 ..."
  8. #
  9. # Other options to be fed to the compiler can be specified in an environment
  10. # variable called LOCAL_ZIP.  One possibility "-DDYN_ALLOC", but currently
  11. # this is not supported unless NOASM is also used.
  12.  
  13. variation = $(%LOCAL_ZIP)
  14.  
  15. # Stifle annoying "Delete this file?" questions when errors occur:
  16. .ERASE
  17.  
  18. .EXTENSIONS:
  19. .EXTENSIONS: .exe .obj .c .h .asm
  20.  
  21. # We maintain multiple sets of object files in different directories so that
  22. # we can compile msdos, dos/4gw, and win32 versions of Zip without their
  23. # object files interacting.  The following var must be a directory name
  24. # ending with a backslash.  All object file names must include this macro
  25. # at the beginning, for example "$(O)foo.obj".
  26.  
  27. O = ob32w\  # comment here so backslash won't continue the line
  28.  
  29. # The assembly hot-spot code in crc_i386.asm and match32.asm is optional.
  30. # This section controls its usage.
  31.  
  32. !ifdef NOASM
  33. asmob = $(O)crc32.obj           # C source
  34. cvars = $+$(cvars)$- -DNO_ASM   # otherwise ASM_CRC might default on!
  35. # "$+$(foo)$-" means expand foo as it has been defined up to now; normally,
  36. # this make defers inner expansion until the outer macro is expanded.
  37. !else  # !NOASM
  38. asmob = $(O)match32.obj $(O)crc_i386.obj
  39. cvars = $+$(cvars)$- -DASMV -DASM_CRC
  40. !endif
  41.  
  42. # Our object files.  OBJZ is for Zip, OBJC is for ZipCloak, OBJN is for
  43. # ZipNote, and OBJS is for ZipSplit:
  44.  
  45. OBJZ3 = $(O)zip.obj $(O)crypt.obj $(O)ttyio.obj $(O)trees.obj $(O)zipup.obj
  46. OBJZ2 = $(OBJZ3) $(O)util.obj $(O)zipfile.obj $(O)fileio.obj $(O)deflate.obj
  47. OBJZ1 = $(OBJZ2) $(O)globals.obj $(O)bits.obj $(O)crctab.obj $(asmob)
  48. OBJZ  = $(OBJZ1) $(O)win32zip.obj $(O)win32.obj
  49.  
  50. OBJ_U = $(O)zipfile_.obj $(O)fileio_.obj $(O)util_.obj $(O)globals.obj
  51.  
  52. OBJC  = $(O)zipcloak.obj $(O)crctab.obj $(O)crypt_.obj $(O)ttyio.obj $(OBJ_U)
  53.  
  54. OBJN  = $(O)zipnote.obj $(OBJ_U)
  55.  
  56. OBJS  = $(O)zipsplit.obj $(OBJ_U)
  57.  
  58. # Common header files included by all C sources:
  59.  
  60. ZIP_H = zip.h ziperr.h tailor.h win32\osdep.h
  61.  
  62. # Now we have to pick out the proper compiler and options for it.
  63.  
  64. cc     = wcc386
  65. link   = wlink
  66. asm    = wasm
  67. # Use Pentium timings, register args, static strings in code:
  68. cflags = -bt=NT -5r -zt -zq
  69. aflags = -bt=NT -mf -3 -zq
  70. lflags = sys NT
  71. cvars  = $+$(cvars)$- -DWIN32 $(variation)
  72. avars  = $+$(avars)$- $(variation)
  73.  
  74. # Specify optimizations, or a nonoptimized debugging version:
  75.  
  76. !ifdef DEBUG
  77. cdebug = -od -d2
  78. ldebug = d w all op symf
  79. !else
  80. cdebug = -s -oeilrt -zp4
  81. # note: -ol+ does not help.  -oa helps slightly but might be dangerous.
  82. ldebug = op el
  83. !endif
  84.  
  85. # How to compile sources:
  86. .c.obj:
  87.     $(cc) $(cdebug) $(cflags) $(cvars) $< -fo=$@
  88.  
  89. # Here we go!  By default, make all targets:
  90. all: Zip.exe ZipNote.exe ZipCloak.exe ZipSplit.exe
  91.  
  92. # Convenient shorthand options for single targets:
  93. z:   Zip.exe       .SYMBOLIC
  94. n:   ZipNote.exe   .SYMBOLIC
  95. c:   ZipCloak.exe  .SYMBOLIC
  96. s:   ZipSplit.exe  .SYMBOLIC
  97.  
  98. Zip.exe:    $(OBJZ)
  99.     $(link) $(lflags) $(ldebug) name $@ file {$(OBJZ)}
  100.  
  101. ZipNote.exe:    $(OBJN)
  102.     $(link) $(lflags) $(ldebug) name $@ file {$(OBJN)}
  103.  
  104. ZipCloak.exe:    $(OBJC)
  105.     $(link) $(lflags) $(ldebug) name $@ file {$(OBJC)}
  106.  
  107. ZipSplit.exe:    $(OBJS)
  108.     $(link) $(lflags) $(ldebug) name $@ file {$(OBJS)}
  109.  
  110. # Source dependencies:
  111.  
  112. $(O)bits.obj:     bits.c $(ZIP_H) crypt.h
  113. $(O)crctab.obj:   crctab.c $(ZIP_H)
  114. $(O)crc32.obj:    crc32.c $(ZIP_H)          # only used if NOASM
  115. $(O)crypt.obj:    crypt.c $(ZIP_H) crypt.h ttyio.h
  116. $(O)deflate.obj:  deflate.c $(ZIP_H)
  117. $(O)fileio.obj:   fileio.c $(ZIP_H)
  118. $(O)globals.obj:  globals.c $(ZIP_H)
  119. $(O)trees.obj:    trees.c $(ZIP_H)
  120. $(O)ttyio.obj:    ttyio.c $(ZIP_H) crypt.h ttyio.h
  121. $(O)util.obj:     util.c $(ZIP_H)
  122. $(O)zip.obj:      zip.c $(ZIP_H) crypt.h revision.h ttyio.h
  123. $(O)zipfile.obj:  zipfile.c $(ZIP_H)
  124. $(O)zipup.obj:    zipup.c $(ZIP_H) revision.h crypt.h win32\zipup.h
  125. $(O)zipnote.obj:  zipnote.c $(ZIP_H) revision.h
  126. $(O)zipcloak.obj: zipcloak.c $(ZIP_H) revision.h crypt.h ttyio.h
  127. $(O)zipsplit.obj: zipsplit.c $(ZIP_H) revision.h
  128.  
  129. # Special case object files:
  130.  
  131. $(O)win32.obj:    win32\win32.c $(ZIP_H) win32\win32zip.h
  132.     $(cc) $(cdebug) $(cflags) $(cvars) win32\win32.c -fo=$@
  133.  
  134. $(O)win32zip.obj: win32\win32zip.c $(ZIP_H) win32\win32zip.h
  135.     $(cc) $(cdebug) $(cflags) $(cvars) win32\win32zip.c -fo=$@
  136.  
  137. $(O)match32.obj:  win32\match32.asm
  138.     $(asm) $(aflags) $(avars) win32\match32.asm -fo=$@
  139.  
  140. $(O)crc_i386.obj: win32\crc_i386.asm
  141.     $(asm) $(aflags) $(avars) win32\crc_i386.asm -fo=$@
  142.  
  143. # Variant object files for ZipNote, ZipCloak, and ZipSplit:
  144.  
  145. $(O)zipfile_.obj: zipfile.c $(ZIP_H)
  146.     $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL zipfile.c -fo=$@
  147.  
  148. $(O)fileio_.obj:  fileio.c $(ZIP_H)
  149.     $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL fileio.c -fo=$@
  150.  
  151. $(O)util_.obj:    util.c $(ZIP_H)
  152.     $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL util.c -fo=$@
  153.  
  154. $(O)crypt_.obj:   crypt.c $(ZIP_H) crypt.h ttyio.h
  155.     $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL crypt.c -fo=$@
  156.  
  157. # Unwanted file removal:
  158.  
  159. clean:     .SYMBOLIC
  160.     del $(O)*.obj
  161.  
  162. cleaner:   clean  .SYMBOLIC
  163.     del Zip.exe
  164.     del ZipNote.exe
  165.     del ZipCloak.exe
  166.     del ZipSplit.exe
  167.