* Added the test suite to the main distribution.
[make.git] / makefile.com
blobf180df20b54c8033819e5b5bb68ed1eb760ffbd2
1 $!
2 $! Makefile.com - builds GNU Make for VMS
3 $!
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
7 $!
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
13 $ lval = ""
14 $ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs.""
15 $  then
16 $   if f$trnlnm("SYS").eqs."" then def/nolog sys sys$library:
17 $   ccopt = ""
18 $  else
19 $   ccopt = "/decc/prefix=all"
20 $   if f$trnlnm("SYS").eqs.""
21 $    then
22 $     if f$trnlnm("DECC$LIBRARY_INCLUDE").nes.""
23 $      then
24 $       define sys decc$library_include:
25 $      else
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:"
31 $       define sys 'lval
32 $      endif
33 $   endif
34 $ endif
36 $! Should we build a debug image
38 $ if (p2.eqs."DEBUG")
39 $  then
40 $   ccopt = ccopt + "/noopt/debug"
41 $   lopt = "/debug"
42 $ else
43 $   lopt = ""
44 $ endif
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
47 $ n=0
48 $ open/write optf make.opt
49 $ loop:
50 $ cfile = f$elem(n," ",filelist)
51 $ if cfile .eqs. " " then goto linkit
52 $ write sys$output "Compiling ''cfile'..."
53 $ call compileit 'cfile' 'p1'
54 $ n = n + 1
55 $ goto loop
56 $ linkit:
57 $ close optf
58 $ if p1 .nes. "" then goto link_using_library
59 $ link/exe=make make.opt/opt'lopt
60 $ exit
61 $ link_using_library:
62 $ link/exe=make make.opt/opt,sys$library:vaxcrtl/lib'lopt
64 $ compileit : subroutine
65 $ ploc = f$locate("]",p1)
66 $ filnam = 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'
70 $ exit
71 $ endsubroutine : compileit