File: make.com

package info (click to toggle)
ctwm 3.7-3.3
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 6,420 kB
  • ctags: 3,180
  • sloc: ansic: 26,429; yacc: 1,004; lex: 147; makefile: 55; sh: 32
file content (483 lines) | stat: -rw-r--r-- 15,837 bytes parent folder | download | duplicates (5)
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
$! Make.com for building CTWM
$ SAVE_VERIFY='F$VERIFY(0)
$!
$!	Compile the CTWM Window Manager
$!
$!--------------------------- Customization -------------------------------
$!  Define logicals pointing to the needed directories
$!
$! this is where the Xmu include files are held,
$!  usually in sys$sysroot:[decw$include.xmu]
$ define/nolog x11xmu sys$sysroot:[decw$include.xmu]
$
$! the file spec. of the Xmu library.
$ define/nolog x11xmulib "SYS$SHARE:DECW$XMULIBSHR/share"
$
$! where the xpm object library is.
$ define/nolog xpmlib pd:[src.xpm-3_4e]
$
$! ctwm exit style:
$!	0 - Just exit with error code 20.
$!	1 - run sys$system:decw$endsession.exe on exit
$ EXIT_ENDSESSION = 0
$
$!------------------------ End of Customization ---------------------------
$!
$ if p1 .Eqs. "CLEAN" then goto clean
$ if p1 .Eqs. "CLOBBER" then goto clobber
$
$! Sanity check!				suggested by Michael Lemke
$ if f$search("XPM.H") .eqs. ""
$ then
$     write sys$output "Hey, you there!  Read README.VMS!  It says that you have to copy XPM.H"
$     write sys$output "from somewhere, like a XPM library distribution!  I can't work without it,"
$     write sys$output "so I'll quit for now."
$     exit
$ endif
$ FAKE_XPMLIB:=you:[must.define.this.in]
$ l=f$trnlnm("XPMLIB")
$ if l - (FAKE_XPMLIB+"make.com") .nes. l
$ then
$     write sys$output "You must change the definition of XPMLIB in MAKE.COM."
$     exit
$ endif
$
$ FLEX = FLEX
$ Set Symbol/Scope=NoGlobal
$ if p1 .Eqs. "LINK"
$ then
$     link_options = "/NOTRACE"
$     __axp = f$getsyi("CPU") .ge. 128
$     __decc = f$search("SYS$SHARE:DECC$SHR.EXE") .nes. ""
$
$     EXT = "VAX_"
$     if __axp then EXT = "AXP_"
$     OPT_EXT = "DECC_OPT"
$     CLIB = ""
$     if .not. __axp .and (.not. __decc .or. f$search("*.''EXT'OBJ") .eqs. "")
$     then
$	  OPT_EXT = "VAXC_OPT"
$	  EXT = EXT + "VAXC_"
$	  CLIB := SYS$SHARE:VAXCRTL/SHARE
$     endif
$     if f$search("*.''EXT'OBJ") .eqs. ""
$     then
$	  write sys$output "Sorry, but the object files I need are missing."
$	  write sys$output "You need to compile them first.  Read README.VMS"
$	  write sys$output "for further instructions"
$	  exit
$     endif
$     Goto Link
$ endif
$!
$! Establish the Compiling Environment
$!
$ COPTS = F$TrnLnm("COPTS")
$ extra_defs = ""
$ CLIB = ""
$ Cpu_Model = F$GetSYI("HW_MODEL")
$ If Cpu_Model .gt. 1024	! Cross compiling
$ Then
$	CC := CC/PREFIX=ALL/L_DOUBLE=64
$	OPT_EXT = "DECC_OPT"
$	EXT = "AXP_"
$ Else
$	write sys$error "Ignore the possible %DCL-W-IVQUAL or %CC-W-EMPTYFILE"
$	CC := CC/PREFIX=ALL
$	OPT_EXT = "DECC_OPT"
$	EXT = "VAX_"
$	CLIB = ""
$	Set Noon
$	CC NL:/OBJ=NL:
$	If $status .eq. %x00038240
$	Then	! no DEC C or the standard is to run VAX C
$		CC := CC/DECC/PREFIX=ALL
$		CC NL:/OBJ=NL:
$		If $status .eq. %x00038240
$		Then	! no DEC C, meaning VAX C without the /VAXC qualifier
$			CC := CC
$			OPT_EXT = "VAXC_OPT"
$			EXT = "VAX_VAXC_"
$			CLIB = "SYS$SHARE:VAXCRTL/SHARE"
$			extra_defs = extra_defs + ",NO_LOCALE"
$		Endif
$	Endif
$	write sys$error "There, you can look again now..."
$ Endif
$ 
$ ! This is a pure hack to circumvent a bug in the file provided by
$ ! Digital.  This is so ugly we don't want the user to see what
$ ! really happens.
$ ! But perhaps we'll give him just a little hint, huh?  :-)
$ write sys$output "Doing some hackery with XWDFile.h...  Sit tight"
$ DEP_XWDFILE = ""
$ if f$search("DECW$UTILS:XWDFILE.H") .nes. "" 
$ then
$     open/write foo xwdfile.tpu_tmp
$     write foo "input_file:=GET_INFO(COMMAND_LINE, ""file_name"");"
$     write foo "main_buffer := CREATE_BUFFER (""main"", input_file);"
$     write foo "position (beginning_of (main_buffer));"
$     write foo "loop"
$     write foo "	r := search_quietly (""""""copyright.h"""""", FORWARD);"
$     write foo "	EXITIF r = 0;"
$     write foo "	if beginning_of(r) <> end_of(r)"
$     write foo "	then"
$     write foo "		erase (r);"
$     write foo "		position (r);"
$     write foo "		copy_text (""<decw$utils/copyright.h>"");"
$     write foo "	endif;"
$     write foo "	position (end_of (r));"
$     write foo "endloop;"
$     write foo "position (beginning_of (main_buffer));"
$     write foo "loop"
$     write foo "	r := search_quietly (LINE_BEGIN + ""struct {"", FORWARD);"
$     write foo "	EXITIF r = 0;"
$     write foo "	if beginning_of(r) <> end_of(r)"
$     write foo "	then"
$     write foo "		erase (r);"
$     write foo "		position (r);"
$     write foo "		copy_text (""typedef struct {"");"
$     write foo "	endif;"
$     write foo "	position (end_of (r));"
$     write foo "endloop;"
$     write foo "write_file(main_buffer, get_info (command_line, ""output_file""));"
$     write foo "quit;"
$     close foo
$     save_mesg = f$environment("MESSAGE")
$     !set message/nofacility/noidentification/noseverity/notext
$     edit/tpu/nosection/nodisplay -
		/command=xwdfile.tpu_tmp/out=xwdfile.h -
		decw$utils:xwdfile.h
$     purge xwdfile.h
$     delete xwdfile.tpu_tmp;*
$     set message'save_mesg'
$     DEP_XWDFILE = "XWDFILE.H"
$     write sys$output "There, done."
$ endif
$
$ if f$search("xwdfile.h") .nes. "" then -
     extra_defs = extra_defs + ",HAVE_XWDFILE_H"
$!
$!  Get the compiler options via the logical name COPTS
$!
$ cc_options = COPTS + -
	       "/define=(VMS,XPM,X11R6,C_ALLOCA,""emacs"",BLOCK_INPUT," + -
	       "EXIT_ENDSESSION=''EXIT_ENDSESSION'''extra_defs')" + -
	       "/OBJ=.''EXT'OBJ"
$!
$!  Get the linker options via the logical name LOPTS
$!
$ link_options = f$trnlnm("LOPTS")
$!
$!  Compile the "C" files
$!
$! procedure target	command 			depends upon
$! CALL MAKE FILE.OBJ	"CC ''cc_options' FILE.C"	FILE.C
$!
$ write sys$output "Building LEX.C from LEX.L using flex"
$ CALL MAKE LEX.C		"FLEX LEX.L" -
       LEX.L
$ if f$search("LEXYY.C") .nes. ""
$ then
$     CALL MAKE LEX.C -
	   "RENAME LEXYY.C LEX.C/LOG" -
	   LEXYY.C
$ else
$     CALL MAKE LEX.C -
	   "COPY LEX.C_VMS LEX.C/LOG" -
	   LEX.C_VMS
$ endif
$ write sys$output -
	"Building GRAM.C and GRAM.H from GRAM.Y using bison/def/yacc"
$ CALL MAKE Y_TAB.C		"BISON /DEF/YACC GRAM.Y"	GRAM.Y
$ if f$search("Y_TAB.C") .nes. ""
$ then
$     CALL MAKE GRAM.C -
	   "RENAME Y_TAB.C GRAM.C/LOG; RENAME Y_TAB.H GRAM.H/LOG" -
	   Y_TAB.C Y_TAB.H
$ else
$     CALL MAKE GRAM.C -
	   "COPY GRAM.C_VMS GRAM.C/LOG; COPY GRAM.H_VMS GRAM.H/LOG" -
	   GRAM.C_VMS GRAM.H_VMS
$ endif
$ CALL MAKE GRAM.H		-
       "BISON /DEF/YACC GRAM.Y; DELETE Y_TAB.C.*" -
       GRAM.Y
$ if f$search("Y_TAB.H") .nes. ""
$ then
$     CALL MAKE GRAM.H -
	   "RENAME Y_TAB.H GRAM.H/LOG" -
	   Y_TAB.H
$ else
$     CALL MAKE GRAM.H -
	   "COPY GRAM.H_VMS GRAM.H/LOG" -
	   GRAM.H_VMS
$ endif
$ write sys$output -
	"Building DEFTWMRC.C from SYSTEM.CTWMRC using GENDEFTWMRC.COM"
$ CALL MAKE DEFTWMRC.C		"@GENDEFTWMRC.COM"		SYSTEM.CTWMRC -
       GENDEFTWMRC.COM
$ write sys$output "Compiling CTWM sources with CC=",CC
$ CALL MAKE ADD_WINDOW.'EXT'OBJ "CC 'cc_options' ADD_WINDOW.C"	ADD_WINDOW.C -
       "TWM.H ADD_WINDOW.H UTIL.H RESIZE.H PARSE.H GRAM.H LIST.H EVENTS.H" -
       "MENUS.H SCREEN.H ICONS.H ICONMGR.H" -
       "LIST.H MENUS.H ICONMGR.H VSCREEN.H WORKMGR.H"
$ CALL MAKE CLICKTOFOCUS.'EXT'OBJ-
			"CC 'cc_options' CLICKTOFOCUS.C" CLICKTOFOCUS.C -
       "CLICKTOFOCUS.H TWM.H UTIL.H SCREEN.H" -
       "LIST.H MENUS.H ICONMGR.H VSCREEN.H WORKMGR.H"
$ CALL MAKE CTWM.'EXT'OBJ  	"CC 'cc_options' CTWM.C"	CTWM.C -
       "TWM.H ADD_WINDOW.H GC.H PARSE.H VERSION.H MENUS.H EVENTS.H UTIL.H" -
       "GRAM.H SCREEN.H ICONS.H ICONMGR.H" -
       "LIST.H MENUS.H ICONMGR.H VSCREEN.H WORKMGR.H"
$ CALL MAKE CURSOR.'EXT'OBJ  	"CC 'cc_options' CURSOR.C"	CURSOR.C -
       "TWM.H SCREEN.H UTIL.H" -
       "LIST.H MENUS.H ICONMGR.H VSCREEN.H WORKMGR.H"
$ CALL MAKE DEFTWMRC.'EXT'OBJ  	"CC 'cc_options' DEFTWMRC.C"	DEFTWMRC.C
$ CALL MAKE EVENTS.'EXT'OBJ  	"CC 'cc_options' EVENTS.C"	EVENTS.C -
       "TWM.H ADD_WINDOW.H MENUS.H EVENTS.H RESIZE.H PARSE.H GRAM.H UTIL.H" -
       "SCREEN.H ICONS.H ICONMGR.H VERSION.H" -
       "LIST.H MENUS.H ICONMGR.H VSCREEN.H WORKMGR.H"
$ CALL MAKE GC.'EXT'OBJ  	"CC 'cc_options' GC.C"	GC.C -
       "TWM.H UTIL.H GRAM.H SCREEN.H" -
       "LIST.H MENUS.H ICONMGR.H VSCREEN.H WORKMGR.H"
$ CALL MAKE GRAM.'EXT'OBJ  	"CC 'cc_options' GRAM.C"	GRAM.C -
       "TWM.H MENUS.H ICONS.H ADD_WINDOW.H LIST.H UTIL.H SCREEN.H PARSE.H" -
       "LIST.H MENUS.H ICONMGR.H VSCREEN.H WORKMGR.H"
$ CALL MAKE ICONMGR.'EXT'OBJ  	"CC 'cc_options' ICONMGR.C"	ICONMGR.C -
       "TWM.H UTIL.H PARSE.H SCREEN.H RESIZE.H ADD_WINDOW.H SICONIFY.BM" -
       "LIST.H MENUS.H ICONMGR.H VSCREEN.H WORKMGR.H"
$ CALL MAKE ICONS.'EXT'OBJ  	"CC 'cc_options' ICONS.C"	ICONS.C -
       "TWM.H SCREEN.H ICONS.H GRAM.H LIST.H PARSE.H UTIL.H" -
       "LIST.H MENUS.H ICONMGR.H VSCREEN.H WORKMGR.H"
$ CALL MAKE LEX.'EXT'OBJ  	"CC 'cc_options' LEX.C"	LEX.C -
       "GRAM.H PARSE.H"
$ CALL MAKE LIST.'EXT'OBJ  	"CC 'cc_options' LIST.C"	LIST.C -
       "TWM.H SCREEN.H GRAM.H UTIL.H" -
       "LIST.H MENUS.H ICONMGR.H VSCREEN.H WORKMGR.H"
$ CALL MAKE MENUS.'EXT'OBJ  	"CC 'cc_options' MENUS.C"	MENUS.C -
       "TWM.H GC.H MENUS.H RESIZE.H EVENTS.H UTIL.H PARSE.H GRAM.H SCREEN.H" -
       "ICONS.H VMS_CMD_SERVICE.H VERSION.H" -
       "LIST.H MENUS.H ICONMGR.H VSCREEN.H WORKMGR.H"
$ CALL MAKE PARSE.'EXT'OBJ  	"CC 'cc_options' PARSE.C"	PARSE.C -
       "TWM.H SCREEN.H MENUS.H UTIL.H GRAM.H PARSE.H VERSION.H" -
       "LIST.H MENUS.H ICONMGR.H VSCREEN.H WORKMGR.H"
$ CALL MAKE RESIZE.'EXT'OBJ  	"CC 'cc_options' RESIZE.C"	RESIZE.C -
       "TWM.H PARSE.H UTIL.H RESIZE.H ADD_WINDOW.H SCREEN.H" -
       "LIST.H MENUS.H ICONMGR.H VSCREEN.H WORKMGR.H"
$ CALL MAKE UTIL.'EXT'OBJ  	"CC 'cc_options' UTIL.C"	UTIL.C -
       "TWM.H UTIL.H GRAM.H SCREEN.H ICONS.H XPM.H SICONIFY.BM" -
       "LIST.H MENUS.H ICONMGR.H VSCREEN.H WORKMGR.H ''DEP_XWDFILE'"
$ CALL MAKE VERSION.'EXT'OBJ  	"CC 'cc_options' VERSION.C"	VERSION.C
$ CALL MAKE VSCREEN.'EXT'OBJ  	"CC 'cc_options' VSCREEN.C"	VSCREEN.C -
       "TWM.H SCREEN.H" -
       "LIST.H MENUS.H ICONMGR.H VSCREEN.H WORKMGR.H"
$ CALL MAKE WORKMGR.'EXT'OBJ  	"CC 'cc_options' WORKMGR.C"	WORKMGR.C -
       "TWM.H UTIL.H PARSE.H SCREEN.H ICONS.H RESIZE.H ADD_WINDOW.H EVENTS.H" -
       "GRAM.H CLICKTOFOCUS.H" -
       "LIST.H MENUS.H ICONMGR.H VSCREEN.H WORKMGR.H"
$ CALL MAKE WINDOWBOX.'EXT'OBJ 	"CC 'cc_options' WINDOWBOX.C"	WINDOWBOX.C -
       "TWM.H SCREEN.H WINDOWBOX.H" -
       "LIST.H MENUS.H ICONMGR.H VSCREEN.H WORKMGR.H"
$ CALL MAKE VMS_CMD_SERVICES.'EXT'OBJ "CC 'cc_options' VMS_CMD_SERVICES.C" -
       VMS_CMD_SERVICES.C VMS_CMD_SERVICES.H LNM.H
$ CALL MAKE LNM.'EXT'OBJ	"CC 'cc_options' LNM.C"	LNM.C
$ CALL MAKE ALLOCA.'EXT'OBJ	"CC 'cc_options' ALLOCA.C"	ALLOCA.C
$!
$ Link:		! Link the executable.  If all object files aren't here,
$		! I'm deeply sorry
$ EXE_EXT = EXT - "VAXC_"
$ OPTION := CTWM.'OPT_EXT'
$ OPTION_CMD := ,CTWM.'OPT_EXT'/OPT
$
$ CALL MAKE VERSION.OPT		"CALL MAKEVEROPT VERSION.OPT"	VERSION.C -
       MAKE.COM
$ CALL MAKE 'OPTION'		"CALL MAKELIBOPT ''OPTION' ''F$TRNLNM("X11XMULIB")' ''CLIB'" -
       MAKE.COM
$ CALL MAKE OBJS.'EXT'OPT	"CALL MAKEOBJOPT OBJS.''EXT'OPT *.''EXT'OBJ" -
       *.'EXT'OBJ MAKE.COM
$ write sys$output "Building CTWM image"
$ CALL MAKE CTWM.'EXE_EXT'EXE	-
       "LINK ''link_options'/EXE=CTWM.''EXE_EXT'EXE OBJS.''EXT'OPT/OPT,VERSION.OPT/OPT ''OPTION_CMD'" -
       OBJS.'EXT'OPT 'OPTION' VERSION.OPT
$!
$ deassign xpmlib
$ deassign x11xmu
$
$ write sys$output "All done"
$!
$ exit
$!
$ Clobber:	! Delete executables, Purge directory and clean up object files and listings
$ Delete/noconfirm/log *.exe;*
$!
$ Clean:	! Purge directory, clean up object files and listings
$ Purge
$ Delete/noconfirm/log *.lis;*
$ Delete/noconfirm/log *.obj;*
$!
$ exit
$!
$MAKE: SUBROUTINE   !SUBROUTINE TO CHECK DEPENDENCIES
$ V = 'F$Verify(0)
$! P1 = What we are trying to make
$! P2 = Command to make it
$! P3 - P8  What it depends on
$
$ If F$Search(P1) .Eqs. "" Then Goto Makeit
$ Time = F$CvTime(F$File(P1,"RDT"))
$arg=3
$Loop:
$	Argument = P'arg
$	If Argument .Eqs. "" Then Goto NoWork
$	El=0
$Loop2:
$	File = F$Element(El," ",Argument)
$	If File .Eqs. " " Then Goto Endl
$	AFile = ""
$Loop3:
$	OFile = AFile
$	AFile = F$Search(File)
$	If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
$	If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
$	Goto Loop3
$NextEL:
$	El = El + 1
$	Goto Loop2
$EndL:
$ arg=arg+1
$ If arg .Le. 8 Then Goto Loop
$NoWork: 
$ Goto Exit
$
$BailOut:
$ tmp = $status ! 'F$Verify(0)
$ If V Then Set Verify
$ write sys$error "Exiting with status code ",tmp
$ Exit tmp
$KillMe: 
$ If V Then Set Verify
$ write sys$error -
	"Exiting because user pressed Ctrl-Y (we do this the ugly way)"
$ Exit 20
$Makeit:
$ On Error Then Goto BailOut
$ On Control_y Then Goto KillMe
$ _Index = 0
$Makeit2:
$ _Command = F$Edit(F$Element(_Index,";",P2),"TRIM")
$ _Index = _Index + 1
$ If _Command .nes. ";"
$ Then
$     If F$Edit(F$Extract(0,5,_Command),"UPCASE") .nes. "CALL " Then Set Verify
$     '_Command
$     VV='F$Verify(0)
$     Goto Makeit2
$ Endif
$Exit:
$ If V Then Set Verify
$ENDSUBROUTINE
$
$MAKELIBOPT: SUBROUTINE   !SUBROUTINE TO BUILD A LIBRARY OPTIONS FILE
$ V = 'F$Verify(0)
$ goto Makeit2
$BailOut2:
$ tmp = $status ! 'F$Verify(0)
$ close foo
$ If V Then Set Verify
$ write sys$error "Exiting with status code ",tmp
$ Exit tmp
$Makeit2:
$ On Error Then Goto BailOut2
$ On Control_y Then Goto BailOut2
$ write sys$output "Building the library option file ",P1
$ if p3 .nes. "" then write foo p3
$ __result := XPMLIB:XPM.OLB
$ if f$search(__result) .eqs. "" then -
     __result := XPMLIB:LIBXPM.OLB
$ if EXT .eqs. "VAX_VAXC_" .and. -
     f$search("XPMLIB:LIBXPM.OLB_VAXC") .nes. "" then -
     __result := XPMLIB:LIBXPM.OLB_VAXC
$ if EXT .eqs. "VAX_" .and. -
     f$search("XPMLIB:LIBXPM.OLB_DECC") .nes. "" then -
     __result := XPMLIB:LIBXPM.OLB_DECC
$ if EXT .eqs. "AXP_" .and. -
     f$search("XPMLIB:LIBXPM.OLB_AXP") .nes. "" then -
     __result := XPMLIB:LIBXPM.OLB_AXP
$ if f$search(__result) .eqs. "" then -
     libr/list=nl: '__result'
$ open/write foo 'P1'
$ write foo __result,"/LIB"
$ write foo p2
$ write foo "SYS$SHARE:DECW$XTSHR/SHARE"
$ write foo "SYS$SHARE:DECW$XEXTLIBSHR/SHARE"
$ write foo "SYS$SHARE:DECW$XLIBSHR/SHARE"
$ VV='F$Verify(0)
$Exit2:
$ close foo
$ If V Then Set Verify
$ENDSUBROUTINE
$
$MAKEVEROPT: SUBROUTINE   !SUBROUTINE TO BUILD AN IDENTITY OPTIONS FILE
$ V = 'F$Verify(0)
$ goto Makeit3
$BailOut3:
$ tmp = $status ! 'F$Verify(0)
$ close foo
$ If V Then Set Verify
$ write sys$error "Exiting with status code ",tmp
$ Exit tmp
$Makeit3:
$ On Error Then Goto BailOut3
$ On Control_y Then Goto BailOut3
$ write sys$output "Building the identity option file VERSION.OPT
$ sear version.c "*VersionNumber"/out=version.tmp
$ open/read foo version.tmp
$ read foo line
$ close foo
$ delete version.tmp;*
$ version = f$extract(0,10,f$element(1,"""",line))
$ open/write foo 'p1'
$ write foo "NAME=""CTWM"""
$ write foo "IDENT=""V''version'"""
$ VV='F$Verify(0)
$Exit3:
$ close foo
$ If V Then Set Verify
$ENDSUBROUTINE
$
$MAKEOBJOPT: SUBROUTINE   !SUBROUTINE TO BUILD AN IDENTITY OPTIONS FILE
$ V = 'F$Verify(0)
$ goto OBJ_Makeit
$OBJ_BailOut:
$ tmp = $status ! 'F$Verify(0)
$ close foo
$ If V Then Set Verify
$ write sys$error "Exiting with status code ",tmp
$ Exit tmp
$OBJ_Makeit:
$ On Error Then Goto OBJ_BailOut
$ On Control_y Then Goto OBJ_BailOut
$ write sys$output "Building object option file ",p1
$ open/write foo 'p1'
$ OFile = ""
$OBJ_Loop:
$ AFile = F$Search(P2)
$! DEBUG: P2 = 'P2'
$! DEBUG: AFile = 'AFile'
$ if OFile .nes. ""
$ then
$     if AFile .nes. ""
$     then
$	  write foo OFile,",-"
$     else
$	  write foo OFile
$     endif
$ endif
$ OFile = F$Parse(AFile,,,"NAME") + F$Parse(AFile,,,"TYPE")
$ if AFile .nes. "" then goto OBJ_Loop
$ VV='F$Verify(0)
$OBJ_Exit:
$ close foo
$ If V Then Set Verify
$ENDSUBROUTINE