2 $! Makefile.com - builds GNU Make for VMS
4 $! P1 = LIST will provide compiler listings.
5 $! P2 = DEBUG will build an image with debug information
6 $! P3 = WALL will enable all warning messages (some are suppressed since
7 $! one macro intentionally causes an error condition)
9 $! In case of problems with the install you might contact me at
10 $! zinser@decus.de (preferred) or zinser@sysdev.deutsche-boerse.com
13 $! But don't ask Martin Zinser about the lines, I added/changed.
14 $! In case of an error do some cleanup
15 $ on error then $ goto cleanup
16 $! in case somebody set up her/his own symbol for cc
17 $ set symbol/scope=(nolocal,noglobal)
19 $! Just some general constants...
23 $ tmpnam = "temp_" + f$getjpi("","pid")
24 $ tt = tmpnam + ".txt"
27 $! Look for the compiler used
30 $ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs.""
32 $ if f$trnlnm("SYS").eqs."" then def/nolog sys sys$library:
35 $ ccopt = "/decc/prefix=(all,except=(globfree,glob))"
36 $ if f$trnlnm("SYS").eqs.""
38 $ if f$trnlnm("DECC$LIBRARY_INCLUDE").nes.""
40 $ define sys decc$library_include:
42 $ if f$search("SYS$COMMON:[DECC$LIB.REFERENCE]DECC$RTLDEF.DIR").nes."" -
43 then lval = "SYS$COMMON:[DECC$LIB.REFERENCE.DECC$RTLDEF],"
44 $ if f$search("SYS$COMMON:[DECC$LIB.REFERENCE]SYS$STARLET_C.DIR").nes."" -
45 then lval = lval+"SYS$COMMON:[DECC$LIB.REFERENCE.SYS$STARLET_C],"
46 $ lval=lval+"SYS$LIBRARY:"
53 $ if (p1 .eqs. "LIST")
55 $ ccopt = ccopt + "/list/show=(expan,inclu)"
58 $! Should we build a debug image
62 $ ccopt = ccopt + "/noopt/debug"
68 $! Do we want to see all warnings
74 $ filelist = "[.src]ar [.src]arscan [.src]commands [.src]default [.src]dir " + -
75 "[.src]expand [.src]file [.src]function [.src]guile " + -
76 "[.src]hash [.src]implicit [.src]job [.src]load [.src]main " + -
77 "[.src]misc [.src]read [.src]remake [.src]remote-stub " + -
78 "[.src]rule [.src]output [.src]signame [.src]variable " + -
79 "[.src]version [.src]strcache [.src]vpath " + -
80 "[.src]vmsfunctions [.src]vmsify [.src]vms_progname " + -
81 "[.src]vms_exit [.src]vms_export_symbol " + -
82 "[.lib]alloca [.lib]fnmatch [.lib]glob [.src]getopt1 [.src]getopt"
84 $ copy [.src]config.h-vms [.src]config.h
85 $ copy [.lib]fnmatch.in.h [.lib]fnmatch.h
86 $ copy [.lib]glob.in.h [.lib]glob.h
88 $ open/write optf make.opt
90 $ cfile = f$elem(n," ",filelist)
91 $ if cfile .eqs. " " then goto linkit
92 $ write sys$output "Compiling ''cfile'..."
93 $ call compileit 'cfile'
98 $ link/exe=make make.opt/opt'lopt
102 $ if f$trnlnm("SYS").nes."" then $ deassign sys
103 $ if f$trnlnm("OPTF").nes."" then $ close optf
104 $ if f$search("make.opt").nes."" then $ del make.opt;*
107 $!-----------------------------------------------------------------------------
109 $! Check if this is a define relating to the properties of the C/C++
113 $ open/write tmpc 'tc
114 $ ccqual = "/warn=(disable=questcompare)"
115 $ write tmpc "#include <stdio.h>"
116 $ write tmpc "unsigned int i = 1;"
117 $ write tmpc "int main(){"
118 $ write tmpc "if (i < 0){printf(""Mission impossible\n"");}}"
120 $ gosub cc_qual_check
123 $!-----------------------------------------------------------------------------
125 $! Check for properties of C/C++ compiler
129 $ set message/nofac/noident/nosever/notext
130 $ cc 'ccqual' 'tmpnam'
131 $ if $status then cc_qual = true
132 $ set message/fac/ident/sever/text
133 $ delete/nolog 'tmpnam'.*;*
134 $ if cc_qual then ccopt = ccopt + ccqual
136 $!-----------------------------------------------------------------------------
138 $ compileit : subroutine
139 $ ploc = f$locate("]",p1)
141 $ if ploc .lt. f$length(p1)
143 $ objdir = f$extract(0, ploc+1, p1)
147 $ write optf objdir+p1
149 $ cc'ccopt'/nested=none/include=([],[.src],[.lib])/obj='objdir' -
150 /define=("allocated_variable_expand_for_file=alloc_var_expand_for_file",-
151 "unlink=remove","HAVE_CONFIG_H","VMS") -
154 $ endsubroutine : compileit
156 $!-----------------------------------------------------------------------------
157 $!Copyright (C) 1996-2020 Free Software Foundation, Inc.
158 $!This file is part of GNU Make.
160 $!GNU Make is free software; you can redistribute it and/or modify it under
161 $!the terms of the GNU General Public License as published by the Free Software
162 $!Foundation; either version 3 of the License, or (at your option) any later
165 $!GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
166 $!WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
167 $!FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
170 $!You should have received a copy of the GNU General Public License along with
171 $!this program. If not, see <http://www.gnu.org/licenses/>.