2 $! Makefile.com - builds GNU Make for VMS
4 $! P1 is non-empty if you want to link with the VAXCRTL library instead
5 $! of the shareable executable
6 $! P2 = DEBUG will build an image with debug information
8 $! In case of problems with the install you might contact me at
9 $! zinser@decus.decus.de (preferred) or martin_zinser@exchange.de
12 $! But don't ask Martin Zinser about the lines, I added/changed.
13 $! In case of an error do some cleanup
14 $ on error then $ goto cleanup
15 $! in case somebody set up her/his own symbol for cc
16 $ set symbol/scope=(nolocal,noglobal)
18 $! Look for the compiler used
21 $ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs.""
23 $ if f$trnlnm("SYS").eqs."" then def/nolog sys sys$library:
26 $ ccopt = "/decc/prefix=all"
27 $ if f$trnlnm("SYS").eqs.""
29 $ if f$trnlnm("DECC$LIBRARY_INCLUDE").nes.""
31 $ define sys decc$library_include:
33 $ if f$search("SYS$COMMON:[DECC$LIB.REFERENCE]DECC$RTLDEF.DIR").nes."" -
34 then lval = "SYS$COMMON:[DECC$LIB.REFERENCE.DECC$RTLDEF],"
35 $ if f$search("SYS$COMMON:[DECC$LIB.REFERENCE]SYS$STARLET_C.DIR").nes."" -
36 then lval = lval+"SYS$COMMON:[DECC$LIB.REFERENCE.SYS$STARLET_C],"
37 $ lval=lval+"SYS$LIBRARY:"
43 $! Should we build a debug image
47 $ ccopt = ccopt + "/noopt/debug"
52 $ filelist = "alloca ar arscan commands default dir expand file function implicit job main misc read remake remote-stub rule signame variable version vmsfunctions vmsify vpath [.glob]glob [.glob]fnmatch getopt1 getopt"
53 $ copy config.h-vms config.h
55 $ open/write optf make.opt
57 $ cfile = f$elem(n," ",filelist)
58 $ if cfile .eqs. " " then goto linkit
59 $ write sys$output "Compiling ''cfile'..."
60 $ call compileit 'cfile' 'p1'
65 $ if p1 .nes. "" then goto link_using_library
66 $ link/exe=make make.opt/opt'lopt
70 $ link/exe=make make.opt/opt,sys$library:vaxcrtl/lib'lopt
73 $ if f$trnlnm("SYS").nes."" then $ deassign sys
74 $ if f$trnlnm("OPTF").nes."" then $ close optf
75 $ if f$search("make.opt").nes."" then $ del make.opt;*
78 $ compileit : subroutine
79 $ ploc = f$locate("]",p1)
81 $ if ploc .lt. f$length(p1) then filnam=f$extract(ploc+1,100,p1)
82 $ write optf "''filnam'"
83 $ cc'ccopt'/include=([],[.glob])/define=("allocated_variable_expand_for_file=alloc_var_expand_for_file","unlink=remove","HAVE_CONFIG_H","VMS") 'p1'
85 $ endsubroutine : compileit