File: configure.vms

package info (click to toggle)
gnuplot 4.0.0-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 9,396 kB
  • ctags: 6,623
  • sloc: ansic: 63,562; lisp: 5,011; cpp: 970; sh: 900; makefile: 756; objc: 647; asm: 539; csh: 297; awk: 235; pascal: 192; perl: 44
file content (635 lines) | stat: -rwxr-xr-x 20,472 bytes parent folder | download | duplicates (3)
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
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
$ ! CONFIGURE.VMS -- configure command file for VMS
$ !
$ ! Writen by John.Hasstedt@sunysb.edu.  This command file creates config.h
$ ! and either a make file or a command file.  These files are based on the
$ ! makefile.vms and buildvms.com files distributed with previous versions
$ ! of gnuplot.
$ !
$ ! Options are specified on the command line.  I just set symbols on the
$ ! command line to 1.  This is rather crude, but it works.
$ !
$ ! The options are:
$ !
$ ! DECC, GNUC, VAXC -- The compiler.  I have only tested this with DECC.
$ ! MMS, MMK, MAK, COM -- The build procedure.  If you specify MMS or MMK,
$ !    you get DESCRIP.MMS in the [.SRC] directory; if you specify MAK,
$ !    you get MAKEFILE. in the [.SRC] directory; if you specify COM, you
$ !    get BUILD.COM in the [.SRC] directory.
$ ! DECC$CRTL -- Use the DECC$CRTL backport library.  See
$ !    SYS$LIBRARY:DECC$CRTL.README for information on it.
$ ! READLINE -- Use the included readline function.
$ ! USE_MOUSE -- Include the mouse code
$ !
$ ! For example,
$ !     @CONFIGURE.VMS GNUC MAK
$ ! will create [.SRC]MAKEFILE. with commands for building with GNUC.
$ !
$ ! makefile.vms had the comments:
$ ! -------------------------------------------------------------------------
$ ! use with the MAKE that was posted by Tony Ivanov (tony@gvgpvd.GVG.TEK.COM)
$ ! in comp.os.vms on 5 December 1988
$ !
$ ! Modified 23 June 1999 to work with MMK; it should also work with MMS.
$ ! John.Hasstedt@sunysb.edu.
$ ! -------------------------------------------------------------------------
$ !
$ ! buildvms.com had the comment:
$ ! -------------------------------------------------------------------------
$ ! lph: modified for compatibility with VMS 4.x (which lacks 'if ... endif'),
$ ! but made the default DECC
$ ! -------------------------------------------------------------------------
$ !
$ ! I have tried to maintain compatibility with V4.x--I have not used
$ ! 'if ... endif' or 'gosub'; however, I do not have a V4.x system to test
$ ! it on.
$ !
$ ! The comments below are from buildvms.com about defining CFLAGS on
$ ! different platforms.  If you have problems compiling, these comments
$ ! may help.  If you need to change CFLAGS, you can change it below, or
$ ! you can change it in the make file this file generates.  Most of the
$ ! defines are not necessary because I now use config.h.
$ !
$ !-----------------------------------------------------------------
$ ! A generic starting point
$ !
$ !$ CFLAGS = "/NOWARN/NOOP/DEFINE=(''x11'NO_GIH,PIPES,''rtl')''pfix'"
$ !
$ ! ----------------------------------------------------------------
$ !
$ ! For  VMS 4.7 and VAX C v2.4
$ ! ("Compiler abort - virtual memory limits exceeded" if attempt
$ !  to include all applicable terminals, but otherwise builds OK.
$ !  Runtime problem: an exit handler error, also w/ gcc build;
$ !  a VAXCRTL atexit bug?)
$ !
$ ! Note: VAX uses  D_FLOAT, maximum exponent ca 10e +/- 38;
$ !       will cause problems with some of the demos
$ !
$ !$ CFLAGS    = "/NOOP/DEFINE=(HAVE_GETCWD, HAVE_SLEEP, "-
$ !               +"SHORT_TERMLIST, NO_GIH,PIPES, ''rtl')"
$ !$ !
$ !
$ !-----------------------------------------------------------------
$ !
$ ! This will build with gcc v1.42 on VMS 4.7
$ ! (no virtual memory limit problem)
$ !
$ ! gcc v1.42 string.h can prefix str routines w/ gnu_ (ifdef GCC_STRINGS)
$ ! but the routines in GCCLIB are not prefixed w/ gcc_  :-(
$ ! link with GCCLIB, then ignore the link warnings about multiple
$ ! definitions of STR... in C$STRINGS
$ !
$ ! GCC v1.42 has a locale.h, but neither gcc nor VMS v4.7 VAXCRTL has
$ ! the  setlocale function
$ !
$ !
$ ! Note: _assert.c defines assert_gcc, if ndef NDEBUG, but
$ !        cgm.trm undefines NDEBUG, so we always compile/link  _assert.c
$ !
$ !$ CFLAGS    = "/NOOP/DEFINE=(''x11', HAVE_GETCWD,"-
$ !		+" HAVE_SLEEP, NO_GIH, PIPES, ''rtl')"
$ !
$ !-----------------------------------------------------------------
$ VAXC = 0
$ GNUC = 0
$ DECC = 0
$ MMS = 0
$ MMK = 0
$ MAK = 0
$ COM = 0
$ DECC$CRTL = 0
$ READLINE = 0
$ USE_MOUSE = 0
$ !
$ IF (P1 .NES. "") THEN 'P1' = 1
$ IF (P2 .NES. "") THEN 'P2' = 1
$ IF (P3 .NES. "") THEN 'P3' = 1
$ IF (P4 .NES. "") THEN 'P4' = 1
$ IF (P5 .NES. "") THEN 'P5' = 1
$ IF (P6 .NES. "") THEN 'P6' = 1
$ IF (P7 .NES. "") THEN 'P7' = 1
$ IF (P8 .NES. "") THEN 'P8' = 1
$ !
$ ! Get compiler.  I first check if the compiler was specified on the command
$ ! line.  If it wasn't, I check for what compiler is on the system.  If
$ ! there are several options, I use DECC, then GNUC, then VAXC.
$ !
$ COMPILER = ""
$ IF (VAXC) THEN COMPILER = "VAXC"
$ IF (GNUC) THEN COMPILER = "GNUC"
$ IF (DECC) THEN COMPILER = "DECC"
$ IF (COMPILER .NES. "") THEN GOTO HAVECOMPILER
$ VAXC = 1
$ GNUC = F$TRNLNM("GNU_CC") .NES. ""
$ DECC = F$SEARCH("SYS$SYSTEM:DECC$COMPILER.EXE") .NES. ""
$ IF (VAXC) THEN COMPILER = "VAXC"
$ IF (GNUC) THEN COMPILER = "GNUC"
$ IF (DECC) THEN COMPILER = "DECC"
$HAVECOMPILER:
$ !
$ ! Get the make tool.  I first check if the tool was specified on the command
$ ! line.  If it wasn't, I check for what tool is on the system.  If there are
$ ! several options, I use MMS, then MMK, then MAKE, then the command file.
$ !
$ MAKETOOL = ""
$ IF (COM) THEN MAKETOOL = "COM"
$ IF (MAK) THEN MAKETOOL = "MAKE"
$ IF (MMK) THEN MAKETOOL = "MMK"
$ IF (MMS) THEN MAKETOOL = "MMS"
$ IF (MAKETOOL .NES. "") THEN GOTO HAVEMAKETOOL
$ COM = 1
$ MAK = F$TYPE(MAKE) .NES. ""
$ MMK = F$TYPE(MMK) .NES. ""
$ MMS = F$SEARCH("SYS$SYSTEM:MMS.EXE") .NES. ""
$ IF (COM) THEN MAKETOOL = "COM"
$ IF (MAK) THEN MAKETOOL = "MAKE"
$ IF (MMK) THEN MAKETOOL = "MMK"
$ IF (MMS) THEN MAKETOOL = "MMS"
$HAVEMAKETOOL:
$ !
$ ! Check if the system has DECWindows.
$ !
$ DECW = F$TRNLNM("DECW$INCLUDE") .NES. ""
$ !
$ ! Get the architecture.
$ !
$ ALPHA = F$GETSYI("HW_MODEL") .GE. 1024
$ !
$ ! Define symbols for things that vary with compiler:  RTL (run time library),
$ ! DPML (Digital Portable Math Library), and __CRTL_VER (DECC RTL version).
$ !
$ DECC = 0
$ GNUC = 0
$ VAXC = 0
$ GOTO 'COMPILER'
$ !
$DECC:
$ DECC = 1
$ RTL = "DECCRTL"
$ DPML = F$SEARCH("SYS$LIBRARY:DPML$SHR.EXE") .NES. ""
$ IF (DECC$CRTL) THEN DEFINE/NOLOG DECC$CRTLMAP SYS$LIBRARY:DECC$CRTL.EXE
$ EXTRALIB = ""
$ IF (DECC$CRTL) THEN EXTRALIB = ",SYS$LIBRARY:DECC$CRTL.OLB/LIBRARY"
$ CC/OBJECT=DEFINE_CRTL_VER.OBJ SYS$INPUT
      #include <stdlib.h>
      #include <stdio.h>
      #include <descrip.h>
      #include <lib$routines.h>
      #ifndef __CRTL_VER
      #   define __CRTL_VER __VMS_VER
      #endif
      main () {
      static $DESCRIPTOR(crtl,"__CRTL_VER");
      struct dsc$descriptor_s val = {0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0};
      static int tab = {1};
      char str[10];
      val.dsc$w_length = sprintf (str, "%d", __CRTL_VER);
      val.dsc$a_pointer = str;
      exit (lib$set_symbol (&crtl, &val, &tab));
      }
$ LINK/EXECUTABLE=DEFINE_CRTL_VER.EXE DEFINE_CRTL_VER.OBJ'EXTRALIB'
$ RUN DEFINE_CRTL_VER.EXE
$ DELETE/NOCONFIRM/NOLOG DEFINE_CRTL_VER.OBJ;*,DEFINE_CRTL_VER.EXE;*
$ IF (DECC$CRTL) THEN DEASSIGN DECC$CRTLMAP
$ __CRTL_VER = F$INTEGER(__CRTL_VER)
$ GOTO COMPILERDONE
$ !
$GNUC:
$ GNUC = 1
$ IF (ALPHA) THEN RTL = "DECCRTL"
$ IF (.NOT. ALPHA) THEN RTL = "VAXCRTL"
$ IF (ALPHA) THEN DPML = F$SEARCH("SYS$LIBRARY:DPML$SHR.EXE") .NES. ""
$ IF (.NOT. ALPHA) THEN DPML = 0
$ __CRTL_VER = 0
$ GOTO COMPILERDONE
$ !
$VAXC:
$ VAXC = 1
$ RTL = "VAXCRTL"
$ DPML = 0
$ __CRTL_VER = 0
$ GOTO COMPILERDONE
$ !
$COMPILERDONE:
$ !
$ WRITE SYS$OUTPUT "Compiler:         ", COMPILER
$ WRITE SYS$OUTPUT "Make Tool:        ", MAKETOOL
$ WRITE SYS$OUTPUT "Run time library: ", RTL
$ IF (__CRTL_VER .NE. 0) THEN WRITE SYS$OUTPUT "CRTL version:     ", __CRTL_VER
$ WRITE SYS$OUTPUT "Use DECC$CRTL:    ", DECC$CRTL
$ WRITE SYS$OUTPUT "Use readline:     ", READLINE
$ WRITE SYS$OUTPUT "Use mouse:        ", USE_MOUSE
$ !
$ ! Read in config.hin and write config.h.  Define DCL symbols for all the
$ ! symbols in config.hin, then write config.h, replacing the #undef with
$ ! #define where necessary.  Defining a symbol as 0 means to leave it #undef;
$ ! defining it as 1 means to define it; defining it as a string means it
$ ! should be defined as a string.
$ !
$ const = 0
$ HAVE_STRINGIZE = DECC
$ inline = 0
$ RETSIGTYPE = "void"
$ size_t = 0
$ STAT_MACROS_BROKEN = 0
$ STDC_HEADERS = DECC
$ X_DISPLAY_MISSING = 0
$ time_t = 0
$ HAVE_ATEXIT = DECC
$ HAVE_BCOPY = DECC
$ HAVE_BZERO = DECC
$ HAVE_DOPRNT = 0
$ HAVE_ERF = DPML
$ HAVE_ERFC = DPML
$ HAVE_GAMMA = 0
$ HAVE_GETCWD = 1
$ HAVE_INDEX = DECC
$ HAVE_LGAMMA = DECC .AND. ALPHA
$ HAVE_MEMCPY = DECC
$ HAVE_MEMMOVE = DECC
$ HAVE_MEMSET = DECC
$ HAVE_ON_EXIT = 0
$ HAVE_PCLOSE = __CRTL_VER .GE. 70000000
$ HAVE_POLL = 0
$ HAVE_POPEN = __CRTL_VER .GE. 70000000
$ HAVE_RINDEX = DECC
$ HAVE_SELECT = 0
$ HAVE_SETVBUF = DECC
$ HAVE_SLEEP = 1
$ HAVE_SNPRINTF = 0
$ HAVE_STPCPY = 0
$ HAVE_STRCASECMP = __CRTL_VER .GE. 70000000
$ HAVE_STRCHR = DECC
$ HAVE_STRCSPN = DECC
$ HAVE_STRDUP = __CRTL_VER .GE. 70000000
$ HAVE_STRERROR = DECC
$ HAVE_STRICMP = 0
$ HAVE_STRNCASECMP = __CRTL_VER .GE. 70000000
$ HAVE_STRNICMP = 0
$ HAVE_STRRCHR = DECC
$ HAVE_STRSTR = DECC
$ HAVE_SYSINFO = 0
$ HAVE_TCGETATTR = 0
$ HAVE_VFPRINTF = 0
$ HAVE_ERRNO_H = DECC
$ HAVE_FLOAT_H = DECC
$ HAVE_LIBC_H = 0
$ HAVE_LIMITS_H = DECC
$ HAVE_LOCALE_H = DECC
$ HAVE_MALLOC_H = 0
$ HAVE_MATH_H = DECC
$ HAVE_POLL_H = 0
$ HAVE_SGTTY_H = 0
$ HAVE_STDLIB_H = DECC
$ HAVE_STRING_H = DECC
$ HAVE_SYS_BSDTYPES_H = 0
$ HAVE_SYS_IOCTL_H = DECC
$ HAVE_SYS_PARAM_H = 0
$ HAVE_SYS_SELECT_H = 0
$ HAVE_SYS_SOCKET_H = DECC
$ HAVE_SYS_STAT_H = DECC
$ HAVE_SYS_SYSTEMINFO_H = 0
$ HAVE_SYS_TIME_H = DECC
$ HAVE_SYS_TIMEB_H = DECC
$ HAVE_SYS_TYPES_H = DECC
$ HAVE_SYS_UTSNAME_H = __CRTL_VER .GE. 70000000
$ HAVE_TERMIOS_H = 0
$ HAVE_TIME_H = DECC
$ HAVE_UNISTD_H = DECC
$ HAVE_VALUES_H = 0
$ HAVE_LIBM = DECC
$ PACKAGE = 0
$ VERSION = 0
$ PROTOTYPES = DECC
$ X11 = DECW
$ GNUPLOT_X11 = 0
$ MSDOS = 0
$ DOS32 = 0
$ DJSVGA = 0
$ GRX21 = 0
$ EXTERN_ERRNO = 0
$ PIPES = __CRTL_VER .LT. 70000000
$ SELECT_TYPE_ARG1 = 0
$ SELECT_TYPE_ARG234 = 0
$ SELECT_TYPE_ARG5 = 0
$ LINUXVGA = 0
$ HAVE_LIBREADLINE = 0
$ GNUPLOT_HISTORY = 0
$ ! READLINE = 0    ! READLINE is defined above
$ UNIXPLOT = 0
$ GNUGRAPH = 0
$ GNU_PLOTUTILS = 0
$ HAVE_LIBGD = 0
$ HAVE_LIBPNG = 0
$ CGI = 0
$ SUN = 0
$ NOCWDRC = 0
$ THIN_PLATE_SPLINES_GRID = 0
$ COLUMN_HELP = 0
$ IRIS = 0
$ MGR = 0
$ RGIP = 0
$ ! USE_MOUSE = 0   ! USE_MOUSE is defined above         
$ !
$ OPEN/READ IN CONFIG.HIN
$ OPEN/WRITE OUT CONFIG.H
$CONFIGLOOP:
$ READ/END=CONFIGDONE IN REC
$ IF (F$ELEMENT(0," ",REC) .NES. "#undef") THEN GOTO WRITELINE
$ SYM = F$ELEMENT(1," ",REC)
$ IF (F$TYPE('SYM') .EQS. "") THEN GOTO NOSYMBOL
$ VAL = 'SYM'
$ IF (F$TYPE(VAL) .EQS. "STRING" .OR. VAL .NE. 0) THEN -
            REC = "#define " + SYM + " " + F$STRING(VAL)
$ GOTO WRITELINE
$NOSYMBOL:
$ WRITE SYS$OUTPUT "No DCL symbol for ", REC
$WRITELINE:
$ WRITE OUT REC
$ GOTO CONFIGLOOP
$CONFIGDONE:
$ CLOSE IN
$ CLOSE OUT
$ !
$ ! Get a list of files from [.src]makefile.all.  Skip lines until I find
$ ! COREOBJS =, then read and extract the file names until I find a line
$ ! that does not end in \.
$ !
$ OPEN/READ IN [.SRC]MAKEFILE.ALL
$FILELOOP1:
$ READ/END=DONE IN REC
$ IF (F$EXTRACT(0,8,REC) .NES. "COREOBJS") THEN GOTO FILELOOP1
$ REC = REC - "COREOBJS" - "="
$ REC = REC - ".$(O)" - ".$(O)" - ".$(O)" - ".$(O)" - ".$(O)" - ".$(O)"
$ COREOBJS = F$EDIT (REC-"\", "TRIM,COMPRESS")
$ IF (F$ELEMENT(1,"\",REC) .EQS. "\") THEN GOTO FILELOOPDONE
$FILELOOP2:
$ READ/END=DONE IN REC
$ REC = REC - ".$(O)" - ".$(O)" - ".$(O)" - ".$(O)" - ".$(O)" - ".$(O)"
$ COREOBJS = COREOBJS + " " + F$EDIT (REC-"\", "TRIM,COMPRESS")
$ IF (F$ELEMENT(1,"\",REC) .NES. "\") THEN GOTO FILELOOP2
$FILELOOPDONE:
$ CLOSE IN
$ IF (.NOT. READLINE) THEN COREOBJS = COREOBJS - "readline " - " readline"
$ !
$ ! List of terminal files; all are in [.term] and have an extension of .trm.
$ !
$ CORETERM = "aed cgi dumb dxf dxy eepic epson fig hp26 hp2648 hpgl hpljii " -
           + "imagen iris4d kyo latex pbm pc post qms regis sun t410x tek " -
           + "unixpc unixplot v384 x11"
$ OTHERTERM = "[-.term]impcodes.h [-.term]object.h gplt_x11.c"
$ !
$ ! Define CFLAGS.
$ !
$ CFLAGS = "/DEFINE=(NO_GIH,HAVE_CONFIG_H,''RTL')/INCLUDE=[-]"
$ IF (DECC) THEN CFLAGS = CFLAGS + "/PREFIX=ALL"
$ !
$ ! Write the make file.
$ !
$ GOTO 'MAKETOOL'
$MMS:
$MMK:
$ OPEN/WRITE MAKE [.SRC]DESCRIP.MMS
$ GOTO WRITEMAKE
$MAK:
$ OPEN/WRITE MAKE [.SRC]MAKEFILE.
$ GOTO WRITEMAKE
$COM:
$ OPEN/WRITE MAKE [.SRC]BUILD.COM
$ GOTO WRITECOM
$MAKEFILEDONE:
$ CLOSE MAKE
$ !
$ ! Write the option files
$ !
$ OPEN/WRITE OPT [.SRC]GNUPLOT.OPT
$ N = 0
$OPTLOOP:
$ FILE = F$ELEMENT (N, " ", COREOBJS)
$ IF (FILE .EQS. " ") THEN GOTO OPTDONE
$ WRITE OPT FILE, ".obj"
$ N = N + 1
$ GOTO OPTLOOP
$OPTDONE:
$ WRITE OPT "version.obj"
$ CLOSE OPT
$ IF (RTL .EQS. "DECCRTL") THEN GOTO NOVAXCOPT
$ OPEN/WRITE OPT [.SRC]VAXC.OPT
$ WRITE OPT "sys$library:vaxcrtl.exe/share"
$ CLOSE OPT
$NOVAXCOPT:
$ IF (.NOT. DECW) THEN GOTO NODECW
$ OPEN/WRITE OPT [.SRC]X11.OPT
$ WRITE OPT "sys$library:decw$xlibshr.exe/share"
$ CLOSE OPT
$NODECW:
$ EXIT
$ !
$WRITEMAKE:
$ WRITE MAKE "O = obj"
$ WRITE MAKE "X = exe"
$ IF (VAXC) THEN WRITE MAKE "CC = CC"
$ IF (VAXC) THEN WRITE MAKE "EXTRALIB ="
$ IF (GNUC) THEN WRITE MAKE "CC = GCC/NOCASE"
$ IF (GNUC) THEN WRITE MAKE "CRTL_SHARE ="
$ IF (GNUC) THEN WRITE MAKE "EXTRALIB = ,GNU_CC:[000000]GCCLIB/LIB"
$ IF (DECC) THEN WRITE MAKE "CC = CC"
$ IF (DECC .AND. .NOT. DECC$CRTL) THEN WRITE MAKE "EXTRALIB ="
$ IF (DECC .AND. DECC$CRTL) THEN -
    WRITE MAKE "EXTRALIB = ,SYS$LIBRARY:DECC$CRTL.OLB/LIBRARY"
$ IF (RTL .EQS. "VAXCRTL") THEN -
    WRITE MAKE "CRTL_SHARE = ,SYS$DISK:[]VAXC.OPT/OPT"
$ IF (RTL .NES. "VAXCRTL") THEN WRITE MAKE "CRTL_SHARE ="
$ WRITE MAKE "CFLAGS = ", CFLAGS
$ WRITE MAKE "TERMFLAGS = /INCLUDE=([-],[-.TERM])"
$ WRITE MAKE ""
$ WRITE MAKE "OBJS = \"
$ N = 0
$WRITEMAKE_L1:
$ FILE = F$ELEMENT (N, " ", COREOBJS)
$ IF (FILE .EQS. " ") THEN GOTO WRITEMAKE_D1
$ WRITE MAKE "       ", FILE, ".$(O) \"
$ N = N + 1
$ GOTO WRITEMAKE_L1
$WRITEMAKE_D1:
$ WRITE MAKE "       version.$(O) vms.$(O)"
$ WRITE MAKE ""
$ WRITE MAKE "TERM = \"
$ N = 0
$WRITEMAKE_L2:
$ FILE = F$ELEMENT (N, " ", CORETERM)
$ IF (FILE .EQS. " ") THEN GOTO WRITEMAKE_D2
$ WRITE MAKE "       [-.term]", FILE, ".trm \"
$ N = N + 1
$ GOTO WRITEMAKE_L2
$WRITEMAKE_D2:
$ WRITE MAKE "       ", OTHERTERM
$ WRITE MAKE ""
$ ALL = ""
$ IF (DECC$CRTL) THEN ALL = ALL + " logicals"
$ ALL = ALL + " gnuplot.$(X)"
$ IF (DECW) THEN ALL = ALL + " gnuplot_x11.$(X)"
$ ALL = ALL + " gnuplot.hlp gnuplot.hlb \"
$ WRITE MAKE "all :  ", ALL
$ WRITE MAKE "        [-.demo]binary1. [-.demo]binary2. [-.demo]binary3."
$ WRITE MAKE "        @       ! a no-op to suppress a MMS warning"
$ WRITE MAKE ""
$ IF (DECC$CRTL) THEN WRITE MAKE "logicals :"
$ IF (DECC$CRTL) THEN -
    WRITE MAKE "        @ define/nolog decc$crtlmap sys$library:decc$crtl.exe"
$ WRITE MAKE ""
$ COPY SYS$INPUT: MAKE
$ DECK

gnuplot.$(X) : $(OBJS)
	link /executable=gnuplot.$(X) \
            vms.$(O),gnuplot.opt/option$(EXTRALIB)$(CRTL_SHARE)

gnuplot_x11.$(X) : gplt_x11.$(O) stdfn.$(O)
	link /executable=gnuplot_x11.$(X) \
            gplt_x11.$(O),stdfn.$(O),x11.opt/option$(EXTRALIB)$(CRTL_SHARE)

gplt_x11.$(O) : gplt_x11.c
	$(CC) $(CFLAGS) $(X11FLAGS) $<

[-.demo]binary1. [-.demo]binary2. [-.demo]binary3. : bf_test.$(X)
	set default [-.demo]
	run [-.src]bf_test.$(X)
	set default [-.src]

bf_test.$(X) : bf_test.$(O) binary.$(O) alloc.$(O)
	link /executable=bf_test.$(X) bf_test.$(O),binary.$(O),alloc.$(O)

gnuplot.hlb : gnuplot.hlp
	library/create/help gnuplot.hlb gnuplot.hlp

.IFDEF OLD_HLP
gnuplot.hlp : doc2hlp.$(X) [-.docs]gnuplot.doc
	define/user sys$input [-.docs]gnuplot.doc
	define/user sys$output []gnuplot.hlp
	run doc2hlp.$(X)

doc2hlp.$(X) : [-.docs]doc2hlp.c [-.docs]termdoc.c
	$(CC) /include=([-.docs],[],[-.term]) \
             [-.docs]doc2hlp.c,[-.docs]termdoc.c
	link /executable=doc2hlp.$(X) doc2hlp.$(O),termdoc.$(O)$(CRTL_SHARE)
.ELSE
gnuplot.hlp : [-.docs]gnuplot.rnh
	RUNOFF $< /OUTPUT=$@

[-.docs]gnuplot.rnh : [-.docs]doc2rnh.$(X) [-.docs]gnuplot.doc
	MCR $< [-.docs]gnuplot.doc $@

[-.docs]doc2rnh.$(X) : [-.docs]doc2rnh.$(O) [-.docs]termdoc.$(O)
	link /executable=$@  $+ $(CRTL_SHARE)

[-.docs]doc2rnh.$(O) [-.docs]termdoc.$(O) : [-.docs]termdoc.c ![-.docs]allterm.h
	$(CC) /object=$@ $(CFLAGS) /include=([],[-],[-.term]) $*.c
.ENDIF

term.$(O) : term.h term.c $(TERM)
	$(CC) $(CFLAGS) $(TERMFLAGS) term.c /object=term.$(O)

$(OBJS) : plot.h

command.$(O) help.$(O) misc.$(O) : help.h

command.$(O) graphics.$(O) graph3d.$(O) misc.$(O) plot.$(O) set.$(O) show.$(O) term.O interpol.$(O) : setshow.h

command.$(O) fit.$(O) matrix.$(O) : fit.h

fit.$(O) matrix.$(O) : matrix.h

bitmap.$(O) term.$(O) : bitmap.h

clean :
	purge/log
	delete/log *.$(O);*
        delete/log *.$(X);*
        delete/log gnuplot.hlp;*,gnuplot.hlb;*
        delete/log [-.docs]*.$(O);*,*.$(X);*,gnuplot.rnh;*
	delete/log [-.demo]binary1.;*,binary2.;*,binary3.;*
$EOD
$ GOTO MAKEFILEDONE
$ !
$WRITECOM:
$ WRITE MAKE -
    "$ ! Command file to compile/link gnuplot, gnuplot_x11, and make gnuplot.hlb"
$ WRITE MAKE "$ !"
$ WRITE MAKE "$ on error then goto finish"
$ WRITE MAKE "$ O = ""obj"""
$ WRITE MAKE "$ X = ""exe"""
$ IF (VAXC) THEN WRITE MAKE "$ CC = ""CC"""
$ IF (VAXC) THEN WRITE MAKE "$ EXTRALIB = """
$ IF (GNUC) THEN WRITE MAKE "$ CC = ""GCC/NOCASE"""
$ IF (GNUC) THEN WRITE MAKE "$ CRTL_SHARE = """
$ IF (GNUC) THEN WRITE MAKE "$ EXTRALIB = "",GNU_CC:[000000]GCCLIB/LIB"""
$ IF (DECC) THEN WRITE MAKE "$ CC = ""CC"""
$ IF (DECC .AND. .NOT. DECC$CRTL) THEN WRITE MAKE "$ EXTRALIB = """""
$ IF (DECC .AND. DECC$CRTL) THEN -
    WRITE MAKE "$ EXTRALIB = "",SYS$LIBRARY:DECC$CRTL.OLB/LIBRARY"""
$ IF (RTL .EQS. "VAXCRTL") THEN -
    WRITE MAKE "$ CRTL_SHARE = "",SYS$DISK:[]VAXC.OPT/OPT"""
$ IF (RTL .NES. "VAXCRTL") THEN WRITE MAKE "$ CRTL_SHARE = """""
$ WRITE MAKE "$ CFLAGS = ""''CFLAGS'"""
$ WRITE MAKE "$ TERMFLAGS = ""/INCLUDE=([-],[-.TERM])"""
$ IF (VAXC .AND. DECW) THEN WRITE MAKE "$ define/nolog x11 decw$include"
$ IF (VAXC .AND. DECW) THEN WRITE MAKE "$ define/nolog sys sys$library"
$ WRITE MAKE "$ set verify"
$ IF (DECC$CRTL) THEN -
    WRITE MAKE "$ define/nolog decc$crtlmap sys$library:decc$crtl.exe"
$ N = 0
$WRITECOM_L1:
$ FILE = F$ELEMENT (N, " ", COREOBJS)
$ IF (FILE .EQS. " ") THEN GOTO WRITECOM_D1
$ IF (FILE .EQS. "term") THEN WRITE MAKE "$ cc 'CFLAGS' 'TERMFLAGS' ", FILE, ".c"
$ IF (FILE .NES. "term") THEN WRITE MAKE "$ cc 'CFLAGS' ", FILE, ".c"
$ N = N + 1
$ GOTO WRITECOM_L1
$WRITECOM_D1:
$ WRITE MAKE "$ cc 'CFLAGS' version.c"
$ WRITE MAKE "$ cc 'CFLAGS' vms.c"
$ IF (GNUC) THEN WRITE MAKE "$ cc 'CFLAGS' GNU_CC_INCLUDE:[000000]_assert.c"
$ WRITE MAKE "$ !"
$ WRITE MAKE "$ link /executable=gnuplot.exe -"
$ N = 0
$WRITECOM_L2:
$ FILE = F$ELEMENT (N, " ", COREOBJS)
$ IF (FILE .EQS. " ") THEN GOTO WRITECOM_D2
$ WRITE MAKE "     ", FILE, ".obj, -"
$ N = N + 1
$ GOTO WRITECOM_L2
$WRITECOM_D2:
$ WRITE MAKE "     version.obj,vms.obj'EXTRALIB' 'CTRL_SHARE'"
$ WRITE MAKE "$ cc 'CFLAGS' bf_test.c"
$ WRITE MAKE "$ link /executable=bf_test.exe -"
$ WRITE MAKE "    bf_test.obj,binary.obj,alloc.obj'EXTRALIB' 'CTRL_SHARE'"
$ WRITE MAKE "$ cd [-.demo]"
$ WRITE MAKE "$ run [-.src]bf_test.exe"
$ WRITE MAKE "$ cd [-.src]"
$ IF (DECW) THEN WRITE MAKE "$ cc 'CFLAGS' gplt_x11.c"
$ IF (DECW) THEN WRITE MAKE "$ cc 'CFLAGS' stdfn.c"
$ IF (DECW) THEN WRITE MAKE "$ link /executable=gnuplot_x11.exe -"
$ IF (DECW) THEN WRITE MAKE "    gplt_x11.obj,stdfn.obj -"
$ IF (DECW) THEN WRITE MAKE "    'EXTRALIB' 'CTRL_SHARE',x11.opt/option"
$ COPY SYS$INPUT: MAKE
$ DECK
$ set def [-.docs]
$ if f$locate("ALL_TERM_DOC",CFLAGS).ne.f$length(CFLAGS) then -
	copy /concatenate [-.term]*.trm []allterm.h
$ cc 'CFLAGS' /OBJ=doc2rnh.obj/include=([],[-],[-.term],[-.src]) doc2rnh.c
$ cc 'CFLAGS' /OBJ=termdoc.obj/include=([],[-],[-.term],[-.src]) termdoc.c
$ SET DEF [-.src]		! CTRL_SHARE is defined as being in []
$ link [-.docs]doc2rnh.obj,termdoc.obj /exe=[-.docs]doc2rnh 'extralib''CTRL_SHARE'
$ doc2rnh := $sys$disk:[-.docs]doc2rnh
$ doc2rnh [-.docs]gnuplot.doc [-.docs]gnuplot.rnh
$ RUNOFF [-.docs]gnuplot.rnh
$ library/create/help sys$disk:[]gnuplot.hlb gnuplot.hlp
$!
$FINISH:
$EOD
$ WRITE MAKE "$ set noverify"
$ IF (VAXC .AND. DECW) THEN WRITE MAKE "$ deassign x11"
$ IF (VAXC .AND. DECW) THEN WRITE MAKE "$ deassign sys"
$ WRITE MAKE "$ exit"
$ GOTO MAKEFILEDONE