* New config.sub and config.guess
[make.git] / makefile.com
blob5a0f884c9b470ad9d18fc4ed193bb27f31e687d8
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 $! hb
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
20 $ lval = ""
21 $ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs.""
22 $  then
23 $   if f$trnlnm("SYS").eqs."" then def/nolog sys sys$library:
24 $   ccopt = ""
25 $  else
26 $   ccopt = "/decc/prefix=all"
27 $   if f$trnlnm("SYS").eqs.""
28 $    then
29 $     if f$trnlnm("DECC$LIBRARY_INCLUDE").nes.""
30 $      then
31 $       define sys decc$library_include:
32 $      else
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:"
38 $       define sys 'lval
39 $      endif
40 $   endif
41 $ endif
43 $! Should we build a debug image
45 $ if (p2.eqs."DEBUG")
46 $  then
47 $   ccopt = ccopt + "/noopt/debug"
48 $   lopt = "/debug"
49 $ else
50 $   lopt = ""
51 $ endif
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
54 $ n=0
55 $ open/write optf make.opt
56 $ loop:
57 $ cfile = f$elem(n," ",filelist)
58 $ if cfile .eqs. " " then goto linkit
59 $ write sys$output "Compiling ''cfile'..."
60 $ call compileit 'cfile' 'p1'
61 $ n = n + 1
62 $ goto loop
63 $ linkit:
64 $ close optf
65 $ if p1 .nes. "" then goto link_using_library
66 $ link/exe=make make.opt/opt'lopt
67 $ goto cleanup
69 $ link_using_library:
70 $ link/exe=make make.opt/opt,sys$library:vaxcrtl/lib'lopt
72 $ cleanup:
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;*
76 $ exit
78 $ compileit : subroutine
79 $ ploc = f$locate("]",p1)
80 $ filnam = 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'
84 $ exit
85 $ endsubroutine : compileit