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