home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / zip22.zip / vms / makefile.vms < prev    next >
Makefile  |  1997-07-25  |  8KB  |  251 lines

  1. #============================================================================
  2. # Makefile for VMS Zip, ZipCloak, ZipNote  and ZipSplit          Greg Roelofs
  3. # Version:  2.0 [for use with Todd Aven's MAKE/VMS 3.4]          25-JUL-1997
  4. #============================================================================
  5.  
  6. # ChangeLog:  10-SEP-1993 08:53 by Hunter Goatley (add AXP support)
  7. #             15-OCT-1995 22:40 by Chr. Spieler (Zip 2.1)
  8. #             11-DEC-1995 12:09 by Chr. Spieler (AXP uses RELAXED_ANSI mode)
  9. #             08-JAN-1996 19:08 by Chr. Spieler (updated header dependencies)
  10. #             16-JAN-1996 19:08 by Chr. Spieler (crypt -> crypt & ttyio)
  11. #             25-JUL-1997 22:25 by Chr. Spieler (syncronized with descrip.mms)
  12.  
  13.  
  14. ########################### USER CUSTOMIZATION ############################
  15. # add any optional preprocessor flags (macros) to the following line
  16. # for a custom version (do not forget a trailing comma##):
  17. COMMON_DEFS =
  18. ######################## END OF USER CUSTOMIZATION ########################
  19.  
  20. #####################
  21. # MACRO DEFINITIONS #
  22. #####################
  23.  
  24. CFLAGS = /NOLIST/INCL=(SYS$DISK:[])
  25. CC = cc
  26. LIB =
  27. # Define the macro __GNUC__ to use the GNU compiler (also add /undef=__STDC__
  28. # to CFLAGS, and possibly replace /obj=$@ [below] with copy/rename/delete
  29. # setup).  NOT TESTED.
  30.  
  31. OPTFILE = sys$disk:[.vms]vaxcshr.opt
  32.  
  33. %IFDEF __ALPHA
  34. CC = CC/STANDARD=RELAX/PREFIX=ALL/ANSI
  35. E = .AXP_EXE
  36. O = .AXP_OBJ
  37. OPTFILE_LIST =
  38. OPTIONS =
  39. %ELSE
  40. %IFDEF __DECC__
  41. CC = CC/DECC/STANDARD=VAXC/PREFIX=ALL
  42. E = .VAX_DECC_exe
  43. O = .VAX_DECC_obj
  44. OPTFILE_LIST =
  45. OPTIONS =
  46. %ELSE
  47. %IFDEF __GNUC__
  48. CC = gcc
  49. E = .VAX_GNUC_exe
  50. O = .VAX_GNUC_obj
  51. LIB = gnu_cc:[000000]gcclib.olb/lib,
  52. %ELSE
  53. E = .VAX_VAXC_exe
  54. O = .VAX_VAXC_obj
  55. %ENDIF
  56. OPTFILE_LIST = ,$(OPTFILE)
  57. OPTIONS = ,$(OPTFILE)/OPTIONS
  58. %ENDIF
  59. %ENDIF
  60.  
  61. CFLAGS_ALL  = $(CFLAGS) /def=($(COMMON_DEFS) VMS)
  62. CFLAGS_CLI  = $(CFLAGS) /def=($(COMMON_DEFS) VMSCLI, VMS)
  63. CFLAGS_UTIL = $(CFLAGS) /def=($(COMMON_DEFS) UTIL, VMS)
  64. LD = LINK
  65. LDFLAGS = /NOTRACE
  66.  
  67. # object file lists
  68. OBJM =    zip$O, zipcli$O
  69. OBJZ =    crc32$O, crctab$O, crypt$O, ttyio$O,-
  70.     zipfile$O, zipup$O, fileio$O, globals$O, util$O
  71. OBJV =    vmszip$O, vms$O, vmsmunch$O
  72. OBJI =    deflate$O, trees$O, bits$O
  73. OBJU =    zipfile_$O, fileio_$O, globals$O,-
  74.     util_$O, vms_$O, vmsmunch$O
  75. OBJR =  crctab$O, crypt_$O, ttyio$O
  76. OBJC =    zipcloak$O, $(OBJR), $(OBJU)
  77. OBJN =    zipnote$O, $(OBJU)
  78. OBJS =    zipsplit$O, $(OBJU)
  79.  
  80. ZIPX_UNX = zip
  81. ZIPX_CLI = zip_cli
  82. OBJSZIPLIB = $(OBJZ), $(OBJI), $(OBJV)
  83. OBJSZIP = zip$O, $(OBJSZIPLIB)
  84. OBJSCLI = zipcli$O, zip_cli$O, cmdline$O
  85. OBJSZIP_CLI = $(OBJSCLI), $(OBJSZIPLIB)
  86. ZIPHELP_UNX_RNH = [.vms]vms_zip.rnh
  87. ZIPHELP_CLI_RNH = [.vms]zip_cli.rnh
  88.  
  89. ZIP_H =    zip.h ziperr.h tailor.h [.vms]osdep.h
  90.  
  91. ZIPS = $(ZIPX_UNX)$E $(ZIPX_CLI)$E zipcloak$E zipnote$E zipsplit$E
  92. ZIPHELPS = $(ZIPX_UNX).hlp $(ZIPX_CLI).hlp
  93.  
  94. ###############################################
  95. # BASIC COMPILE INSTRUCTIONS AND DEPENDENCIES #
  96. ###############################################
  97.  
  98. default :    $(ZIPS) $(ZIPHELPS)
  99.  
  100.  
  101. # suffix rules
  102. *$O:    *.c                # `*.c' necessary?
  103.     $(CC)$(CFLAGS_ALL)/OBJECT=$@ $<
  104.  
  105. *.hlp:    *.rnh
  106.     runoff /out=$@ $<
  107.  
  108.  
  109. # executables makerules (trailing `$' makes line a data line)
  110. $(ZIPX_UNX)$E :    $(OBJSZIP) $(OPTFILE_LIST)
  111.     $(LD) $(LDFLAGS)/EXEC=$(ZIPX_UNX)$E $(OBJSZIP) $(LIB) $(OPTIONS)
  112.  
  113. $(ZIPX_CLI)$E :    $(OBJSZIP_CLI) $(OPTFILE_LIST)
  114.     $(LD) $(LDFLAGS)/EXEC=$(ZIPX_CLI)$E $(OBJSZIP_CLI) $(LIB) $(OPTIONS)
  115.  
  116. zipcloak$E :    $(OBJC) $(OPTFILE_LIST)
  117.     $(LD) $(LDFLAGS)/EXEC=ZIPCLOAK$E $(OBJC) $(LIB) $(OPTIONS)
  118.  
  119. zipnote$E :    $(OBJN) $(OPTFILE_LIST)
  120.     $(LD) $(LDFLAGS)/EXEC=ZIPNOTE$E $(OBJN) $(LIB) $(OPTIONS)
  121.  
  122. zipsplit$E :    $(OBJS) $(OPTFILE_LIST)
  123.     $(LD) $(LDFLAGS)/EXEC=ZIPSPLIT$E $(OBJS) $(LIB) $(OPTIONS)
  124.  
  125. $(OPTFILE) :
  126.     open/write tmp $(OPTFILE)
  127.     write tmp "SYS$SHARE:VAXCRTL.EXE/SHARE"
  128.     close tmp
  129.  
  130. $(ZIPHELP_CLI_RNH)    : [.vms]zip_cli.help
  131.     set default [.vms]
  132.     edit/tpu/nosection/nodisplay/command=cvthelp.tpu zip_cli.help
  133.     set default [-]
  134.  
  135. $(ZIPX_UNX).hlp : $(ZIPHELP_UNX_RNH)
  136.     runoff /out=$@ $<
  137.  
  138. $(ZIPX_CLI).hlp : $(ZIPHELP_CLI_RNH)
  139.  
  140. # dependencies for zip, zipnote, zipcloak, and zipsplit
  141. vmszip$O :    [.vms]vmszip.c [.vms]vmsmunch.h
  142.     $(CC)$(CFLAGS_ALL)/OBJECT=vmszip$O [.vms]vmszip.c
  143. vms$O :        [.vms]vms.c [.vms]vms_im.c [.vms]vms_pk.c \
  144.     [.vms]vms.h [.vms]vmsdefs.h
  145.     $(CC)$(CFLAGS_ALL)/OBJECT=vms$O [.vms]vms.c
  146. vmsmunch$O :    [.vms]vmsmunch.c [.vms]vmsmunch.h [.vms]vmsdefs.h
  147.     $(CC)$(CFLAGS_ALL)/OBJECT=vmsmunch$O [.vms]vmsmunch.c
  148. zipcli$O : zip.c [.vms]vmsmunch.h
  149.     $(CC) $(CFLAGS_CLI) /OBJ=$(MMS$TARGET) $<
  150. cmdline$O : [.vms]cmdline.c $(ZIP_H) crypt.h revision.h
  151.     $(CC) $(CFLAGS_CLI) /OBJ=$(MMS$TARGET) $<
  152. zip_cli$O : [.vms]zip_cli.cld
  153.  
  154. crypt_$O :    crypt.c crypt.h ttyio.h
  155.     $(CC)$(CFLAGS_UTIL)/OBJECT=crypt_$O crypt.c
  156. zipfile_$O :    zipfile.c [.vms]vmsmunch.h [.vms]vmsdefs.h
  157.     $(CC)$(CFLAGS_UTIL)/OBJECT=zipfile_$O zipfile.c
  158. fileio_$O :    fileio.c
  159.     $(CC)$(CFLAGS_UTIL)/OBJECT=fileio_$O fileio.c
  160. util_$O :    util.c
  161.     $(CC)$(CFLAGS_UTIL)/OBJECT=util_$O util.c
  162. vms_$O :    [.vms]vms.c [.vms]vms_im.c [.vms]vms_pk.c \
  163.     [.vms]vms.h [.vms]vmsdefs.h
  164.     $(CC)$(CFLAGS_UTIL)/OBJECT=vms_$O [.vms]vms.c
  165.  
  166. $(OBJM) zipcloak$O zipnote$O zipsplit$O zipup$O : revision.h
  167. $(OBJM) zipcloak$O zipup$O bits$O crypt$O ttyio$O : crypt.h
  168. $(OBJM) zipcloak$O crypt$O ttyio$O : ttyio.h
  169. zipup$O :    [.vms]zipup.h
  170. zipfile$O :    [.vms]vmsmunch.h [.vms]vmsdefs.h
  171. zip$O :        [.vms]vmsmunch.h
  172. $(OBJM) :    $(ZIP_H)
  173. $(OBJZ) :    $(ZIP_H)
  174. $(OBJI) :    $(ZIP_H)
  175. $(OBJN) :    $(ZIP_H)
  176. $(OBJS) :    $(ZIP_H)
  177. $(OBJC) :    $(ZIP_H)
  178.  
  179. clean.com :
  180.     @ open/write tmp $@
  181.     @ write tmp "$!"
  182.     @ write tmp "$!    Clean.com --    procedure to delete files. It always returns success"
  183.     @ write tmp "$!            status despite any error or warnings. Also it extracts"
  184.     @ write tmp "$!            filename from MMS ""module=file"" format."
  185.     @ write tmp "$!"
  186.     @ write tmp "$ on control_y then goto ctly"
  187.     @ write tmp "$ if p1.eqs."""" then exit 1"
  188.     @ write tmp "$ i = -1"
  189.     @ write tmp "$scan_list:"
  190.     @ write tmp "$    i = i+1"
  191.     @ write tmp "$    item = f$elem(i,"","",p1)"
  192.     @ write tmp "$    if item.eqs."""" then goto scan_list"
  193.     @ write tmp "$    if item.eqs."","" then goto done        ! End of list"
  194.     @ write tmp "$    item = f$edit(item,""trim"")        ! Clean of blanks"
  195.     @ write tmp "$    wild = f$elem(1,""="",item)"
  196.     @ write tmp "$    show sym wild"
  197.     @ write tmp "$    if wild.eqs.""="" then wild = f$elem(0,""="",item)"
  198.     @ write tmp "$    vers = f$parse(wild,,,""version"",""syntax_only"")"
  199.     @ write tmp "$    if vers.eqs."";"" then wild = wild - "";"" + "";*"""
  200.     @ write tmp "$scan:"
  201.     @ write tmp "$        f = f$search(wild)"
  202.     @ write tmp "$        if f.eqs."""" then goto scan_list"
  203.     @ write tmp "$        on error then goto err"
  204.     @ write tmp "$        on warning then goto warn"
  205.     @ write tmp "$        delete/log 'f'"
  206.     @ write tmp "$warn:"
  207.     @ write tmp "$err:"
  208.     @ write tmp "$        goto scan"
  209.     @ write tmp "$done:"
  210.     @ write tmp "$ctly:"
  211.     @ write tmp "$    exit 1"
  212.     @ close tmp
  213.  
  214. clean : clean.com
  215.     @clean "$(OBJM)"
  216.     @clean "$(OBJZ)"
  217.     @clean "$(OBJI)"
  218.     @clean "$(OBJV)"
  219.     @clean "$(OBJU)"
  220.     @clean "$(OBJR)"
  221.     @clean "$(OBJN)"
  222.     @clean "$(OBJS)"
  223.     @clean "$(OBJC)"
  224.     @clean "$(ZIPS)"
  225.     @clean "$(ZIPHELP_CLI_RNH)"
  226.     @clean "$(ZIPHELPS)"
  227.     - delete/noconfirm/nolog clean.com;*
  228.  
  229.  
  230. # the backslash '\' is the continuation character if it occurs as
  231. # the last non-white character on the line.
  232. # the hyphen '-' is the DCL continuation character, so if it occurs
  233. # as the last non-white character on the line, the next line will
  234. # not have the dollar sign '$' prepended.
  235.  
  236.  
  237. ################################
  238. # INDIVIDUAL MACHINE MAKERULES #
  239. ################################
  240.  
  241. generic :    default        # first try if unknown
  242. generic2 :    default        # second try if unknown
  243. vax :        default
  244. vms :        default
  245.  
  246. all :        $(ZIPS)
  247. zip :        zip$E
  248. zipcloak :    zipcloak$E
  249. zipnote :    zipnote$E
  250. zipsplit :    zipsplit$E
  251.