home *** CD-ROM | disk | FTP | other *** search
- $ v = f$verify (0)
- $! IMPORTANT: Before you use this procedure, read INSTALL.VMS and the
- $! comments below. You will need an alloca object module and GNU bison.
- $! Define the logical names flex_exe, flex_library, and flex_manual.
- $!
- $! For flex version 2.3.6 (11/17/90)
- $!
- $! You use this procedure to compile, link and test flex by doing:
- $!
- $! @ DCLMAKE BUILD
- $!
- $! To install flex in the public directory, be sure that the logical
- $! names "flex_exe", "flex_library", and "flex_manual" are correctly
- $! defined and do:
- $!
- $! @ DCLMAKE INSTALL_TEST
- $!
- $! You can also use this procedure to compile individual source files
- $! by saying:
- $!
- $! @ DCLMAKE COMPILE name
- $!
- $! where "name" is the source file's name without the file type, e.g.
- $! "@DCLMAKE COMPILE CCL". With no filename, DCLMAKE will compile all
- $! the source files. Link by doing: "@DCLMAKE LINK", test the local
- $! flex with "@DCLMAKE TEST", install the public files with "@DCLMAKE
- $! INSTALL", and test the installed files with "@DCLMAKE TEST_FLEX".
- $!
- $! When "test" or "test_flex" is executed you shoud see the message
- $! "Test successful". A make abort after the diff command is a failure.
- $! To get some idea of what went wrong, do a diff between lexyy.c (the file
- $! just generated by flex) and initscan.c (what it should have generated).
- $!
- $!
- $!
- $! The flex parser generated by bison requires an alloca routine which
- $! you must supply. Change the line below if your alloca.obj is some-
- $! where other than the current directory.
- $ALLOCA = "alloca.obj"
- $!ALLOCA = "gnu_bison:[000000]vmshlp.obj"
- $
- $! Use one of the following two defines. The first will build flex with
- $! a VMS-style command line interface, the second builds flex with a unix-
- $! style command line interface.
- $!
- $! For a VMS-style interface...
- $VERSION = "vms"
- $! For a unix-style interface...
- $!VERSION = ""
- $
- $
- $! BIN, LIB, MAN, CLD, HLP are set to reflect the locations where you
- $! would like to store the executables, library (flex.skel), the manual
- $! pages, the command definition file, and the help library module.
- $! You can leave these unchanged if you define the VMS logical names:
- $!
- $! flex_exe -- disk/dir of the executable image
- $! flex_manual -- disk/dir of the *.man files
- $! flex_library -- disk/dir of flex.skel and the .cld file
- $!
- $! These logical names ***MUST*** be defined before installing or
- $! running flex. They don't have to be defined to build flex. You
- $! may want to define these, either system wide in the system startup
- $! procedure, or in your login.com file. Alternatively, you can change
- $! the definitions of BIN, LIB, CLD, MAN and HLP in here to refer to pre-
- $! defined locations.
- $!
- $! ...the installed location of the flex executable...
- $BIN = "flex_exe:"
- $
- $! ...the installed location of the flex skeleton file...
- $LIB = "flex_library:"
- $
- $! ...the installed location of the flex vms command definition file
- $! (only matters when installing the VMS command line version)...
- $CLD = "flex_library:"
- $
- $! ...the installed location of the flex man pages.
- $MAN = "flex_manual:"
- $
- $! ...the help library to put the bison help module into.
- $! (only matters when installing the VMS command line version)...
- $HLP = "sys$common:[syshlp]helplib.hlb"
- $
- $! The default skeleton file that flex will use.
- $DEFAULT_SKEL = "''LIB'flex.skel"
- $
- $! Flags that initscan.c was created with. The tests will use the same
- $! ones so that they should produce an output identical to initscan.c.
- $VMS_FLEX_FLAGS = "/NOCASE/NOECHO/EIGHT"
- $UNIX_FLEX_FLAGS = "-is8"
- $
- $! Qualifiers for the link and cc commands. Values here should be
- $! fine. You may want to modify these to build a debuggable version
- $! of the executable.
- $LFLAGS = ""
- $!LFLAGS = "/debug"
- $CFLAGS = ""
- $!CFLAGS = "/nolist/debug/noopt"
- $
- $! CC command line defines that are used for (almost) all compilations.
- $! The redefinition of exit will cause any error exits to returns a VMS
- $! error status (SYS-E-ABORT) but one that won't result in a system
- $! message (presumably flex printed an error message first).
- $CDEFS = "VMS,USG,""exit(s)=_exit((s)?0x1000002A:0)"""
- $
- $! CC command define for the default skeleton file.
- $SKELDEF = """DEFAULT_SKELETON_FILE=""""''DEFAULT_SKEL'"""""""
- $
- $OBJ = "ccl.obj,dfa.obj,ecs.obj,gen.obj,misc.obj,nfa.obj," + -
- "parse.obj,scan.obj,sym.obj,tblcmp.obj,yylex.obj"
- $
- $
- $ on warning then stop
- $ continue = "FALSE"
- $ if "''VERSION'" .eqs. "" .and. f$env ("DEPTH") .eq. 1 then -
- write sys$output "***** DCLMAKE for UNIX command line interface ***
- **"
- $ if "''VERSION'" .nes. "" .and. f$env ("DEPTH") .eq. 1 then -
- write sys$output "***** DCLMAKE for VMS command line interface ****
- *"
- $ set verify
- $ if p1 .eqs. "COMPILE" .and. p2 .nes. "" then goto 'p2'
- $ goto 'p1'
- $
- $done :
- $ v = f$verify (v)
- $ exit
- $
- $build :
- $ @'f$env ("procedure")' compile
- $ @'f$env ("procedure")' test
- $ goto done
- $
- $install_test :
- $ @'f$env ("procedure")' install
- $ @'f$env ("procedure")' test_flex
- $ goto done
- $
- $link :
- $ goto 'VERSION'_link
- $
- $test_flex :
- $ goto 'VERSION'_test_flex
- $
- $test :
- $ goto 'VERSION'_test
- $
- $
- $install :
- $ copy/log flex.skel 'LIB'flex.skel/prot=(g:r,w:r)
- $
- $ copy/log flex'VERSION'.exe 'BIN'flex'VERSION'.exe/prot=(g:re,w:re)
- $
- $ if f$search("flex.man") .nes. "" then -
- copy/log flex.man 'MAN'flex.man/prot=(g:r,w:r)
- $
- $ if f$search("flexdoc.man") .nes. "" then -
- copy/log flex.man 'MAN'flexdoc.man/prot=(g:r,w:r)
- $
- $if "''VERSION'" .eqs. "" then goto done
- $
- $ libr/log 'HLP' flex.hlp/replace
- $
- $ open/write tempfl 'CLD'flex.cld
- $ write tempfl "define verb FLEX"
- $ write tempfl " image ''BIN'FLEXVMS.EXE"
- $ copy/log flex.cld_template tempfl/prot=(g:r,w:r)
- $ close tempfl
- $ goto done
- $
- $! Local cld file is named xflex so that 'CLD' can be defined as the flex
- $! directory and the flex.cld file will be updated correctly.
- $xflex.cld : flex.cld_template
- $ open/write tempfl xflex.cld
- $ write tempfl "define verb XFLEX"
- $ write tempfl " image ''f$env ("default")'FLEXVMS.EXE"
- $ copy flex.cld_template tempfl
- $ close tempfl
- $ goto done
- $
- $compile:
- $ continue = "TRUE"
- $
- $ccl :
- $ cc 'CFLAGS' /define=('CDEFS') ccl.c
- $ if .not. continue then goto done
- $
- $dfa :
- $ cc 'CFLAGS' /define=('CDEFS') dfa.c
- $ if .not. continue then goto done
- $
- $ecs :
- $ cc 'CFLAGS' /define=('CDEFS') ecs.c
- $ if .not. continue then goto done
- $
- $gen :
- $ cc 'CFLAGS' /define=('CDEFS') gen.c
- $ if .not. continue then goto done
- $
- $main :
- $ cc 'CFLAGS' /define=('CDEFS','SKELDEF') main.c
- $ if .not. continue then goto done
- $
- $mainvms :
- $ cc 'CFLAGS' /define=('CDEFS','SKELDEF',VMSCMDLN) main.c /obj=mainvms.ob
- j
- $ if .not. continue then goto done
- $
- $misc :
- $ cc 'CFLAGS' /define=('CDEFS') misc.c
- $ if .not. continue then goto done
- $
- $nfa :
- $ cc 'CFLAGS' /define=('CDEFS') nfa.c
- $ if .not. continue then goto done
- $
- $parse :
- $! You may need a "set command dev:[dir]bison here if the bison
- $! command is not in the system DCL tables.
- $! set com gnu_bison:[000000]:bison
- $ bison/defines/fixed_outfiles parse.y
- $ copy y_tab.c parse.c
- $ dele/noconf y_tab.c;*
- $
- $ copy y_tab.h parse.h
- $ dele/noconf y_tab.h;*
- $
- $ cc 'CFLAGS' /define=('CDEFS',"void=int",-
- "bcopy(b1,b2,n)=memcpy(b2,b1,n)") parse.c
- $ if .not. continue then goto done
- $
- $scan :
- $ copy initscan.c scan.c
- $ cc 'CFLAGS' /define=('CDEFS') scan.c
- $ if .not. continue then goto done
- $
- $sym :
- $ cc 'CFLAGS' /define=('CDEFS') sym.c
- $ if .not. continue then goto done
- $
- $tblcmp :
- $ cc 'CFLAGS' /define=('CDEFS') tblcmp.c
- $ if .not. continue then goto done
- $
- $yylex :
- $ cc 'CFLAGS' /define=('CDEFS') yylex.c
- $ if .not. continue then goto done
- $
- $cli :
- $ cc 'CFLAGS' cli.c
- $ if .not. continue then goto done
- $
- $_link :
- $ link 'LFLAGS' /exe=flex.exe main.obj, -
- 'OBJ', -
- 'ALLOCA', sys$input/opt
- SYS$SHARE:VAXCRTL.EXE/SHARE
- $ goto done
- $
- $vms_link :
- $ link 'LFLAGS' /exe=flexvms.exe mainvms.obj, cli.obj, -
- 'OBJ', -
- 'ALLOCA', sys$input/opt
- SYS$SHARE:VAXCRTL.EXE/SHARE
- $ goto done
- $
- $clean_all :
- $ continue = "TRUE"
- $clean :
- $ ! Cleanup by deleting unnecessary object files etc.
- $ if f$search ("scan.c") .nes. "" then dele/log/noconf scan.c;*
- $ if f$search ("parse.c") .nes. "" then dele/log/noconf parse.c;*
- $ if f$search ("parse.h") .nes. "" then dele/log/noconf parse.h;*
- $ if f$search ("lexyy.c") .nes. "" then dele/log/noconf lexyy.c;*
- $ if f$search ("*.obj") .nes. "" then dele/log/noconf *.obj;*/exclu=(allo
- ca.obj,bcopy.obj)
- $ if f$search ("y_tab.*") .nes. "" then dele/log/noconf y_tab.*;*
- $ if .not. continue then goto done
- $
- $ if f$search ("flex.exe") .nes. "" then dele/log/noconf flex.exe;*
- $ if f$search ("flexvms.exe") .nes. "" then dele/log/noconf flexvms.exe;*
- $ if f$search ("xflex.cld") .nes. "" then dele/log/noconf xflex.cld;*
- $ if f$search ("vaxcrtl.opt") .nes. "" then dele/log/noconf vaxcrtl.opt;*
- $ purge/log
- $ goto done
- $
- $! The weird name used for the VMS flex commands below is to prevent the
- $! DCL command from being shadowed by a DCL symbol named flex.
- $
- $vms_test_flex :
- $ set com 'LIB'flex.cld
- $ flex_$make$ 'VMS_FLEX_FLAGS' scan.l
- $ diff/max=1/out=NL: initscan.c lexyy.c
- $ write sys$output "!!!! Test successful !!!!"
- $ dele/noconf lexyy.c;*
- $ goto done
- $
- $_test_flex :
- $ flex := $'BIN'flex
- $ flex 'UNIX_FLEX_FLAGS' scan.l
- $ diff/max=1/out=NL: initscan.c lexyy.c
- $ write sys$output "!!!! Test successful !!!!"
- $ dele/noconf lexyy.c;*
- $ goto done
- $
- $vms_test :
- $ set com xflex.cld
- $ xflex 'VMS_FLEX_FLAGS' /SKEL=flex.skel scan.l
- $ diff/max=1/out=NL: initscan.c lexyy.c
- $ write sys$output "!!!! Test successful !!!!"
- $ dele/noconf lexyy.c;*
- $ goto done
- $
- $_test :
- $ flex := $sys$disk:[]flex
- $ flex 'UNIX_FLEX_FLAGS' "-Sflex.skel" scan.l
- $ diff/max=1/out=NL: initscan.c lexyy.c
- $ write sys$output "!!!! Test successful !!!!"
- $ dele/noconf lexyy.c;*
- $ goto done
-