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
11 $! Look for the compiler used
14 $ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs.""
16 $ if f$trnlnm("SYS").eqs."" then def/nolog sys sys$library:
19 $ ccopt = "/decc/prefix=all"
20 $ if f$trnlnm("SYS").eqs.""
22 $ if f$trnlnm("DECC$LIBRARY_INCLUDE").nes.""
24 $ define sys decc$library_include:
26 $ if f$search("SYS$COMMON:[DECC$LIB.REFERENCE]DECC$RTLDEF.DIR").nes."" -
27 then lval = "SYS$COMMON:[DECC$LIB.REFERENCE.DECC$RTLDEF],"
28 $ if f$search("SYS$COMMON:[DECC$LIB.REFERENCE]SYS$STARLET_C.DIR").nes."" -
29 then lval = lval+"SYS$COMMON:[DECC$LIB.REFERENCE.SYS$STARLET_C],"
30 $ lval=lval+"SYS$LIBRARY:"
36 $! Should we build a debug image
40 $ ccopt = ccopt + "/noopt/debug"
45 $ 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"
46 $ copy config.h-vms config.h
48 $ open/write optf make.opt
50 $ cfile = f$elem(n," ",filelist)
51 $ if cfile .eqs. " " then goto linkit
52 $ write sys$output "Compiling ''cfile'..."
53 $ call compileit 'cfile' 'p1'
58 $ if p1 .nes. "" then goto link_using_library
59 $ link/exe=make make.opt/opt'lopt
62 $ link/exe=make make.opt/opt,sys$library:vaxcrtl/lib'lopt
64 $ compileit : subroutine
65 $ ploc = f$locate("]",p1)
67 $ if ploc .lt. f$length(p1) then filnam=f$extract(ploc+1,100,p1)
68 $ write optf "''filnam'"
69 $ cc'ccopt'/include=([],[.glob])/define=("allocated_variable_expand_for_file=alloc_var_expand_for_file","unlink=remove","HAVE_CONFIG_H","VMS") 'p1'
71 $ endsubroutine : compileit