home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gnuawk.zip / vms / descrip.mms < prev    next >
Text File  |  1997-04-15  |  9KB  |  254 lines

  1. # Descrip.MMS -- Makefile for building GNU awk on VMS.
  2. #
  3. # usage:
  4. #  $ MMS /Description=[.vms]Descrip.MMS gawk
  5. #    possibly add `/Macro=(GNUC)' to compile with GNU C,
  6. #    or add `/Macro=(GNUC,DO_GNUC_SETUP)' to compile with GNU C on
  7. #    a system where GCC is not installed as a defined command,
  8. #    or add `/Macro=(VAXC)' to compile with VAX C,
  9. #    or add `/Macro=(VAXC,"CC=cc/VAXC")' to compile with VAX C on
  10. #    a system which has DEC C installed as the default compiler.
  11. #
  12. # gawk.exe :
  13. #    This is the default target.  DEC C has become the default compiler.
  14. #
  15. # awktab.c :
  16. #    If you don't have bison but do have VMS POSIX or DEC/Shell,
  17. #    change the PARSER and PASERINIT macros to use yacc.  If you don't
  18. #    have either yacc or bison, you'll have to make sure that the
  19. #    distributed version of "awktab.c" has its modification date later
  20. #    than the date of "awk.y", so that MMS won't try to build that
  21. #    target.  If you use bison and it is already defined system-wide,
  22. #    comment out the PARSERINIT definition.
  23. #
  24. # install.help :
  25. #    You can make the target 'install.help' to load the VMS help text
  26. #    into a help library.  Modify the HELPLIB macro if you don't want
  27. #    to put entry into the regular VMS library.  (If you use an alternate
  28. #    help library, it must already exist; this target won't create it.)
  29. #
  30. # gawk.dvi :
  31. #    If you have TeX, you can make the target 'gawk.dvi' to process
  32. #    _The_GAWK_Manual_ from gawk.texi.  You'll need to use a device
  33. #    specific post-processor on gawk.dvi in order to get printable data.
  34. #    The full output is approximately 325 pages.
  35. #
  36.  
  37. # location of various source files, relative to the 'main' directory
  38. VMSDIR    = [.vms]
  39. DOCDIR    = [.doc]
  40. MAKEFILE = $(VMSDIR)Descrip.MMS
  41.  
  42. # debugging &c        !'ccflags' is an escape to allow external compile flags
  43. #CCFLAGS = /noOpt/Debug
  44.  
  45. # a comma separated list of macros to define
  46. CDEFS    = "GAWK","HAVE_CONFIG_H"
  47.  
  48. .ifdef GNUC
  49. # assumes VAX
  50. CC    = gcc
  51. CFLAGS    = /Incl=([],$(VMSDIR))/Obj=[]/Def=($(CDEFS)) $(CCFLAGS)
  52. LIBS    = gnu_cc:[000000]gcclib.olb/Library,sys$library:vaxcrtl.olb/Library
  53. .ifdef DO_GNUC_SETUP
  54. # in case GCC command verb needs to be manually defined
  55. .first
  56.     set command gnu_cc:[000000]gcc
  57. .endif    !DO_GNUC_SETUP
  58. .else    !!GNUC
  59. .ifdef VAXC
  60. # always VAX; version V3.x of VAX C assumed (for V2.x, remove /Opt=noInline)
  61. CC    = cc
  62. CFLAGS    = /Incl=[]/Obj=[]/Opt=noInline/Def=($(CDEFS)) $(CCFLAGS)
  63. LIBS    = sys$share:vaxcrtl.exe/Shareable
  64. .else    !!VAXC
  65. # neither GNUC nor VAXC, assume DECC (same for either VAX or Alpha)
  66. CC    = cc/DECC/Prefix=All
  67. CFLAGS    = /Incl=[]/Obj=[]/Def=($(CDEFS)) $(CCFLAGS)
  68. LIBS    =    # DECC$SHR instead of VAXCRTL, no special link option needed
  69. .endif    !VAXC
  70. .endif    !GNUC
  71.  
  72.  
  73. PARSER    = bison
  74. PARSERINIT = set command gnu_bison:[000000]bison
  75. #PARSER    = yacc
  76. #PARSERINIT = yacc := posix/run/path=posix """/bin/yacc"
  77. #PARSERINIT = yacc := $shell$exe:yacc
  78.  
  79. # this is used for optional target 'install.help'
  80. HELPLIB = sys$help:helplib.hlb
  81. #HELPLIB = sys$help:local.hlb
  82.  
  83. #
  84. ########  nothing below this line should need to be changed  ########
  85. #
  86.  
  87. ECHO = write sys$output
  88. NOOP = continue
  89.  
  90. # ALLOCA
  91. ALLOCA    = alloca.obj
  92.  
  93. # object files
  94. AWKOBJS = array.obj,builtin.obj,eval.obj,field.obj,gawkmisc.obj,\
  95.     io.obj,main.obj,missing.obj,msg.obj,node.obj,re.obj,version.obj
  96.  
  97. ALLOBJS = $(AWKOBJS),awktab.obj
  98.  
  99. # LIBOBJS
  100. #    GNU and other stuff that gawk uses as library routines.
  101. LIBOBJS = getopt.obj,getopt1.obj,regex.obj,dfa.obj,random.obj,$(ALLOCA)
  102.  
  103. # VMSOBJS
  104. #    VMS specific stuff
  105. VMSCODE = vms_misc.obj,vms_popen.obj,vms_fwrite.obj,vms_args.obj,\
  106.     vms_gawk.obj,vms_cli.obj
  107. VMSCMD    = gawk_cmd.obj            # built from .cld file
  108. VMSOBJS = $(VMSCODE),$(VMSCMD)
  109.  
  110. # source and documentation files
  111. SRC = array.c,builtin.c,eval.c,field.c,gawkmisc.c,io.c,main.c,\
  112.     missing.c,msg.c,node.c,re.c,version.c
  113.  
  114. ALLSRC= $(SRC),awktab.c
  115.  
  116. AWKSRC= awk.h,awk.y,$(ALLSRC),patchlevel.h,protos.h,random.h
  117.  
  118. LIBSRC = alloca.c,dfa.c,dfa.h,regex.c,regex.h,getopt.h,getopt.c,getopt1.c,random.c
  119.  
  120. VMSSRCS = $(VMSDIR)gawkmisc.vms,$(VMSDIR)vms_misc.c,$(VMSDIR)vms_popen.c,\
  121.     $(VMSDIR)vms_fwrite.c,$(VMSDIR)vms_args.c,$(VMSDIR)vms_gawk.c,\
  122.     $(VMSDIR)vms_cli.c
  123. VMSHDRS = $(VMSDIR)redirect.h,$(VMSDIR)vms.h,$(VMSDIR)fcntl.h,\
  124.     $(VMSDIR)varargs.h,$(VMSDIR)unixlib.h
  125. VMSOTHR = $(VMSDIR)Descrip.MMS,$(VMSDIR)vmsbuild.com,$(VMSDIR)version.com,\
  126.     $(VMSDIR)gawk.hlp
  127.  
  128. DOCS= $(DOCDIR)gawk.1,$(DOCDIR)gawk.texi,$(DOCDIR)texinfo.tex
  129.  
  130. # Release of gawk
  131. REL=3.0
  132. PATCHLVL=3
  133.  
  134. # generic target
  135. all : gawk
  136.     $(NOOP)
  137.  
  138. # dummy target to allow building "gawk" in addition to explicit "gawk.exe"
  139. gawk : gawk.exe
  140.     $(ECHO) " GAWK "
  141.  
  142. # rules to build gawk
  143. gawk.exe : $(ALLOBJS) $(LIBOBJS) $(VMSOBJS) gawk.opt
  144.     $(LINK) $(LINKFLAGS) gawk.opt/options
  145.  
  146. gawk.opt : $(MAKEFILE)            # create linker options file
  147.     open/write opt gawk.opt        ! ~ 'cat <<close >gawk.opt'
  148.     write opt "! GAWK -- GNU awk"
  149.       @ write opt "$(ALLOBJS)"
  150.       @ write opt "$(LIBOBJS)"
  151.       @ write opt "$(VMSOBJS)"
  152.       @ write opt "psect_attr=environ,noshr    !extern [noshare] char **"
  153.       @ write opt "stack=48    !preallocate more pages (default is 20)"
  154.       @ write opt "iosegment=128    !ditto (default is 32)"
  155.     write opt "$(LIBS)"
  156.     write opt "identification=""V$(REL).$(PATCHLVL)"""
  157.     close opt
  158.  
  159. vms_misc.obj    : $(VMSDIR)vms_misc.c
  160. vms_popen.obj    : $(VMSDIR)vms_popen.c
  161. vms_fwrite.obj    : $(VMSDIR)vms_fwrite.c
  162. vms_args.obj    : $(VMSDIR)vms_args.c
  163. vms_gawk.obj    : $(VMSDIR)vms_gawk.c
  164. vms_cli.obj    : $(VMSDIR)vms_cli.c
  165. $(VMSCODE)    : awk.h config.h $(VMSDIR)vms.h
  166.  
  167. gawkmisc.obj    : gawkmisc.c $(VMSDIR)gawkmisc.vms
  168.  
  169. $(ALLOBJS)    : awk.h dfa.h regex.h config.h $(VMSDIR)redirect.h
  170. getopt.obj    : getopt.h config.h $(VMSDIR)redirect.h
  171. getopt1.obj    : getopt.h config.h $(VMSDIR)redirect.h
  172. random.obj    : random.h
  173. builtin.obj    : random.h
  174. main.obj    : patchlevel.h
  175. awktab.obj    : awk.h awktab.c
  176.  
  177. # bison or yacc required
  178. awktab.c    : awk.y        # foo.y :: yacc => y[_]tab.c, bison => foo_tab.c
  179.      @- if f$search("ytab.c")    .nes."" then  delete ytab.c;*     !POSIX yacc
  180.      @- if f$search("y_tab.c")    .nes."" then  delete y_tab.c;*     !DEC/Shell yacc
  181.      @- if f$search("awk_tab.c").nes."" then  delete awk_tab.c;* !bison
  182.       - $(PARSERINIT)
  183.     $(PARSER) $(YFLAGS) $<
  184.      @- if f$search("ytab.c")    .nes."" then  rename/new_vers ytab.c  $@
  185.      @- if f$search("y_tab.c")    .nes."" then  rename/new_vers y_tab.c $@
  186.      @- if f$search("awk_tab.c").nes."" then  rename/new_vers awk_tab.c $@
  187.  
  188. config.h    : $(VMSDIR)vms-conf.h
  189.     copy $< $@
  190.  
  191. # Alloca - C simulation
  192. alloca.obj    : alloca.c config.h $(VMSDIR)redirect.h
  193.     $(CC) $(CFLAGS) /define=($(CDEFS),"STACK_DIRECTION=(-1)","exit=vms_exit") $<
  194.  
  195. $(VMSCMD)    : $(VMSDIR)gawk.cld
  196.     set command $(CLDFLAGS)/object=$@ $<
  197.  
  198. # special target for loading the help text into a VMS help library
  199. install.help    : $(VMS)gawk.hlp
  200.     library/help $(HELPLIB) $< /log
  201.  
  202. # miscellaneous other targets
  203. tidy :
  204.       - if f$search("*.*;-1").nes."" then  purge
  205.       - if f$search("[.*]*.*;-1").nes."" then  purge [.*]
  206.  
  207. clean :
  208.       - delete *.obj;*,gawk.opt;*
  209.  
  210. spotless : clean tidy
  211.       - if f$search("gawk.exe").nes."" then  delete gawk.exe;*
  212.       - if f$search("gawk.dvi").nes."" then  delete gawk.dvi;*
  213.       - if f$search("[.doc]texindex.exe").nes."" then  delete [.doc]texindex.exe;*
  214.  
  215. #
  216. # Note: this only works if you kept a copy of [.support]texindex.c
  217. # from a gawk 2.x distribution and put it into [.doc]texindex.c.
  218. # Also, depending on the fonts available with the version of TeX
  219. # you have, you might need to edit [.doc]texinfo.tex and change
  220. # the reference to "lcircle10" to be "circle10".
  221. #
  222. # build gawk.dvi from within the 'doc' subdirectory
  223. #
  224. gawk.dvi : [.doc]texindex.exe [.doc]gawk.texi
  225.       @ set default [.doc]
  226.       @ write sys$output " Warnings from TeX are expected during the first pass"
  227.     TeX gawk.texi
  228.     mcr []texindex gawk.cp gawk.fn gawk.ky gawk.pg gawk.tp gawk.vr
  229.       @ write sys$output " Second pass"
  230.     TeX gawk.texi
  231.     mcr []texindex gawk.cp gawk.fn gawk.ky gawk.pg gawk.tp gawk.vr
  232.       @ write sys$output " Third (final) pass"
  233.     TeX gawk.texi
  234.      -@ purge
  235.      -@ delete gawk.lis;,.aux;,gawk.%%;,.cps;,.fns;,.kys;,.pgs;,.toc;,.tps;,.vrs;
  236.       @ rename/new_vers gawk.dvi [-]*.*
  237.       @ set default [-]
  238.  
  239. # Note: [.doc]texindex.c is not included with the gawk 3.x distribution.
  240. # Expect lots of "implicitly declared function" diagnostics from DEC C.
  241. #
  242. [.doc]texindex.exe : [.doc]texindex.c
  243.       @ set default [.doc]
  244.     $(CC) /noOpt/noList/Define=("lines=tlines") texindex.c
  245.       @ open/Write opt texindex.opt
  246.       @ write opt "texindex.obj"
  247.       @ write opt "$(LIBS)"
  248.       @ close opt
  249.     $(LINK) /noMap/Exe=texindex.exe texindex.opt/Options
  250.      -@ delete texindex.obj;*,texindex.opt;*
  251.       @ set default [-]
  252.  
  253. #eof
  254.