home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / FLEX / FLEX-2.4 / FLEX-2 / flex-2.4.7 / MISC / VMS / VMS.more-stuff / makefile.vms < prev    next >
Encoding:
Makefile  |  1990-11-26  |  9.7 KB  |  307 lines

  1. ############################ VMS MAKEFILE ##############################
  2. # IMPORTANT:  Before you use this makefile, read INSTALL.VMS and the
  3. # comments below.  You will need an alloca object module and GNU bison.
  4. # Define the logical names flex_exe, flex_library, and flex_manual.
  5. #
  6. # For flex version 2.3.6 (11/17/90)
  7. #
  8. # If you do not have DEC's MMS or a MAKE program compatible with it you
  9. # may have to make some syntactical adjustments to suit your particular
  10. # MAKE program.  After you have made any changes required for your site,
  11. # rename this file to MAKEFILE. (or DESCRIP.MMS if using MMS) and you can
  12. # use any of these MAKE (or MMS) commands:
  13. #
  14. #   $ make             -- same as "mms flex" 
  15. #   $ make flex            -- compile and link the local flex.exe 
  16. #   $ make test            -- mms flex; then test the local flex.e
  17. xe
  18. #   $ make clean        -- delete all unneeded files
  19. #   $ make clean_all        -- mms clean; delete flex.exe and purge
  20. #
  21. # To install the flex files in a public location do the following.
  22. # You need write access to the directories defined below by BIN, LIB, MAN,
  23. # and, if you're installing the VMS comand line version, CLD and the help
  24. # library defined by HLP.  Then you can:
  25. #
  26. #   $ make all            -- same as "mms install", "mms test_flex"
  27. #   $ make install        -- "mms flex" then move files to public dirs.
  28. #   $ make test_flex        -- test the installed public version
  29. #
  30. # When "mms test" or "mms test_flex" is executed you shoud see the message
  31. # "Test successful".  A make abort after the diff command is a failure.
  32. # To get some idea of what went wrong, do a diff between lexyy.c (the file
  33. # just generated by flex) and initscan.c (what it should have generated).
  34. #
  35. #
  36. #
  37. # The flex parser generated by bison requires an alloca routine which
  38. # you must supply.  Change the line below if your alloca.obj is some-
  39. # where other than the current directory.
  40. ALLOCA = alloca.obj
  41. #ALLOCA = gnu_bison:[000000]vmshlp.obj
  42.  
  43. # Use one of the following two defines.  The first will build flex with
  44. # a VMS-style command line interface, the second builds flex with a unix-
  45. # style command line interface.
  46. #
  47. # For a VMS-style interface...
  48. VERSION = vms
  49. # For a unix-style interface...
  50. #VERSION =
  51.  
  52.  
  53. # BIN, LIB, MAN, CLD, HLP are set to reflect the locations where you
  54. # would like to store the executables, library (flex.skel), the manual
  55. # pages, the command definition file, and the help library module. 
  56. # You can leave these unchanged if you define the VMS logical names:
  57. #
  58. #    flex_exe      -- disk/dir of the executable image    
  59. #    flex_manual   -- disk/dir of the *.man files 
  60. #    flex_library  -- disk/dir of flex.skel and the .cld file
  61. #
  62. # These logical names ***MUST*** be defined before installing or
  63. # running flex.  They don't have to be defined to build flex.  You
  64. # may want to define these, either system wide in the system startup
  65. # procedure, or in your login.com file.  Alternatively, you can change
  66. # the definitions of BIN, LIB, CLD, MAN and HLP in here to refer to pre-
  67. # defined locations.  
  68. #
  69. # ...the installed location of the flex executable...
  70. BIN = flex_exe:
  71.  
  72. # ...the installed location of the flex skeleton file...
  73. LIB = flex_library:
  74.  
  75. # ...the installed location of the flex vms command definition file
  76. # (only matters when installing the VMS command line version)...
  77. CLD = flex_library:
  78.  
  79. # ...the installed location of the flex man pages.
  80. MAN = flex_manual:
  81.  
  82. # ...the help library to put the bison help module into. 
  83. # (only matters when installing the VMS command line version)...
  84. HLP = sys$common:[syshlp]helplib.hlb
  85.  
  86. # The default skeleton file that flex will use.
  87. DEFAULT_SKEL = $(LIB)flex.skel
  88.  
  89. # Flags that initscan.c was created with.  The tests will use the same
  90. # ones so that they should produce an output identical to initscan.c.
  91. VMS_FLEX_FLAGS  = /NOCASE/NOECHO/EIGHT
  92. UNIX_FLEX_FLAGS = -is8
  93.  
  94. # Qualifiers for the link and cc commands.  Values here should be
  95. # fine.  You may want to modify these to build a debuggable version
  96. # of the executable.
  97. LFLAGS = 
  98. #LFLAGS = /debug
  99. CFLAGS = 
  100. #CFLAGS = /nolist/debug/noopt
  101.  
  102. # CC command line defines that are used for (almost) all compilations.
  103. # The redefinition of exit will cause any error exits to returns a VMS 
  104. # error status (SYS-E-ABORT) but one that won't result in a system 
  105. # message (presumably flex printed an error message first). 
  106. CDEFS = VMS,USG,"exit(s)=_exit((s)?0x1000002A:0)"
  107.  
  108. # CC command define for the default skeleton file.
  109. SKELDEF = "DEFAULT_SKELETON_FILE=""$(DEFAULT_SKEL)"""
  110.  
  111. FLEXOBJS = ccl.obj dfa.obj ecs.obj gen.obj misc.obj nfa.obj \
  112.        parse.obj scan.obj sym.obj tblcmp.obj yylex.obj 
  113.  
  114. OBJ =      ccl.obj,dfa.obj,ecs.obj,gen.obj,misc.obj,nfa.obj, \
  115.        parse.obj,scan.obj,sym.obj,tblcmp.obj,yylex.obj
  116.  
  117.  
  118. flex : flex$(VERSION).exe 
  119.     @ ! Flex.exe built
  120.  
  121. test : flex $(VERSION)_test
  122.     @ ! Flex.exe built and tested
  123.  
  124. all : $(VERSION)_install $(VERSION)_test_flex
  125.     @ ! Flex installed and tested
  126.  
  127. install : $(VERSION)_install
  128.     @ ! Flex installed
  129.  
  130. _install : bin lib man
  131.     @ ! Flex installed
  132.  
  133. vms_install : bin lib cld man hlp
  134.     @ ! Flex installed
  135.  
  136. lib : $(LIB)flex.skel
  137.     @ ! Installed $(LIB)flex.skel
  138.  
  139. bin : $(BIN)flex$(VERSION).exe
  140.     @ ! Installed @(BIN)flex.exe
  141.  
  142. man : $(MAN)flex.man $(MAN)flexdoc.man
  143.     @ ! installed $(MAN)flex.man
  144.  
  145. cld : $(CLD)flex.cld
  146.     @ ! Installed @(CLD)flex.cld
  147.  
  148. hlp : $(HLP)(flex)
  149.     @ ! Installed $(HLP)(flex)
  150.  
  151. $(LIB)flex.skel : flex.skel
  152.     copy/log flex.skel $(LIB)flex.skel/prot=(g:r,w:r)
  153.  
  154. $(BIN)flex$(VERSION).exe : flex$(VERSION).exe
  155.     copy/log flex$(VERSION).exe $(BIN)flex$(VERSION).exe/prot=(g:re,w:re)
  156.  
  157. $(MAN)flex.man : flex.man
  158.     if f$search("flex.man") .nes. "" then -
  159.         copy/log flex.man $(MAN)flex.man/prot=(g:r,w:r)
  160.  
  161. $(MAN)flexdoc.man : flexdoc.man
  162.     if f$search("flexdoc.man") .nes. "" then -
  163.         copy/log flex.man $(MAN)flexdoc.man/prot=(g:r,w:r)
  164.  
  165. $(HLP)(flex) : flex.hlp
  166.     libr/log $(HLP) flex.hlp/replace
  167.  
  168. $(CLD)flex.cld : flex.cld_template 
  169.     open/write tempfl $(CLD)flex.cld
  170.     write tempfl "define verb FLEX"
  171.     write tempfl "    image $(BIN)FLEXVMS.EXE"
  172.     copy/log flex.cld_template tempfl/prot=(g:r,w:r)
  173.     close tempfl
  174.  
  175. # Local cld file is named xflex so that $(CLD) can be defined as the flex
  176. # directory and the flex.cld file will be updated correctly.
  177. xflex.cld : flex.cld_template
  178.     open/write tempfl xflex.cld
  179.     write tempfl "define verb XFLEX"
  180.     write tempfl "    image ''f$env ("default")'FLEXVMS.EXE"
  181.     copy flex.cld_template tempfl
  182.     close tempfl
  183.  
  184. ccl.obj : ccl.c flexdef.h
  185.     cc $(CFLAGS) /define=($(CDEFS)) ccl.c
  186.  
  187. dfa.obj : dfa.c flexdef.h
  188.     cc $(CFLAGS) /define=($(CDEFS)) dfa.c
  189.  
  190. ecs.obj : ecs.c flexdef.h
  191.     cc $(CFLAGS) /define=($(CDEFS)) ecs.c
  192.  
  193. gen.obj : gen.c flexdef.h
  194.     cc $(CFLAGS) /define=($(CDEFS)) gen.c
  195.  
  196. main.obj : main.c flexdef.h 
  197.     cc $(CFLAGS) /define=($(CDEFS),$(SKELDEF)) main.c
  198.  
  199. mainvms.obj : main.c flexdef.h vmscmdln.c
  200.     cc $(CFLAGS) /define=($(CDEFS),$(SKELDEF),VMSCMDLN) main.c /obj=mainvms
  201. .obj
  202.  
  203. misc.obj : misc.c flexdef.h
  204.     cc $(CFLAGS) /define=($(CDEFS)) misc.c
  205.  
  206. nfa.obj : nfa.c flexdef.h
  207.     cc $(CFLAGS) /define=($(CDEFS)) nfa.c
  208.  
  209. parse.c : parse.y
  210. # You may need a "set command dev:[dir]bison here if the bison
  211. # command is not in the system DCL tables.
  212. #    set com gnu_bison:[000000]:bison
  213.     bison/defines/fixed_outfiles parse.y
  214.     copy y_tab.c parse.c
  215.     dele/noconf y_tab.c;*
  216.  
  217. parse.h : parse.c
  218.     copy y_tab.h parse.h
  219.     dele/noconf y_tab.h;*
  220.  
  221. parse.obj : parse.c flexdef.h parse.h
  222.     cc $(CFLAGS) /define=($(CDEFS),"void=int", -
  223.       "bcopy(b1,b2,n)=memcpy(b2,b1,n)") parse.c
  224.  
  225. scan.c : initscan.c
  226.     copy initscan.c scan.c
  227.  
  228. scan.obj : scan.c parse.h flexdef.h
  229.     cc $(CFLAGS) /define=($(CDEFS)) scan.c
  230.  
  231. sym.obj : sym.c flexdef.h
  232.     cc $(CFLAGS) /define=($(CDEFS)) sym.c
  233.  
  234. tblcmp.obj : tblcmp.c flexdef.h
  235.     cc $(CFLAGS) /define=($(CDEFS)) tblcmp.c
  236.  
  237. yylex.obj : yylex.c parse.h flexdef.h
  238.     cc $(CFLAGS) /define=($(CDEFS)) yylex.c
  239.  
  240. cli.obj : cli.c
  241.     cc $(CFLAGS) cli.c
  242.  
  243. flex.exe :  main.obj $(FLEXOBJS) $(ALLOCA) vaxcrtl.opt
  244.     link $(LFLAGS) /exe=flex.exe main.obj, -
  245.         $(OBJ), -
  246.         $(ALLOCA), sys$disk:[]vaxcrtl.opt/opt
  247.  
  248. flexvms.exe : mainvms.obj cli.obj $(FLEXOBJS) $(ALLOCA) vaxcrtl.opt
  249.     link $(LFLAGS) /exe=flexvms.exe mainvms.obj, cli.obj, -
  250.         $(OBJ), -
  251.         $(ALLOCA), sys$disk:[]vaxcrtl.opt/opt
  252.  
  253. vaxcrtl.opt :
  254.     open/write tempfl vaxcrtl.opt
  255.     write tempfl "SYS$SHARE:VAXCRTL.EXE/SHARE"
  256.     close tempfl
  257.  
  258. clean :
  259.     @ ! Cleanup by deleting unnecessary object files etc.
  260.     @ if f$search ("scan.c") .nes. "" then dele/log/noconf scan.c;*
  261.     @ if f$search ("parse.c") .nes. "" then dele/log/noconf parse.c;*
  262.     @ if f$search ("parse.h") .nes. "" then dele/log/noconf parse.h;*
  263.     @ if f$search ("lexyy.c") .nes. "" then dele/log/noconf lexyy.c;*
  264.     @ if f$search ("*.obj") .nes. "" then dele/log/noconf *.obj;*/exclu=(al
  265. loca.obj,bcopy.obj)
  266.     @ if f$search ("y_tab.*") .nes. "" then dele/log/noconf y_tab.*;*
  267.  
  268. clean_all : clean
  269.     @ if f$search ("flex.exe") .nes. "" then dele/log/noconf flex.exe;*
  270.     @ if f$search ("flexvms.exe") .nes. "" then dele/log/noconf flexvms.exe
  271. ;*
  272.     @ if f$search ("xflex.cld") .nes. "" then dele/log/noconf xflex.cld;*
  273.     @ if f$search ("vaxcrtl.opt") .nes. "" then dele/log/noconf vaxcrtl.opt
  274. ;*
  275.     @ purge/log
  276.  
  277. # The weird name used for the VMS flex commands below is to prevent the
  278. # DCL command from being shadowed by a DCL symbol named flex.  
  279.  
  280. vms_test_flex : 
  281.     set com $(LIB)flex.cld
  282.     flex_$make$ $(VMS_FLEX_FLAGS) scan.l
  283.     diff/max=1/out=NL: initscan.c lexyy.c
  284.     @ write sys$output "!!!! Test successful !!!!"
  285.     - dele/noconf lexyy.c;*
  286.  
  287. _test_flex : 
  288.     flex := $$(BIN)flex
  289.     flex $(UNIX_FLEX_FLAGS) scan.l 
  290.     diff/max=1/out=NL: initscan.c lexyy.c
  291.     @ write sys$output "!!!! Test successful !!!!"
  292.     - dele/noconf lexyy.c;*
  293.  
  294. vms_test : xflex.cld
  295.     set com xflex.cld
  296.     xflex $(VMS_FLEX_FLAGS) /SKEL=flex.skel scan.l
  297.     diff/max=1/out=NL: initscan.c lexyy.c
  298.     @ write sys$output "!!!! Test successful !!!!"
  299.     - dele/noconf lexyy.c;*
  300.  
  301. _test : 
  302.     flex := $sys$disk:[]flex
  303.     flex $(UNIX_FLEX_FLAGS) "-Sflex.skel" scan.l 
  304.     diff/max=1/out=NL: initscan.c lexyy.c
  305.     @ write sys$output "!!!! Test successful !!!!"
  306.     - dele/noconf lexyy.c;*
  307.