make/makefile.com

172 lines
5.2 KiB
Text
Raw Normal View History

$!
$! Makefile.com - builds GNU Make for VMS
$!
$! P1 = LIST will provide compiler listings.
1999-07-21 16:06:18 +00:00
$! P2 = DEBUG will build an image with debug information
2002-10-01 15:32:14 +00:00
$! P3 = WALL will enable all warning messages (some are suppressed since
$! one macro intentionally causes an error condition)
$!
1999-07-21 16:06:18 +00:00
$! In case of problems with the install you might contact me at
2002-10-01 15:32:14 +00:00
$! zinser@decus.de (preferred) or zinser@sysdev.deutsche-boerse.com
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
2000-01-22 05:43:03 +00:00
$ 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
$!
2002-10-01 15:32:14 +00:00
$! Just some general constants...
$!
$ true = 1
$ false = 0
$ tmpnam = "temp_" + f$getjpi("","pid")
$ tt = tmpnam + ".txt"
$ tc = tmpnam + ".c"
$!
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,except=(globfree,glob))"
1998-07-30 20:54:47 +00:00
$ 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
$!
$!
$ if (p1 .eqs. "LIST")
$ then
$ ccopt = ccopt + "/list/show=(expan,inclu)"
$ 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
2002-10-01 15:32:14 +00:00
$!
$! Do we want to see all warnings
$!
$ if (p3.nes."WALL")
$ then
$ gosub check_cc_qual
$ endif
Convert GNU make to use the gnulib portability library Move content from glob/* and config/* into standard GNU directory locations lib/* and m4/*. Install the gnulib bootstrap script and its configuration file, and create a bootstrap.bat file for Windows. Update the README.git file with new requirements and instructions for building from Git. At this point we only install the alloca, getloadavg, and FDL modules from gnulib. We keep our old glob/fnmatch implementation since the gnulib versions require significant amounts of infrastructure which doesn't exist on Windows yet. Further work is required here. Due to a problem with gnulib's version of getloadavg, we need to bump the minimum required version of automake to 1.16.1 unfortunately. * README.git: Update instructions * NEWS: Move developer news to a separate section * configure.ac: Update for use with gnulib modules * bootstrap: Bootstrap from Git workspace (import from gnulib) * bootstrap.conf: Bootstrap configuration for GNU make * bootstrap.bat: Bootstrap from Git workspace for Windows * gl/modules/make-glob: Support our local fnmatch/glob implementation * config/acinclude.m4: Move to m4/ * config/dospaths.m4: Move to m4/ * glob/fnmatch.c: Move to lib/ * glob/fnmatch.h.in: Move to lib/ * glob/glob.c: Move to lib/ * glob/glob.h.in: Move to lib/ * Makefile.am: Update for new directories * build.template: Update for new directories * build_w32.bat: Update for new directories * builddos.bat: Update for new directories * maintMakefile: Update for new directories * makefile.com: Update for new directories * mk/Amiga.mk: Update for new directories * mk/Posix.mk.in: Update for new directories * mk/VMS.mk: Update for new directories * mk/Windows32.mk: Update for new directories * mk/msdosdjgpp.mk: Update for new directories * po/LINGUAS: One language per line (needed by gnulib) * INSTALL: Remove (obtained from gnulib) * src/alloca.c: Remove (obtained from gnulib) * src/getloadavg.c: Remove (obtained from gnulib) * po/Makevars: Remove (created by bootstrap) * config/*: Remove leftover files * glob/*: Remove leftover files
2018-07-01 16:28:25 +00:00
$ filelist = "[.src]ar [.src]arscan [.src]commands [.src]default [.src]dir " + -
"[.src]expand [.src]file [.src]function [.src]guile " + -
"[.src]hash [.src]implicit [.src]job [.src]load [.src]main " + -
"[.src]misc [.src]read [.src]remake [.src]remote-stub " + -
"[.src]rule [.src]output [.src]signame [.src]variable " + -
"[.src]version [.src]shuffle [.src]strcache [.src]vpath " + -
Convert GNU make to use the gnulib portability library Move content from glob/* and config/* into standard GNU directory locations lib/* and m4/*. Install the gnulib bootstrap script and its configuration file, and create a bootstrap.bat file for Windows. Update the README.git file with new requirements and instructions for building from Git. At this point we only install the alloca, getloadavg, and FDL modules from gnulib. We keep our old glob/fnmatch implementation since the gnulib versions require significant amounts of infrastructure which doesn't exist on Windows yet. Further work is required here. Due to a problem with gnulib's version of getloadavg, we need to bump the minimum required version of automake to 1.16.1 unfortunately. * README.git: Update instructions * NEWS: Move developer news to a separate section * configure.ac: Update for use with gnulib modules * bootstrap: Bootstrap from Git workspace (import from gnulib) * bootstrap.conf: Bootstrap configuration for GNU make * bootstrap.bat: Bootstrap from Git workspace for Windows * gl/modules/make-glob: Support our local fnmatch/glob implementation * config/acinclude.m4: Move to m4/ * config/dospaths.m4: Move to m4/ * glob/fnmatch.c: Move to lib/ * glob/fnmatch.h.in: Move to lib/ * glob/glob.c: Move to lib/ * glob/glob.h.in: Move to lib/ * Makefile.am: Update for new directories * build.template: Update for new directories * build_w32.bat: Update for new directories * builddos.bat: Update for new directories * maintMakefile: Update for new directories * makefile.com: Update for new directories * mk/Amiga.mk: Update for new directories * mk/Posix.mk.in: Update for new directories * mk/VMS.mk: Update for new directories * mk/Windows32.mk: Update for new directories * mk/msdosdjgpp.mk: Update for new directories * po/LINGUAS: One language per line (needed by gnulib) * INSTALL: Remove (obtained from gnulib) * src/alloca.c: Remove (obtained from gnulib) * src/getloadavg.c: Remove (obtained from gnulib) * po/Makevars: Remove (created by bootstrap) * config/*: Remove leftover files * glob/*: Remove leftover files
2018-07-01 16:28:25 +00:00
"[.src]vmsfunctions [.src]vmsify [.src]vms_progname " + -
"[.src]vms_exit [.src]vms_export_symbol " + -
"[.lib]alloca [.lib]fnmatch [.lib]glob [.src]getopt1 [.src]getopt"
$!
$ copy [.src]config.h-vms [.src]config.h
$ copy [.lib]fnmatch.in.h [.lib]fnmatch.h
$ copy [.lib]glob.in.h [.lib]glob.h
$ n=0
1998-07-30 20:54:47 +00:00
$ open/write optf make.opt
$ loop:
$ cfile = f$elem(n," ",filelist)
$ if cfile .eqs. " " then goto linkit
$ write sys$output "Compiling ''cfile'..."
$ call compileit 'cfile'
$ n = n + 1
$ goto loop
$ linkit:
1998-07-30 20:54:47 +00:00
$ close optf
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
$
$ 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
$!
$!-----------------------------------------------------------------------------
2002-10-01 15:32:14 +00:00
$!
$! Check if this is a define relating to the properties of the C/C++
$! compiler
$!
$CHECK_CC_QUAL:
$ open/write tmpc 'tc
2002-10-01 15:32:14 +00:00
$ ccqual = "/warn=(disable=questcompare)"
$ write tmpc "#include <stdio.h>"
$ write tmpc "unsigned int i = 1;"
$ write tmpc "int main(){"
$ write tmpc "if (i < 0){printf(""Mission impossible\n"");}}"
2002-10-01 15:32:14 +00:00
$ close tmpc
$ gosub cc_qual_check
$ return
$!
$!-----------------------------------------------------------------------------
2002-10-01 15:32:14 +00:00
$!
$! Check for properties of C/C++ compiler
$!
$CC_QUAL_CHECK:
$ cc_qual = false
$ set message/nofac/noident/nosever/notext
$ cc 'ccqual' 'tmpnam'
$ if $status then cc_qual = true
$ set message/fac/ident/sever/text
$ delete/nolog 'tmpnam'.*;*
$ if cc_qual then ccopt = ccopt + ccqual
2002-10-01 15:32:14 +00:00
$ return
$!-----------------------------------------------------------------------------
2002-10-01 15:32:14 +00:00
$!
$ compileit : subroutine
1998-07-30 20:54:47 +00:00
$ ploc = f$locate("]",p1)
[SV 42447]: VMS simulate exporting symbols This also includes fixing the most of the exit handling code for VMS. Self tests: Previously about 94 Tests in 36 categories fail. Now about 45 tests in 22 categories fail. Because some tests do not properly clean up, the number of tests that fail can vary by one or two test cases between consecutive runs. * Makefile.am: Add new VMS files. * job.c: add prototype for vms_strsignal(). * job.c: (child_error): Remove VMS specific code as no longer needed. * job.c: (reap_children): The VMS specific code was setting the status to 0 instead of setting it to the proper exit status. * job.h: Add vms_launch_status to struct child. * main.c: (main): Use environment variables for options to use MCR * instead of a foreign command, and to always use command files for subprocesses. For VMS use (set_program_name) routine which is common to ports of other GNU packages to VMS to set the program name used internally. Use (vms_putenv_symbol) to set up symbols to be visible in child programs, including recursive make launched by execve() Start of Bash shell detection code for VMS. * makefile.com: Need nested_include=none for building on VMS search lists. Add vms_progname, vms_exit, and vms_export_symbol. * makefile.vms: Need nested_include=none for building on VMS search lists. Add vms_progname, vms_exit, vms_export_symbol. * makeint.h: Make sure non-standard "VMS" macro is defined. Add prototypes for new VMS routines. Remove VMS-specific failure codes. * vmsjobs.c: Add VMS POSIX exit code constants. (_is_unixy_shell): Detect Bash shell. (vms_strsignal): simulate strsignal() on VMS. (vmsHandleChildTerm): fix to properly report failed LIB$SPAWN() exit status codes. Remove code that duplicated code in job.c. (child_execute_job): Export environment symbols before spawning a child and restore afterward unless option to use command files for subprocesses is set. Improve handling of UNIX null commands ":". * vms_exit.c: Provides vms_exit() to detect if an exit code is UNIX or VMS, and converts the UNIX code into a VMS exit code. * vms_export_symbol.c: Routines to create DCL symbols that work like shell aliases or exported shell symbols and clean them up on exit. * vms_export_symbol_test.com: Unit test for vms_export_symbol.c * vms_progname.c: New file: VMS specific replace for progname.c that is used in some GNU projects.
2014-09-14 01:20:22 +00:00
$! filnam = p1
$ if ploc .lt. f$length(p1)
$ then
$ objdir = f$extract(0, ploc+1, p1)
$ write optf p1
$ else
$ objdir := []
$ write optf objdir+p1
$ endif
Convert GNU make to use the gnulib portability library Move content from glob/* and config/* into standard GNU directory locations lib/* and m4/*. Install the gnulib bootstrap script and its configuration file, and create a bootstrap.bat file for Windows. Update the README.git file with new requirements and instructions for building from Git. At this point we only install the alloca, getloadavg, and FDL modules from gnulib. We keep our old glob/fnmatch implementation since the gnulib versions require significant amounts of infrastructure which doesn't exist on Windows yet. Further work is required here. Due to a problem with gnulib's version of getloadavg, we need to bump the minimum required version of automake to 1.16.1 unfortunately. * README.git: Update instructions * NEWS: Move developer news to a separate section * configure.ac: Update for use with gnulib modules * bootstrap: Bootstrap from Git workspace (import from gnulib) * bootstrap.conf: Bootstrap configuration for GNU make * bootstrap.bat: Bootstrap from Git workspace for Windows * gl/modules/make-glob: Support our local fnmatch/glob implementation * config/acinclude.m4: Move to m4/ * config/dospaths.m4: Move to m4/ * glob/fnmatch.c: Move to lib/ * glob/fnmatch.h.in: Move to lib/ * glob/glob.c: Move to lib/ * glob/glob.h.in: Move to lib/ * Makefile.am: Update for new directories * build.template: Update for new directories * build_w32.bat: Update for new directories * builddos.bat: Update for new directories * maintMakefile: Update for new directories * makefile.com: Update for new directories * mk/Amiga.mk: Update for new directories * mk/Posix.mk.in: Update for new directories * mk/VMS.mk: Update for new directories * mk/Windows32.mk: Update for new directories * mk/msdosdjgpp.mk: Update for new directories * po/LINGUAS: One language per line (needed by gnulib) * INSTALL: Remove (obtained from gnulib) * src/alloca.c: Remove (obtained from gnulib) * src/getloadavg.c: Remove (obtained from gnulib) * po/Makevars: Remove (created by bootstrap) * config/*: Remove leftover files * glob/*: Remove leftover files
2018-07-01 16:28:25 +00:00
$ cc'ccopt'/nested=none/include=([],[.src],[.lib])/obj='objdir' -
[SV 42447]: VMS simulate exporting symbols This also includes fixing the most of the exit handling code for VMS. Self tests: Previously about 94 Tests in 36 categories fail. Now about 45 tests in 22 categories fail. Because some tests do not properly clean up, the number of tests that fail can vary by one or two test cases between consecutive runs. * Makefile.am: Add new VMS files. * job.c: add prototype for vms_strsignal(). * job.c: (child_error): Remove VMS specific code as no longer needed. * job.c: (reap_children): The VMS specific code was setting the status to 0 instead of setting it to the proper exit status. * job.h: Add vms_launch_status to struct child. * main.c: (main): Use environment variables for options to use MCR * instead of a foreign command, and to always use command files for subprocesses. For VMS use (set_program_name) routine which is common to ports of other GNU packages to VMS to set the program name used internally. Use (vms_putenv_symbol) to set up symbols to be visible in child programs, including recursive make launched by execve() Start of Bash shell detection code for VMS. * makefile.com: Need nested_include=none for building on VMS search lists. Add vms_progname, vms_exit, and vms_export_symbol. * makefile.vms: Need nested_include=none for building on VMS search lists. Add vms_progname, vms_exit, vms_export_symbol. * makeint.h: Make sure non-standard "VMS" macro is defined. Add prototypes for new VMS routines. Remove VMS-specific failure codes. * vmsjobs.c: Add VMS POSIX exit code constants. (_is_unixy_shell): Detect Bash shell. (vms_strsignal): simulate strsignal() on VMS. (vmsHandleChildTerm): fix to properly report failed LIB$SPAWN() exit status codes. Remove code that duplicated code in job.c. (child_execute_job): Export environment symbols before spawning a child and restore afterward unless option to use command files for subprocesses is set. Improve handling of UNIX null commands ":". * vms_exit.c: Provides vms_exit() to detect if an exit code is UNIX or VMS, and converts the UNIX code into a VMS exit code. * vms_export_symbol.c: Routines to create DCL symbols that work like shell aliases or exported shell symbols and clean them up on exit. * vms_export_symbol_test.com: Unit test for vms_export_symbol.c * vms_progname.c: New file: VMS specific replace for progname.c that is used in some GNU projects.
2014-09-14 01:20:22 +00:00
/define=("allocated_variable_expand_for_file=alloc_var_expand_for_file",-
"unlink=remove","HAVE_CONFIG_H","VMS") -
2002-10-01 15:32:14 +00:00
'p1'
$ exit
$ endsubroutine : compileit
$!
$!-----------------------------------------------------------------------------
2023-01-01 15:04:37 +00:00
$!Copyright (C) 1996-2023 Free Software Foundation, Inc.
$!This file is part of GNU Make.
$!
$!GNU Make is free software; you can redistribute it and/or modify it under
$!the terms of the GNU General Public License as published by the Free Software
$!Foundation; either version 3 of the License, or (at your option) any later
$!version.
$!
$!GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
$!WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
$!FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
$!details.
$!
$!You should have received a copy of the GNU General Public License along with
$!this program. If not, see <https://www.gnu.org/licenses/>.