1996-03-20 14:57:41 +00:00
|
|
|
$!
|
|
|
|
$! Makefile.com - builds GNU Make for VMS
|
|
|
|
$!
|
|
|
|
$! P1 is non-empty if you want to link with the VAXCRTL library instead
|
|
|
|
$! of the shareable executable
|
1999-07-21 16:06:18 +00:00
|
|
|
$! P2 = DEBUG will build an image with debug information
|
1996-03-20 14:57:41 +00:00
|
|
|
$!
|
1999-07-21 16:06:18 +00:00
|
|
|
$! In case of problems with the install you might contact me at
|
|
|
|
$! zinser@decus.decus.de (preferred) or martin_zinser@exchange.de
|
2000-01-22 05:43:03 +00:00
|
|
|
$
|
|
|
|
$! hb
|
|
|
|
$! But don't ask Martin Zinser about the lines, I added/changed.
|
|
|
|
$! In case of an error do some cleanup
|
|
|
|
$ on error then $ goto cleanup
|
|
|
|
$! in case somebody set up her/his own symbol for cc
|
|
|
|
$ set symbol/scope=(nolocal,noglobal)
|
1998-07-30 20:54:47 +00:00
|
|
|
$!
|
|
|
|
$! Look for the compiler used
|
|
|
|
$!
|
|
|
|
$ lval = ""
|
|
|
|
$ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs.""
|
|
|
|
$ then
|
|
|
|
$ if f$trnlnm("SYS").eqs."" then def/nolog sys sys$library:
|
|
|
|
$ ccopt = ""
|
|
|
|
$ else
|
|
|
|
$ ccopt = "/decc/prefix=all"
|
|
|
|
$ if f$trnlnm("SYS").eqs.""
|
|
|
|
$ then
|
1999-07-21 16:06:18 +00:00
|
|
|
$ if f$trnlnm("DECC$LIBRARY_INCLUDE").nes.""
|
|
|
|
$ then
|
1998-07-30 20:54:47 +00:00
|
|
|
$ define sys decc$library_include:
|
|
|
|
$ else
|
|
|
|
$ if f$search("SYS$COMMON:[DECC$LIB.REFERENCE]DECC$RTLDEF.DIR").nes."" -
|
|
|
|
then lval = "SYS$COMMON:[DECC$LIB.REFERENCE.DECC$RTLDEF],"
|
|
|
|
$ if f$search("SYS$COMMON:[DECC$LIB.REFERENCE]SYS$STARLET_C.DIR").nes."" -
|
|
|
|
then lval = lval+"SYS$COMMON:[DECC$LIB.REFERENCE.SYS$STARLET_C],"
|
|
|
|
$ lval=lval+"SYS$LIBRARY:"
|
1999-07-21 16:06:18 +00:00
|
|
|
$ define sys 'lval
|
1998-07-30 20:54:47 +00:00
|
|
|
$ endif
|
|
|
|
$ endif
|
|
|
|
$ endif
|
1999-07-21 16:06:18 +00:00
|
|
|
$!
|
|
|
|
$! Should we build a debug image
|
|
|
|
$!
|
|
|
|
$ if (p2.eqs."DEBUG")
|
|
|
|
$ then
|
|
|
|
$ ccopt = ccopt + "/noopt/debug"
|
|
|
|
$ lopt = "/debug"
|
|
|
|
$ else
|
|
|
|
$ lopt = ""
|
|
|
|
$ endif
|
1998-07-30 20:54:47 +00:00
|
|
|
$ 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"
|
1996-03-20 14:57:41 +00:00
|
|
|
$ copy config.h-vms config.h
|
|
|
|
$ n=0
|
1998-07-30 20:54:47 +00:00
|
|
|
$ open/write optf make.opt
|
1996-03-20 14:57:41 +00:00
|
|
|
$ loop:
|
|
|
|
$ cfile = f$elem(n," ",filelist)
|
|
|
|
$ if cfile .eqs. " " then goto linkit
|
|
|
|
$ write sys$output "Compiling ''cfile'..."
|
|
|
|
$ call compileit 'cfile' 'p1'
|
|
|
|
$ n = n + 1
|
|
|
|
$ goto loop
|
|
|
|
$ linkit:
|
1998-07-30 20:54:47 +00:00
|
|
|
$ close optf
|
1996-03-20 14:57:41 +00:00
|
|
|
$ if p1 .nes. "" then goto link_using_library
|
1999-07-21 16:06:18 +00:00
|
|
|
$ link/exe=make make.opt/opt'lopt
|
2000-01-22 05:43:03 +00:00
|
|
|
$ goto cleanup
|
|
|
|
$
|
1996-03-20 14:57:41 +00:00
|
|
|
$ link_using_library:
|
1999-07-21 16:06:18 +00:00
|
|
|
$ link/exe=make make.opt/opt,sys$library:vaxcrtl/lib'lopt
|
2000-01-22 05:43:03 +00:00
|
|
|
$
|
|
|
|
$ cleanup:
|
|
|
|
$ if f$trnlnm("SYS").nes."" then $ deassign sys
|
|
|
|
$ if f$trnlnm("OPTF").nes."" then $ close optf
|
|
|
|
$ if f$search("make.opt").nes."" then $ del make.opt;*
|
|
|
|
$ exit
|
1996-03-20 14:57:41 +00:00
|
|
|
$!
|
|
|
|
$ compileit : subroutine
|
1998-07-30 20:54:47 +00:00
|
|
|
$ ploc = f$locate("]",p1)
|
|
|
|
$ filnam = p1
|
|
|
|
$ if ploc .lt. f$length(p1) then filnam=f$extract(ploc+1,100,p1)
|
|
|
|
$ write optf "''filnam'"
|
|
|
|
$ cc'ccopt'/include=([],[.glob])/define=("allocated_variable_expand_for_file=alloc_var_expand_for_file","unlink=remove","HAVE_CONFIG_H","VMS") 'p1'
|
1996-03-20 14:57:41 +00:00
|
|
|
$ exit
|
|
|
|
$ endsubroutine : compileit
|