home *** CD-ROM | disk | FTP | other *** search
Makefile | 1990-11-26 | 9.7 KB | 307 lines |
- ############################ VMS MAKEFILE ##############################
- # IMPORTANT: Before you use this makefile, 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)
- #
- # If you do not have DEC's MMS or a MAKE program compatible with it you
- # may have to make some syntactical adjustments to suit your particular
- # MAKE program. After you have made any changes required for your site,
- # rename this file to MAKEFILE. (or DESCRIP.MMS if using MMS) and you can
- # use any of these MAKE (or MMS) commands:
- #
- # $ make -- same as "mms flex"
- # $ make flex -- compile and link the local flex.exe
- # $ make test -- mms flex; then test the local flex.e
- xe
- # $ make clean -- delete all unneeded files
- # $ make clean_all -- mms clean; delete flex.exe and purge
- #
- # To install the flex files in a public location do the following.
- # You need write access to the directories defined below by BIN, LIB, MAN,
- # and, if you're installing the VMS comand line version, CLD and the help
- # library defined by HLP. Then you can:
- #
- # $ make all -- same as "mms install", "mms test_flex"
- # $ make install -- "mms flex" then move files to public dirs.
- # $ make test_flex -- test the installed public version
- #
- # When "mms test" or "mms 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)"""
-
- FLEXOBJS = ccl.obj dfa.obj ecs.obj gen.obj misc.obj nfa.obj \
- parse.obj scan.obj sym.obj tblcmp.obj yylex.obj
-
- OBJ = ccl.obj,dfa.obj,ecs.obj,gen.obj,misc.obj,nfa.obj, \
- parse.obj,scan.obj,sym.obj,tblcmp.obj,yylex.obj
-
-
- flex : flex$(VERSION).exe
- @ ! Flex.exe built
-
- test : flex $(VERSION)_test
- @ ! Flex.exe built and tested
-
- all : $(VERSION)_install $(VERSION)_test_flex
- @ ! Flex installed and tested
-
- install : $(VERSION)_install
- @ ! Flex installed
-
- _install : bin lib man
- @ ! Flex installed
-
- vms_install : bin lib cld man hlp
- @ ! Flex installed
-
- lib : $(LIB)flex.skel
- @ ! Installed $(LIB)flex.skel
-
- bin : $(BIN)flex$(VERSION).exe
- @ ! Installed @(BIN)flex.exe
-
- man : $(MAN)flex.man $(MAN)flexdoc.man
- @ ! installed $(MAN)flex.man
-
- cld : $(CLD)flex.cld
- @ ! Installed @(CLD)flex.cld
-
- hlp : $(HLP)(flex)
- @ ! Installed $(HLP)(flex)
-
- $(LIB)flex.skel : flex.skel
- copy/log flex.skel $(LIB)flex.skel/prot=(g:r,w:r)
-
- $(BIN)flex$(VERSION).exe : flex$(VERSION).exe
- copy/log flex$(VERSION).exe $(BIN)flex$(VERSION).exe/prot=(g:re,w:re)
-
- $(MAN)flex.man : flex.man
- if f$search("flex.man") .nes. "" then -
- copy/log flex.man $(MAN)flex.man/prot=(g:r,w:r)
-
- $(MAN)flexdoc.man : flexdoc.man
- if f$search("flexdoc.man") .nes. "" then -
- copy/log flex.man $(MAN)flexdoc.man/prot=(g:r,w:r)
-
- $(HLP)(flex) : flex.hlp
- libr/log $(HLP) flex.hlp/replace
-
- $(CLD)flex.cld : flex.cld_template
- 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
-
- # 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
-
- ccl.obj : ccl.c flexdef.h
- cc $(CFLAGS) /define=($(CDEFS)) ccl.c
-
- dfa.obj : dfa.c flexdef.h
- cc $(CFLAGS) /define=($(CDEFS)) dfa.c
-
- ecs.obj : ecs.c flexdef.h
- cc $(CFLAGS) /define=($(CDEFS)) ecs.c
-
- gen.obj : gen.c flexdef.h
- cc $(CFLAGS) /define=($(CDEFS)) gen.c
-
- main.obj : main.c flexdef.h
- cc $(CFLAGS) /define=($(CDEFS),$(SKELDEF)) main.c
-
- mainvms.obj : main.c flexdef.h vmscmdln.c
- cc $(CFLAGS) /define=($(CDEFS),$(SKELDEF),VMSCMDLN) main.c /obj=mainvms
- .obj
-
- misc.obj : misc.c flexdef.h
- cc $(CFLAGS) /define=($(CDEFS)) misc.c
-
- nfa.obj : nfa.c flexdef.h
- cc $(CFLAGS) /define=($(CDEFS)) nfa.c
-
- parse.c : parse.y
- # 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;*
-
- parse.h : parse.c
- copy y_tab.h parse.h
- dele/noconf y_tab.h;*
-
- parse.obj : parse.c flexdef.h parse.h
- cc $(CFLAGS) /define=($(CDEFS),"void=int", -
- "bcopy(b1,b2,n)=memcpy(b2,b1,n)") parse.c
-
- scan.c : initscan.c
- copy initscan.c scan.c
-
- scan.obj : scan.c parse.h flexdef.h
- cc $(CFLAGS) /define=($(CDEFS)) scan.c
-
- sym.obj : sym.c flexdef.h
- cc $(CFLAGS) /define=($(CDEFS)) sym.c
-
- tblcmp.obj : tblcmp.c flexdef.h
- cc $(CFLAGS) /define=($(CDEFS)) tblcmp.c
-
- yylex.obj : yylex.c parse.h flexdef.h
- cc $(CFLAGS) /define=($(CDEFS)) yylex.c
-
- cli.obj : cli.c
- cc $(CFLAGS) cli.c
-
- flex.exe : main.obj $(FLEXOBJS) $(ALLOCA) vaxcrtl.opt
- link $(LFLAGS) /exe=flex.exe main.obj, -
- $(OBJ), -
- $(ALLOCA), sys$disk:[]vaxcrtl.opt/opt
-
- flexvms.exe : mainvms.obj cli.obj $(FLEXOBJS) $(ALLOCA) vaxcrtl.opt
- link $(LFLAGS) /exe=flexvms.exe mainvms.obj, cli.obj, -
- $(OBJ), -
- $(ALLOCA), sys$disk:[]vaxcrtl.opt/opt
-
- vaxcrtl.opt :
- open/write tempfl vaxcrtl.opt
- write tempfl "SYS$SHARE:VAXCRTL.EXE/SHARE"
- close tempfl
-
- 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=(al
- loca.obj,bcopy.obj)
- @ if f$search ("y_tab.*") .nes. "" then dele/log/noconf y_tab.*;*
-
- clean_all : clean
- @ 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
-
- # 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;*
-
- _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;*
-
- vms_test : xflex.cld
- 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;*
-
- _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;*
-