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

  1. # WMAKE makefile for Windows 95 and Windows NT (Intel only)
  2. # using Watcom C/C++ v10.5+, by Paul Kienitz, last revised 16 July 97.
  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. !ifdef DEBUG
  28. O = od32w\  # comment here so backslash won't continue the line
  29. !else
  30. O = ob32w\  # likewise
  31. !endif
  32.  
  33. # The assembly hot-spot code in crc_i386.asm and match32.asm is optional.
  34. # This section controls its usage.
  35.  
  36. !ifdef NOASM
  37. asmob = $(O)crc32.obj           # C source
  38. cvars = $+$(cvars)$- -DNO_ASM   # otherwise ASM_CRC might default on!
  39. # "$+$(foo)$-" means expand foo as it has been defined up to now; normally,
  40. # this make defers inner expansion until the outer macro is expanded.
  41. !else  # !NOASM
  42. asmob = $(O)match32.obj $(O)crc_i386.obj
  43. cvars = $+$(cvars)$- -DASMV -DASM_CRC
  44. !endif
  45.  
  46. # Our object files.  OBJZ is for Zip, OBJC is for ZipCloak, OBJN is for
  47. # ZipNote, and OBJS is for ZipSplit:
  48.  
  49. OBJZ3 = $(O)zip.obj $(O)crypt.obj $(O)ttyio.obj $(O)trees.obj $(O)zipup.obj
  50. OBJZ2 = $(OBJZ3) $(O)util.obj $(O)zipfile.obj $(O)fileio.obj $(O)deflate.obj
  51. OBJZ1 = $(OBJZ2) $(O)globals.obj $(O)bits.obj $(O)crctab.obj $(asmob)
  52. OBJZ  = $(OBJZ1) $(O)win32zip.obj $(O)win32.obj $(O)nt.obj
  53.  
  54. OBJU2 = $(O)zipfile_.obj $(O)fileio_.obj $(O)util_.obj $(O)globals.obj
  55. OBJ_U = $(OBJU2) $(O)win32_.obj
  56.  
  57. OBJC  = $(O)zipcloak.obj $(O)crctab.obj $(O)crypt_.obj $(O)ttyio.obj $(OBJ_U)
  58.  
  59. OBJN  = $(O)zipnote.obj $(OBJ_U)
  60.  
  61. OBJS  = $(O)zipsplit.obj $(OBJ_U)
  62.  
  63. # Common header files included by all C sources:
  64.  
  65. ZIP_H = zip.h ziperr.h tailor.h win32\osdep.h
  66.  
  67. # Now we have to pick out the proper compiler and options for it.
  68.  
  69. cc     = wcc386
  70. link   = wlink
  71. asm    = wasm
  72. # Use Pentium timings, register args, static strings in code:
  73. cflags = -bt=NT -5r -zt -zq
  74. aflags = -bt=NT -mf -3 -zq
  75. lflags = sys NT
  76. cvars  = $+$(cvars)$- -DWIN32 $(variation)
  77. avars  = $+$(avars)$- $(variation)
  78.  
  79. # Specify optimizations, or a nonoptimized debugging version:
  80.  
  81. !ifdef DEBUG
  82. cdebug = -od -d2
  83. ldebug = d w all op symf
  84. !else
  85. cdebug = -s -oeilrt -zp4
  86. # note: -ol+ does not help.  -oa helps slightly but might be dangerous.
  87. ldebug = op el
  88. !endif
  89.  
  90. # How to compile sources:
  91. .c.obj:
  92.     $(cc) $(cdebug) $(cflags) $(cvars) $< -fo=$@
  93.  
  94. # Here we go!  By default, make all targets:
  95. all: Zip.exe ZipNote.exe ZipCloak.exe ZipSplit.exe
  96.  
  97. # Convenient shorthand options for single targets:
  98. z:   Zip.exe       .SYMBOLIC
  99. n:   ZipNote.exe   .SYMBOLIC
  100. c:   ZipCloak.exe  .SYMBOLIC
  101. s:   ZipSplit.exe  .SYMBOLIC
  102.  
  103. Zip.exe:    $(OBJZ)
  104.     $(link) $(lflags) $(ldebug) name $@ file {$(OBJZ)}
  105.  
  106. ZipNote.exe:    $(OBJN)
  107.     $(link) $(lflags) $(ldebug) name $@ file {$(OBJN)}
  108.  
  109. ZipCloak.exe:    $(OBJC)
  110.     $(link) $(lflags) $(ldebug) name $@ file {$(OBJC)}
  111.  
  112. ZipSplit.exe:    $(OBJS)
  113.     $(link) $(lflags) $(ldebug) name $@ file {$(OBJS)}
  114.  
  115. # Source dependencies:
  116.  
  117. $(O)bits.obj:     bits.c $(ZIP_H) crypt.h
  118. $(O)crctab.obj:   crctab.c $(ZIP_H)
  119. $(O)crc32.obj:    crc32.c $(ZIP_H)          # only used if NOASM
  120. $(O)crypt.obj:    crypt.c $(ZIP_H) crypt.h ttyio.h
  121. $(O)deflate.obj:  deflate.c $(ZIP_H)
  122. $(O)fileio.obj:   fileio.c $(ZIP_H)
  123. $(O)globals.obj:  globals.c $(ZIP_H)
  124. $(O)trees.obj:    trees.c $(ZIP_H)
  125. $(O)ttyio.obj:    ttyio.c $(ZIP_H) crypt.h ttyio.h
  126. $(O)util.obj:     util.c $(ZIP_H)
  127. $(O)zip.obj:      zip.c $(ZIP_H) crypt.h revision.h ttyio.h
  128. $(O)zipfile.obj:  zipfile.c $(ZIP_H)
  129. $(O)zipup.obj:    zipup.c $(ZIP_H) revision.h crypt.h win32\zipup.h
  130. $(O)zipnote.obj:  zipnote.c $(ZIP_H) revision.h
  131. $(O)zipcloak.obj: zipcloak.c $(ZIP_H) revision.h crypt.h ttyio.h
  132. $(O)zipsplit.obj: zipsplit.c $(ZIP_H) revision.h
  133.  
  134. # Special case object files:
  135.  
  136. $(O)win32.obj:    win32\win32.c $(ZIP_H) win32\win32zip.h
  137.     $(cc) $(cdebug) $(cflags) $(cvars) win32\win32.c -fo=$@
  138.  
  139. $(O)win32zip.obj: win32\win32zip.c $(ZIP_H) win32\win32zip.h win32\nt.h
  140.     $(cc) $(cdebug) $(cflags) $(cvars) win32\win32zip.c -fo=$@
  141.  
  142. $(O)nt.obj:       win32\nt.c $(ZIP_H) win32\nt.h
  143.     $(cc) $(cdebug) $(cflags) $(cvars) win32\nt.c -fo=$@
  144.  
  145. $(O)match32.obj:  win32\match32.asm
  146.     $(asm) $(aflags) $(avars) win32\match32.asm -fo=$@
  147.  
  148. $(O)crc_i386.obj: win32\crc_i386.asm
  149.     $(asm) $(aflags) $(avars) win32\crc_i386.asm -fo=$@
  150.  
  151. # Variant object files for ZipNote, ZipCloak, and ZipSplit:
  152.  
  153. $(O)zipfile_.obj: zipfile.c $(ZIP_H)
  154.     $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL zipfile.c -fo=$@
  155.  
  156. $(O)fileio_.obj:  fileio.c $(ZIP_H)
  157.     $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL fileio.c -fo=$@
  158.  
  159. $(O)util_.obj:    util.c $(ZIP_H)
  160.     $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL util.c -fo=$@
  161.  
  162. $(O)crypt_.obj:   crypt.c $(ZIP_H) crypt.h ttyio.h
  163.     $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL crypt.c -fo=$@
  164.  
  165. $(O)win32_.obj:   win32\win32.c $(ZIP_H) win32\win32zip.h
  166.     $(cc) $(cdebug) $(cflags) $(cvars) -DUTIL win32\win32.c -fo=$@
  167.  
  168. # Unwanted file removal:
  169.  
  170. clean:     .SYMBOLIC
  171.     del $(O)*.obj
  172.  
  173. cleaner:   clean  .SYMBOLIC
  174.     del Zip.exe
  175.     del ZipNote.exe
  176.     del ZipCloak.exe
  177.     del ZipSplit.exe
  178.