Debian Codegraph @

vmsbuild.com

raw
1 $! $Id: vmsbuild.com,v 1.20 2024/10/07 00:14:17 tom Exp $
2 $! VMS build-script for VTTEST. Requires installed C compiler
3 $!
4 $! Tested with:
5 $! VMS system version 5.4-2
6 $! VAX-C version 3.2
7 $!
8 $! Build the option-file
9 $!
10 $ open/write optf vms_link.opt
11 $ write optf "Identification=""VtTest 2.7"""
12 $ write optf "charsets.obj"
13 $ write optf "color.obj"
14 $ write optf "draw.obj"
15 $ write optf "esc.obj"
16 $ write optf "keyboard.obj"
17 $ write optf "mouse.obj"
18 $ write optf "nonvt100.obj"
19 $ write optf "printer.obj"
20 $ write optf "replay.obj"
21 $ write optf "reports.obj"
22 $ write optf "reset.obj"
23 $ write optf "setup.obj"
24 $ write optf "sixel.obj"
25 $ write optf "status.obj"
26 $ write optf "tek4014.obj"
27 $ write optf "utf8.obj"
28 $ write optf "vms_io.obj"
29 $ write optf "vt220.obj"
30 $ write optf "vt320.obj"
31 $ write optf "vt420.obj"
32 $ write optf "vt52.obj"
33 $ write optf "vt520.obj"
34 $ write optf "xterm.obj"
35 $!
36 $! Look for the compiler used
37 $!
38 $ CC = "CC"
39 $ arch = "UNKNOWN"
40 $!
41 $ if f$getsyi("ARCH_NAME") .eqs. "Alpha"
42 $ then
43 $ arch = "__alpha__=1"
44 $ comp = "__decc__=1"
45 $ CFLAGS = "/prefix=all"
46 $ DEFS = "HAVE_ALARM"
47 $ if f$trnlnm("SYS").eqs."" then define sys sys$library:
48 $ endif
49 $!
50 $ if f$getsyi("ARCH_NAME") .eqs. "IA64"
51 $ then
52 $ arch = "__ia64__=1"
53 $ comp = "__decc__=1"
54 $ CFLAGS = "/prefix=all"
55 $ DEFS = "HAVE_ALARM,USE_IEEE_FLOAT"
56 $ if f$trnlnm("SYS").eqs."" then define sys sys$library:
57 $ endif
58 $!
59 $ if f$getsyi("ARCH_NAME") .eqs. "VAX"
60 $ then
61 $ arch = "__vax__=1"
62 $ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs.""
63 $ then
64 $ if f$trnlnm("SYS").eqs."" then define sys sys$library:
65 $ DEFS = "HAVE_SYS_ERRLIST"
66 $ write optf "sys$library:vaxcrtl.exe/share"
67 $ if f$search("SYS$SYSTEM:VAXC.EXE").eqs.""
68 $ then
69 $ if f$trnlnm("GNU_CC").eqs.""
70 $ then
71 $ write sys$output "C compiler required to rebuild vttest"
72 $ close optf
73 $ exit
74 $ else
75 $ write optf "gnu_cc:[000000]gcclib.olb/lib"
76 $ comp = "__gcc__=1"
77 $ CC = "GCC"
78 $ endif
79 $ else
80 $ comp = "__vaxc__=1"
81 $ endif
82 $ else
83 $ if f$trnlnm("SYS").eqs."" then define sys decc$library_include:
84 $ comp = "__decc__=1"
85 $ endif
86 $ endif
87 $
88 $ if "''arch'" .eqs. "UNKNOWN"
89 $ then
90 $ write sys$output "Cannot determine architecture type"
91 $ exit 1
92 $ endif
93 $
94 $ close optf
95 $
96 $! used /G_FLOAT with vaxcrtlg/share in vms_link.opt
97 $! can also use /Debug /Listing, /Show=All
98 $
99 $! -------------- vms_link.opt is created -------------
100 $ if f$edit("''p1'", "UPCASE") .eqs. "VMS_LINK.OPT"
101 $ then
102 $! mms called this script to build vms_link.opt. all done
103 $ exit
104 $ endif
105 $
106 $ if f$search("SYS$SYSTEM:MMS.EXE").eqs.""
107 $ then
108 $
109 $ CFLAGS := 'CFLAGS/Diagnostics /Define=("''DEFS'") /Include=([])
110 $
111 $ if "''p1'" .nes. "" then goto 'p1
112 $
113 $ all :
114 $ call make charsets
115 $ call make color
116 $ call make draw
117 $ call make esc
118 $ call make keyboard
119 $ call make main
120 $ call make mouse
121 $ call make nonvt100
122 $ call make printer
123 $ call make replay
124 $ call make reports
125 $ call make reset
126 $ call make setup
127 $ call make sixel
128 $ call make status
129 $ call make tek4014
130 $ call make utf8
131 $ call make vt220
132 $ call make vt320
133 $ call make vt420
134 $ call make vt52
135 $ call make vt520
136 $ call make vms_io
137 $ call make xterm
138 $
139 $ link /exec=VTTEST/map/cross main.obj, vms_link/opt
140 $ goto build_last
141 $
142 $ install :
143 $ WRITE SYS$ERROR "** no rule for install"
144 $ goto build_last
145 $
146 $ clean :
147 $ if f$search("*.obj") .nes. "" then delete *.obj;*
148 $ if f$search("*.bak") .nes. "" then delete *.bak;*
149 $ if f$search("*.lis") .nes. "" then delete *.lis;*
150 $ if f$search("*.log") .nes. "" then delete *.log;*
151 $ if f$search("*.map") .nes. "" then delete *.map;*
152 $ if f$search("*.opt") .nes. "" then delete *.opt;*
153 $ goto build_last
154 $
155 $ clobber :
156 $ if f$search("vttest.com") .nes. "" then delete vttest.com;*
157 $ if f$search("*.exe") .nes. "" then delete *.exe;*
158 $ goto build_last
159 $
160 $ build_last :
161 $ if f$search("*.dia") .nes. "" then delete *.dia;*
162 $ if f$search("*.lis") .nes. "" then purge *.lis
163 $ if f$search("*.obj") .nes. "" then purge *.obj
164 $ if f$search("*.map") .nes. "" then purge *.map
165 $ if f$search("*.opt") .nes. "" then purge *.opt
166 $ if f$search("*.exe") .nes. "" then purge *.exe
167 $ if f$search("*.log") .nes. "" then purge *.log
168 $ exit
169 $
170 $ vms_link_opt :
171 $ exit 1
172 $!
173 $! Runs VTTEST from the current directory (used for testing)
174 $ vttest_com :
175 $ if "''f$search("vttest.com")'" .nes. "" then delete vttest.com;*
176 $ copy nl: vttest.com
177 $ open/append test_script vttest.com
178 $ write test_script "$ temp = f$environment(""procedure"")"
179 $ write test_script "$ temp = temp -"
180 $ write test_script " - f$parse(temp,,,""version"",""syntax_only"") -"
181 $ write test_script " - f$parse(temp,,,""type"",""syntax_only"")"
182 $ write test_script "$ vttest :== $ 'temp'.exe"
183 $ write test_script "$ define/user_mode sys$input sys$command"
184 $ write test_script "$ define/user_mode sys$output sys$command"
185 $ write test_script "$ vttest 'p1 'p2 'p3 'p4 'p5 'p6 'p7 'p8"
186 $ close test_script
187 $ write sys$output "** made vttest.com"
188 $ exit
189 $!
190 $! We have MMS installed
191 $ else
192 $ mms/macro=('comp','arch') 'p1
193 $ endif
194 $ exit
195 $
196 $ make: subroutine
197 $ if f$search("''p1'.obj") .eqs. ""
198 $ then
199 $ write sys$output "compiling ''p1'"
200 $ 'CC 'CFLAGS 'p1.c
201 $ if f$search("''p1'.dia") .nes. "" then delete 'p1.dia;*
202 $ endif
203 $ exit
204 $ endsubroutine