1 $! Id: vmsbuild.com,v 1.1 2000/11/21 00:38:46 tom Exp
2 $! VMS build-script for BYACC. Requires installed C compiler
4 $! Screen Configurations
5 $! ---------------------
6 $! To build BYACC, type:
7 $! $ @vmsbuild [BYACC [<compiler> [bld_target]]]
10 $! <compiler> :== { decc | vaxc }
12 $! The default compiler on VAX hosts is vaxc, else decc (Alpha hosts).
14 $! -----------------------------------------------------------
15 $ hlp = f$edit("''p1'", "UPCASE")
16 $ if "''hlp'" .eqs. "HELP" .or. -
17 "''hlp'" .eqs. "-H" .or. -
18 "''hlp'" .eqs. "-?" .or. -
19 "''hlp'" .eqs. "?" then gosub usage
25 $ DEFS = ",HAVE_STRERROR"
31 $ CFLAGS = "/DECC/prefix=all"
32 $ DEFS = ",HAVE_ALARM,HAVE_STRERROR"
36 $ write sys$output "usage: "
37 $ write sys$output " $ @vmsbuild [BYACC [{decc | vaxc} [<bldtarget>]]]"
41 $! -----------------------------------------------------------
42 $! pickup user's compiler choice, if any
43 $! -----------------------------------------------------------
49 $ comp = f$edit(p2, "UPCASE")
50 $ if "''comp'" .eqs. "VAXC"
54 $ if "''comp'" .eqs. "DECC"
62 $! -----------------------------------------------------------
63 $! Build the option-file
65 $ open/write optf vms_link.opt
66 $ write optf "closure.obj"
67 $ write optf "error.obj"
68 $ write optf "lalr.obj"
69 $ write optf "lr0.obj"
70 $ write optf "mkpar.obj"
71 $ write optf "output.obj"
72 $ write optf "reader.obj"
73 $ write optf "skeleton.obj"
74 $ write optf "symtab.obj"
75 $ write optf "verbose.obj"
76 $ write optf "warshall.obj"
77 $! ----------------------------------
78 $! Look for the compiler used and specify architecture.
81 $ if f$getsyi("HW_MODEL").ge.1024
83 $ arch = "__alpha__=1"
84 $ if "''comp'" .eqs. "" then gosub decc_config
87 $ if "''comp'" .nes. "" then goto screen_config
88 $ if f$search("SYS$SYSTEM:VAXC.EXE").nes.""
92 $ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").nes.""
96 $ DEFS = ",HAVE_STRERROR"
97 $ if f$trnlnm("GNU_CC").eqs.""
99 $ write sys$output "C compiler required to rebuild BYACC"
103 $ write optf "gnu_cc:[000000]gcclib.olb/lib"
113 $ if using_vaxc .eq. 1 then write optf "sys$library:vaxcrtl.exe/share"
115 $! -------------- vms_link.opt is created -------------
116 $ if f$edit("''p1'", "UPCASE") .eqs. "VMS_LINK.OPT"
118 $! mms called this script to build vms_link.opt. all done
122 $ if f$search("SYS$SYSTEM:MMS.EXE").eqs.""
124 $! can also use /Debug /Listing, /Show=All
126 $ CFLAGS := 'CFLAGS/Diagnostics /Define=("''DEFS'") /Include=([])
128 $ if "''p3'" .nes. "" then goto 'p3
146 $ link /exec='target/map/cross main.obj, vms_link/opt
150 $ WRITE SYS$ERROR "** no rule for install"
154 $ if f$search("BYACC.com") .nes. "" then delete BYACC.com;*
155 $ if f$search("*.exe") .nes. "" then delete *.exe;*
159 $ if f$search("*.obj") .nes. "" then delete *.obj;*
160 $ if f$search("*.bak") .nes. "" then delete *.bak;*
161 $ if f$search("*.lis") .nes. "" then delete *.lis;*
162 $ if f$search("*.log") .nes. "" then delete *.log;*
163 $ if f$search("*.map") .nes. "" then delete *.map;*
164 $ if f$search("*.opt") .nes. "" then delete *.opt;*
168 $ if f$search("*.dia") .nes. "" then delete *.dia;*
169 $ if f$search("*.lis") .nes. "" then purge *.lis
170 $ if f$search("*.obj") .nes. "" then purge *.obj
171 $ if f$search("*.map") .nes. "" then purge *.map
172 $ if f$search("*.opt") .nes. "" then purge *.opt
173 $ if f$search("*.exe") .nes. "" then purge *.exe
174 $ if f$search("*.log") .nes. "" then purge *.log
180 $! Runs BYACC from the current directory (used for testing)
182 $ if "''f$search("BYACC.com")'" .nes. "" then delete BYACC.com;*
184 $ open/append test_script BYACC.com
185 $ write test_script "$ temp = f$environment(""procedure"")"
186 $ write test_script "$ temp = temp -"
187 $ write test_script " - f$parse(temp,,,""version"",""syntax_only"") -"
188 $ write test_script " - f$parse(temp,,,""type"",""syntax_only"")"
189 $ write test_script "$ BYACC :== $ 'temp'.exe"
190 $ write test_script "$ define/user_mode sys$input sys$command"
191 $ write test_script "$ define/user_mode sys$output sys$command"
192 $ write test_script "$ BYACC 'p1 'p2 'p3 'p4 'p5 'p6 'p7 'p8"
194 $ write sys$output "** made BYACC.com"
198 $ mms/ignore=warning/macro=('comp','mmstar','arch') 'p3
202 $ if f$search("''p1'.obj") .eqs. ""
204 $ write sys$output "compiling ''p1'"
206 $ if f$search("''p1'.dia") .nes. "" then delete 'p1.dia;*