mirror of
https://github.com/mirror/make.git
synced 2026-08-21 17:33:28 +08:00
Compare commits
104 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a66bf2d736 | ||
|
|
31c2024b2e | ||
|
|
7df0fe77d8 | ||
|
|
9fc787c658 | ||
|
|
1afb0ad372 | ||
|
|
86a058029b | ||
|
|
0a3a0756b9 | ||
|
|
3712e8a819 | ||
|
|
9ed452b041 | ||
|
|
b11bef0bea | ||
|
|
bd716a1ec1 | ||
|
|
b484efca56 | ||
|
|
562344122f | ||
|
|
9a2451af0b | ||
|
|
7f9ce6e97b | ||
|
|
621e9edfe9 | ||
|
|
986632ec23 | ||
|
|
95ffcda425 | ||
|
|
dcca1b5b0e | ||
|
|
9cad73ad82 | ||
|
|
8e7a28a6a4 | ||
|
|
98de32a681 | ||
|
|
5369be5079 | ||
|
|
8de07f3e4a | ||
|
|
f970315766 | ||
|
|
579ee85941 | ||
|
|
7e51810bb5 | ||
|
|
bd30df4478 | ||
|
|
1f2fd22fec | ||
|
|
ab1210b1fe | ||
|
|
241787d8e4 | ||
|
|
faeeb27166 | ||
|
|
cab353d1dd | ||
|
|
8b01e6bebf | ||
|
|
55c00544cc | ||
|
|
8d577c2ff4 | ||
|
|
e44d6a12bb | ||
|
|
423c3955d9 | ||
|
|
ac67346d0f | ||
|
|
e364498113 | ||
|
|
85047eb904 | ||
|
|
0faa98a0bb | ||
|
|
8411528fdd | ||
|
|
d2a3e9ca9c | ||
|
|
e1863c05d8 | ||
|
|
b981bfd197 | ||
|
|
88713683fe | ||
|
|
a7cac0f0e3 | ||
|
|
165ccf3137 | ||
|
|
24620378ba | ||
|
|
9c8b68a905 | ||
|
|
432cb6575d | ||
|
|
a4937bc897 | ||
|
|
889303cdfe | ||
|
|
99385ee6f7 | ||
|
|
f5f5adb62c | ||
|
|
865d90bb1e | ||
|
|
30b25acc4e | ||
|
|
f8905059c3 | ||
|
|
12a3104c3d | ||
|
|
7b485daffb | ||
|
|
757849cd93 | ||
|
|
9d58570c77 | ||
|
|
d49ab08ae0 | ||
|
|
10a4b120bd | ||
|
|
309768aff1 | ||
|
|
9c28d5125d | ||
|
|
a7794f483b | ||
|
|
5d653b535a | ||
|
|
53b4a9e668 | ||
|
|
d4723d643d | ||
|
|
107ab16bf6 | ||
|
|
07f2666b91 | ||
|
|
f4b746b8c2 | ||
|
|
d7f25cfda5 | ||
|
|
b9a01a8b3b | ||
|
|
d654bff457 | ||
|
|
74ed682c54 | ||
|
|
e498e464dc | ||
|
|
d1d737d0fa | ||
|
|
87e5b64f41 | ||
|
|
70df3c35bf | ||
|
|
01a745025d | ||
|
|
4792e154b6 | ||
|
|
188b2a0f23 | ||
|
|
52191d9d61 | ||
|
|
dc9ae5e017 | ||
|
|
723e047428 | ||
|
|
b69b04dc8c | ||
|
|
b539908f73 | ||
|
|
2fb91e19a0 | ||
|
|
f96c114e22 | ||
|
|
98197303b1 | ||
|
|
f8786092ad | ||
|
|
1d4c15b4e1 | ||
|
|
b1c7f0df4e | ||
|
|
8e12202870 | ||
|
|
1f4ca0539b | ||
|
|
d0944ee2e8 | ||
|
|
38066b6f19 | ||
|
|
3bf3fde984 | ||
|
|
543521cd47 | ||
|
|
e8122ecb5d | ||
|
|
55a0c0e414 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -13,6 +13,7 @@ Makefile
|
||||
Makefile.in
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
config.cache
|
||||
config.h
|
||||
config.h.in
|
||||
config.log
|
||||
@@ -29,6 +30,8 @@ make
|
||||
|
||||
# Distribution artifacts
|
||||
.dep_segment
|
||||
.check-git-HEAD
|
||||
ChangeLog
|
||||
Makefile.DOS
|
||||
NMakefile
|
||||
README
|
||||
@@ -44,3 +47,4 @@ config.h.W32
|
||||
configh.dos
|
||||
make-[0-9]*/
|
||||
make-[0-9]*.tar.*
|
||||
checkcfg.*.log
|
||||
|
||||
2
AUTHORS
2
AUTHORS
@@ -72,7 +72,7 @@ With suggestions/comments/bug reports from a cast of ... well ...
|
||||
hundreds, anyway :)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1997-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997-2014 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
|
||||
|
||||
@@ -1703,7 +1703,7 @@ Thu Sep 14 18:29:38 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
|
||||
existing variable's origin, is `o_env', make it `o_env_override'.
|
||||
|
||||
* load.c: Use the symbol KERNEL_FILE_NAME instead of KERNEL_FILE.
|
||||
* compatMakefile: Changed the comment for `LOAD_AVG' accordinly.
|
||||
* compatMakefile: Changed the comment for `LOAD_AVG' accordingly.
|
||||
|
||||
Thu Sep 7 16:46:26 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
|
||||
|
||||
@@ -3218,7 +3218,7 @@ Sun Feb 5 19:52:38 1989 Roland McGrath (mcgrath at paris.Berkeley.EDU)
|
||||
* variable.c (expand_function: `shell'): Use
|
||||
`shell_function_completed'. Block children before forking and
|
||||
unblock after `shell_function_pid' is set properly and
|
||||
`shell_functon_completed' is reset to 0.
|
||||
`shell_function_completed' is reset to 0.
|
||||
|
||||
* commands.c (child_handler): When the child of the `shell' function
|
||||
completes, set `shell_function_completed' to 1 if it actually ran,
|
||||
@@ -4465,7 +4465,7 @@ Fri Sep 16 13:59:59 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
|
||||
`maxsuffix', and must be called before count_implicit_rule_limits.
|
||||
|
||||
* rule.c (pattern_search): If an existent (non-intermediate)
|
||||
dependendency was found via a terminal rule, set its
|
||||
dependency was found via a terminal rule, set its
|
||||
`tried_implicit' flag, so it will never have implicit rule search done.
|
||||
|
||||
* glob.c: Bug fix to avoid alloca(0).
|
||||
@@ -4826,7 +4826,7 @@ Sat Jul 30 15:47:23 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
|
||||
new entry as the old entry's prev pointer.
|
||||
|
||||
* dir.c: Re-indented the `struct dir' definition to be right.
|
||||
(dir_load): Cleaned up slighty.
|
||||
(dir_load): Cleaned up slightly.
|
||||
(file_exists_p): Removed comment saying we could use `access', since
|
||||
that is a bad idea (except for setuid programs). Cleaned up slightly.
|
||||
|
||||
|
||||
@@ -1,3 +1,109 @@
|
||||
2013-10-09 Paul Smith <psmith@gnu.org>
|
||||
|
||||
Version 4.0 released.
|
||||
|
||||
* configure.ac: Updated for the release.
|
||||
* NEWS: Updated for the release.
|
||||
|
||||
* maintMakefile (tag-release): New target to add a Git tag.
|
||||
* read.c (eval): Typo fix.
|
||||
* ChangeLog.1: Typo fixes.
|
||||
* w32/subproc/sub_proc.c (process_cleanup): Typo fix.
|
||||
|
||||
2013-10-07 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* w32/compat/posixfcn.c (tmpfile): Move declaration of h before
|
||||
the first executable statement. Reported by Gisle Vanem
|
||||
<gvanem@yahoo.no>.
|
||||
|
||||
2013-10-05 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* makeint.h (MAP_USERFUNC): A new map type for function names.
|
||||
* main.c (initialize_stopchar_map): Set up the function name map.
|
||||
|
||||
* gnumake.h (gmk_func_ptr): Define a type for function pointers.
|
||||
(gmk_add_function): Convert the last argument to FLAGS.
|
||||
(GMK_FUNC_*): Define flags for the function. Change the default
|
||||
behavior to "expand" since that's the most common one.
|
||||
|
||||
* function.c (function_table_entry): Use new function pointer type.
|
||||
(lookup_function): Accept any valid function name character based
|
||||
on the MAP_USERFUNC values.
|
||||
(define_new_function): Use the new calling signature. Verify that
|
||||
registered functions have valid names.
|
||||
|
||||
* guile.c (guile_gmake_setup): Use new calling signatures.
|
||||
* loadapi.c (gmk_add_function): Ditto.
|
||||
* variable.h (define_new_function): Ditto.
|
||||
|
||||
* doc/make.texi (Loaded Object API): Make the registered function
|
||||
API documentation more clear.
|
||||
|
||||
2013-10-03 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* function.c (abspath): Reset root_len to one for Cygwin only when
|
||||
HAVE_DOS_PATHS is defined. Suggested by Christopher Faylor.
|
||||
|
||||
2013-10-02 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* w32/compat/posixfcn.c (tmpfile): New function, a replacement for
|
||||
the Windows libc version.
|
||||
|
||||
Fix $abspath on Cygwin when HAVE_DOS_PATHS is in effect.
|
||||
* function.c (IS_ABSOLUTE) [__CYGWIN__]: Special definition for
|
||||
Cygwin.
|
||||
(abspath) [__CYGWIN__]: Reset root_len to 1 if the absolute file
|
||||
name has the Posix /foo/bar form.
|
||||
[HAVE_DOS_PATHS]: Use root_len instead of hard-coded 2.
|
||||
|
||||
2013-10-01 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* configure.ac: Update version to 3.99.93.
|
||||
* NEWS: Ditto.
|
||||
|
||||
2013-09-30 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* guile.c: Portability fixes for Guile 1.8.
|
||||
|
||||
2013-09-29 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* output.c (output_dump): Always write Enter/Leave messages to stdio.
|
||||
(log_working_directory): This now always writes to stdio, so we
|
||||
don't need the struct output parameter anymore.
|
||||
(output_start): Show the working directory when output_sync is not
|
||||
set or is recursive.
|
||||
* main.c (main): Ensure the special "already shown Enter message"
|
||||
token is removed from MAKE_RESTARTS before the user can see it.
|
||||
* function.c (func_shell_base): If the output_context stderr
|
||||
exists but is invalid, write to the real stderr.
|
||||
Fixes suggested by Frank Heckenbach <f.heckenbach@fh-soft.de>.
|
||||
|
||||
* output.c: Guard unistd.h inclusion, add io.h.
|
||||
* gnumake.h: Move GMK_EXPORT before the declarations.
|
||||
* make_msvc_net2003.vcproj: Add missing files.
|
||||
Changes for MSVC suggested by Gerte Hoogewerf <g.hoogewerf@gmail.com>
|
||||
|
||||
* function.c (func_shell_base) [EMX]: Fix EMX support for output-sync.
|
||||
* job.c (child_execute_job) [EMX]: Ditto.
|
||||
* job.h (child_execute_job) [EMX]: Ditto.
|
||||
* w32/compat/posixfcn.c: Invert the test for NO_OUTPUT_SYNC.
|
||||
|
||||
* guile.c (GSUBR_TYPE): Pre-2.0 Guile doesn't provide a typedef
|
||||
for gsubr pointers. Create one.
|
||||
(guile_define_module): Use it.
|
||||
(internal_guile_eval): Force UTF-8 encoding for Guile strings.
|
||||
|
||||
* main.c (main): Clear GNUMAKEFLAGS after parsing, to avoid
|
||||
proliferation of options.
|
||||
* NEWS: Document it.
|
||||
* doc/make.texi (Options/Recursion): Ditto.
|
||||
|
||||
2013-09-23 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* w32/compat/posixfcn.c: Fix the forgotten OUTPUT_SYNC conditional.
|
||||
|
||||
* job.h: Ditto, but in a comment.
|
||||
|
||||
2013-09-22 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* configure.ac: Update version to 3.99.92.
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*-Makefile-*- template for DJGPP
|
||||
# Makefile.in generated automatically by automake 1.2 from Makefile.am
|
||||
#
|
||||
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2014 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
|
||||
|
||||
17
Makefile.am
17
Makefile.am
@@ -1,6 +1,6 @@
|
||||
# This is a -*-Makefile-*-, or close enough
|
||||
#
|
||||
# Copyright (C) 1997-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1997-2014 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
|
||||
@@ -40,15 +40,11 @@ else
|
||||
endif
|
||||
|
||||
make_SOURCES = ar.c arscan.c commands.c default.c dir.c expand.c file.c \
|
||||
function.c getopt.c getopt1.c implicit.c job.c load.c \
|
||||
function.c getopt.c getopt1.c guile.c implicit.c job.c load.c \
|
||||
loadapi.c main.c misc.c output.c read.c remake.c rule.c \
|
||||
signame.c strcache.c variable.c version.c vpath.c hash.c \
|
||||
$(remote)
|
||||
|
||||
if HAVE_GUILE
|
||||
make_SOURCES += guile.c
|
||||
endif
|
||||
|
||||
EXTRA_make_SOURCES = vmsjobs.c remote-stub.c remote-cstms.c
|
||||
|
||||
noinst_HEADERS = commands.h dep.h filedef.h job.h makeint.h rule.h variable.h \
|
||||
@@ -90,13 +86,6 @@ EXTRA_DIST = README build.sh.in $(man_MANS) \
|
||||
|
||||
DISTCLEANFILES = build.sh
|
||||
|
||||
# Forward targets
|
||||
|
||||
html:
|
||||
cd doc && $(MAKE) $(AM_MAKEFLAGS) $@
|
||||
|
||||
.PHONY: html
|
||||
|
||||
# --------------- Internationalization Section
|
||||
|
||||
localedir = $(datadir)/locale
|
||||
@@ -183,7 +172,7 @@ loadavg_LDADD = @GETLOADAVG_LIBS@
|
||||
#
|
||||
MAKETESTFLAGS =
|
||||
|
||||
check-regression:
|
||||
check-regression: tests/config-flags.pm
|
||||
@if test -f '$(srcdir)/tests/run_make_tests'; then \
|
||||
if $(PERL) -v >/dev/null 2>&1; then \
|
||||
case `cd '$(srcdir)'; pwd` in `pwd`) : ;; \
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# NOTE: If you have no 'make' program at all to process this makefile, run
|
||||
# 'build.sh' instead.
|
||||
#
|
||||
# Copyright (C) 1995-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1995-2014 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
|
||||
|
||||
86
NEWS
86
NEWS
@@ -1,6 +1,6 @@
|
||||
GNU make NEWS -*-indented-text-*-
|
||||
History of user-visible changes.
|
||||
23 Sep 2013
|
||||
05 Oct 2014
|
||||
|
||||
See the end of this file for copyrights and conditions.
|
||||
|
||||
@@ -9,7 +9,28 @@ manual, which is contained in this distribution as the file doc/make.texi.
|
||||
See the README file and the GNU make manual for instructions for
|
||||
reporting bugs.
|
||||
|
||||
Version 3.99.92
|
||||
Version 4.1 (05 Oct 2014)
|
||||
|
||||
A complete list of bugs fixed in this version is available here:
|
||||
|
||||
http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=105&set=custom
|
||||
|
||||
* New variables: $(MAKE_TERMOUT) and $(MAKE_TERMERR) are set to non-empty
|
||||
values if stdout or stderr, respectively, are believed to be writing to a
|
||||
terminal. These variables are exported by default.
|
||||
|
||||
* Allow a no-text-argument form of the $(file ...) function. Without a text
|
||||
argument nothing is written to the file: it is simply opened in the
|
||||
requested mode, then closed again.
|
||||
|
||||
* Change the fatal error for mixed explicit and implicit rules, that was
|
||||
introduced in GNU make 3.82, to a non-fatal error. However, this syntax is
|
||||
still deprecated and may return to being illegal in a future version of GNU
|
||||
make. Makefiles that rely on this syntax should be fixed.
|
||||
See https://savannah.gnu.org/bugs/?33034
|
||||
|
||||
|
||||
Version 4.0 (09 Oct 2013)
|
||||
|
||||
A complete list of bugs fixed in this version is available here:
|
||||
|
||||
@@ -23,6 +44,14 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101&set
|
||||
* Each backslash/newline (plus subsequent whitespace) is converted to a
|
||||
single space
|
||||
|
||||
* New feature: GNU Guile integration
|
||||
This version of GNU make can be compiled with GNU Guile integration.
|
||||
GNU Guile serves as an embedded extension language for make.
|
||||
See the "Guile Function" section in the GNU Make manual for details.
|
||||
Currently GNU Guile 1.8 and 2.0+ are supported. In Guile 1.8 there is no
|
||||
support for internationalized character sets. In Guile 2.0+, scripts can be
|
||||
encoded in UTF-8.
|
||||
|
||||
* New command line option: --output-sync (-O) enables grouping of output by
|
||||
target or by recursive make. This is useful during parallel builds to avoid
|
||||
mixing output from different jobs together giving hard-to-understand
|
||||
@@ -47,6 +76,8 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101&set
|
||||
|
||||
* New feature: "!=" shell assignment operator as an alternative to the
|
||||
$(shell ...) function. Implemented for compatibility with BSD makefiles.
|
||||
Note there are subtle differences between "!=" and $(shell ...). See the
|
||||
description in the GNU make manual.
|
||||
WARNING: Backward-incompatibility!
|
||||
Variables ending in "!" previously defined as "variable!= value" will now be
|
||||
interpreted as shell assignment. Change your assignment to add whitespace
|
||||
@@ -58,11 +89,6 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101&set
|
||||
version of POSIX (see http://austingroupbugs.net/view.php?id=330). It is
|
||||
not necessary to define the .POSIX target to access this operator.
|
||||
|
||||
* New feature: GNU Guile integration
|
||||
This version of GNU make can be compiled with GNU Guile integration.
|
||||
GNU Guile serves as an embedded extension language for make.
|
||||
See the "Guile Function" section in the GNU Make manual for details.
|
||||
|
||||
* New feature: Loadable objects
|
||||
This version of GNU make contains a "technology preview": the ability to
|
||||
load dynamic objects into the make runtime. These objects can be created by
|
||||
@@ -73,7 +99,8 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101&set
|
||||
* New variable: $(GNUMAKEFLAGS) will be parsed for make flags, just like
|
||||
MAKEFLAGS is. It can be set in the environment or the makefile, containing
|
||||
GNU make-specific flags to allow your makefile to be portable to other
|
||||
versions of make. GNU make never sets or modifies GNUMAKEFLAGS.
|
||||
versions of make. Once this variable is parsed, GNU make will set it to the
|
||||
empty string so that flags will not be duplicated on recursion.
|
||||
|
||||
* New variable: `MAKE_HOST' gives the name of the host architecture
|
||||
make was compiled for. This is the same value you see after 'Built for'
|
||||
@@ -81,8 +108,10 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101&set
|
||||
|
||||
* Behavior of MAKEFLAGS and MFLAGS is more rigorously defined. All simple
|
||||
flags are grouped together in the first word of MAKEFLAGS. No options that
|
||||
accept arguments appear there. If no simple flags are present MAKEFLAGS
|
||||
begins with a space. MFLAGS never begins with "- ".
|
||||
accept arguments appear in the first word. If no simple flags are present
|
||||
MAKEFLAGS begins with a space. Flags with both short and long versions
|
||||
always use the short versions in MAKEFLAGS. Flags are listed in
|
||||
alphabetical order using ASCII ordering. MFLAGS never begins with "- ".
|
||||
|
||||
* Setting the -r and -R options in MAKEFLAGS inside a makefile now works as
|
||||
expected, removing all built-in rules and variables, respectively.
|
||||
@@ -135,15 +164,6 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=104&set
|
||||
results from wildcard expansions, use the $(sort ...) function to request
|
||||
it explicitly.
|
||||
|
||||
* WARNING: Backward-incompatibility!
|
||||
In previous versions of make it was acceptable to list one or more explicit
|
||||
targets followed by one or more pattern targets in the same rule and it
|
||||
worked "as expected". However, this was not documented as acceptable and if
|
||||
you listed any explicit targets AFTER the pattern targets, the entire rule
|
||||
would be mis-parsed. This release removes this ability completely: make
|
||||
will generate an error message if you mix explicit and pattern targets in
|
||||
the same rule.
|
||||
|
||||
* WARNING: Backward-incompatibility!
|
||||
As a result of parser enhancements, three backward-compatibility issues
|
||||
exist: first, a prerequisite containing an "=" cannot be escaped with a
|
||||
@@ -231,8 +251,8 @@ Version 3.81 (01 Apr 2006)
|
||||
any prerequisite that does not exist, even though that prerequisite
|
||||
might have caused the target to rebuild. Starting with the _next_
|
||||
release of GNU make, '$?' will contain all prerequisites that caused
|
||||
the target to be considered out of date. See this Savannah bug:
|
||||
http://savannah.gnu.org/bugs/index.php?func=detailitem&item_id=16051
|
||||
the target to be considered out of date.
|
||||
See http://savannah.gnu.org/bugs/?16051
|
||||
|
||||
* WARNING: Backward-incompatibility!
|
||||
GNU make now implements a generic "second expansion" feature on the
|
||||
@@ -759,7 +779,7 @@ Version 3.69 (07 Nov 1993)
|
||||
have reversed the change made in version 3.68 because it turned out to
|
||||
cause a paradoxical situation in cases like:
|
||||
|
||||
export variable = $(shell echo value)
|
||||
export variable = $(shell echo value)
|
||||
|
||||
When Make attempted to put this variable in the environment for a
|
||||
recipe, it would try expand the value by running the shell command
|
||||
@@ -782,8 +802,8 @@ Version 3.68 (28 Jul 1993)
|
||||
foo.a(b.o) bar.a(c.o) bar.a(d.o)'.
|
||||
|
||||
* A suffix rule `.X.a' now produces two pattern rules:
|
||||
(%.o): %.X # Previous versions produced only this.
|
||||
%.a: %.X # Now produces this as well, just like other suffixes.
|
||||
(%.o): %.X # Previous versions produced only this.
|
||||
%.a: %.X # Now produces this as well, just like other suffixes.
|
||||
|
||||
* The new flag `--warn-undefined-variables' says to issue a warning message
|
||||
whenever Make expands a reference to an undefined variable.
|
||||
@@ -853,15 +873,15 @@ Version 3.63 (22 Jan 1993)
|
||||
no longer automatically put into the environments of the recipe lines that
|
||||
Make runs. Instead, only variables specified on the command line or in
|
||||
the environment are exported by default. To export others, use:
|
||||
export VARIABLE
|
||||
export VARIABLE
|
||||
or you can define variables with:
|
||||
export VARIABLE = VALUE
|
||||
export VARIABLE = VALUE
|
||||
or:
|
||||
export VARIABLE := VALUE
|
||||
export VARIABLE := VALUE
|
||||
You can use just:
|
||||
export
|
||||
export
|
||||
or:
|
||||
.EXPORT_ALL_VARIABLES:
|
||||
.EXPORT_ALL_VARIABLES:
|
||||
to get the old behavior. See the node `Variables/Recursion' in the manual
|
||||
for a full description.
|
||||
|
||||
@@ -881,9 +901,9 @@ Version 3.63 (22 Jan 1993)
|
||||
|
||||
* A single `include' directive can now specify more than one makefile to
|
||||
include, like this:
|
||||
include file1 file2
|
||||
include file1 file2
|
||||
You can also use shell file name patterns in an `include' directive:
|
||||
include *.mk
|
||||
include *.mk
|
||||
|
||||
* The default directories to search for included makefiles, and for
|
||||
libraries specified with `-lNAME', are now set by configuration.
|
||||
@@ -1019,7 +1039,7 @@ Version 3.49
|
||||
* The `wildcard' variable expansion function now expands ~ and ~USER.
|
||||
|
||||
* Messages indicating failed recipe lines now contain the target name:
|
||||
make: *** [target] Error 1
|
||||
make: *** [target] Error 1
|
||||
|
||||
* The `-p' output format has been changed somewhat to look more like
|
||||
makefile rules and to give all information that Make has about files.
|
||||
@@ -1199,7 +1219,7 @@ Version 3.05
|
||||
(Changes from versions 1 through 3.05 were never recorded. Sorry.)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2014 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
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# NOTE: If you have no 'make' program at all to process this makefile,
|
||||
# run 'build_w32.bat' instead.
|
||||
#
|
||||
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-2014 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
|
||||
@@ -32,9 +32,9 @@ CFLAGS_debug = $(CFLAGS_any) /Od /D DEBUG /D _DEBUG /FR.\WinDebug/ /Fp.\WinDebug
|
||||
CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/
|
||||
|
||||
LDFLAGS_debug = w32\subproc\WinDebug\subproc.lib /NOLOGO /SUBSYSTEM:console\
|
||||
/INCREMENTAL:no /PDB:WinDebug/make.pdb /OUT:WinDebug/make.exe /DEBUG
|
||||
/STACK:0x400000 /INCREMENTAL:no /PDB:WinDebug/make.pdb /OUT:WinDebug/make.exe /DEBUG
|
||||
LDFLAGS_release = w32\subproc\WinRel\subproc.lib /NOLOGO /SUBSYSTEM:console\
|
||||
/INCREMENTAL:no /OUT:WinRel/make.exe
|
||||
/STACK:0x400000 /INCREMENTAL:no /OUT:WinRel/make.exe
|
||||
|
||||
all: config.h subproc Release Debug
|
||||
|
||||
@@ -72,7 +72,7 @@ $(OUTDIR):
|
||||
|
||||
LIBS = kernel32.lib user32.lib advapi32.lib
|
||||
|
||||
#guile = $(OUTDIR)/guile.obj
|
||||
guile = $(OUTDIR)/guile.obj
|
||||
|
||||
OBJS = \
|
||||
$(OUTDIR)/ar.obj \
|
||||
@@ -89,6 +89,7 @@ OBJS = \
|
||||
$(OUTDIR)/hash.obj \
|
||||
$(OUTDIR)/implicit.obj \
|
||||
$(OUTDIR)/job.obj \
|
||||
$(OUTDIR)/load.obj \
|
||||
$(OUTDIR)/main.obj \
|
||||
$(OUTDIR)/misc.obj \
|
||||
$(OUTDIR)/output.obj \
|
||||
@@ -105,6 +106,7 @@ OBJS = \
|
||||
$(OUTDIR)/fnmatch.obj \
|
||||
$(OUTDIR)/dirent.obj \
|
||||
$(OUTDIR)/pathstuff.obj \
|
||||
$(OUTDIR)/posixfcn.obj \
|
||||
$(guile)
|
||||
|
||||
$(OUTDIR)/make.exe: $(OUTDIR) $(OBJS)
|
||||
@@ -121,5 +123,7 @@ $(OUTDIR)/fnmatch.obj : glob/fnmatch.c
|
||||
$(CC) $(CFLAGS) /c $?
|
||||
$(OUTDIR)/dirent.obj : w32/compat/dirent.c
|
||||
$(CC) $(CFLAGS) /c $?
|
||||
$(OUTDIR)/posixfcn.obj : w32/compat/posixfcn.c
|
||||
$(CC) $(CFLAGS) /c $?
|
||||
$(OUTDIR)/pathstuff.obj : w32/pathstuff.c
|
||||
$(CC) $(CFLAGS) /c $?
|
||||
|
||||
@@ -61,7 +61,7 @@ If you plan to use recursive makes, install make resident:
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1995-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2014 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
|
||||
|
||||
@@ -324,7 +324,7 @@ Bug reports:
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-2014 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
|
||||
|
||||
@@ -160,7 +160,7 @@ from the make source tree.
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2003-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2003-2014 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
|
||||
|
||||
@@ -268,7 +268,7 @@ Long command lines are now converted to command files.
|
||||
Comma (',') as a separator is now allowed. See makefile.vms for an example.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-2014 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
|
||||
|
||||
@@ -7,7 +7,7 @@ It builds with the MinGW port of GCC (tested with GCC 3.4.2).
|
||||
It also builds with MSVC 2.x, 4.x, 5.x, 6.x, and 2003 as well as
|
||||
with .NET 7.x and .NET 2003.
|
||||
|
||||
As of version 3.83, a build with Guile is supported (tested with Guile
|
||||
As of version 4.0, a build with Guile is supported (tested with Guile
|
||||
2.0.3). To build with Guile, you will need, in addition to Guile
|
||||
itself, its dependency libraries and the pkg-config program. The
|
||||
latter is used to figure out which compilation and link switches and
|
||||
@@ -293,7 +293,7 @@ Bug reports:
|
||||
is described in the GNU make manual and the base README.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-2014 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
|
||||
|
||||
@@ -96,7 +96,7 @@ SunOS 4.1.x:
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1998-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998-2014 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
|
||||
|
||||
96
README.git
96
README.git
@@ -1,7 +1,7 @@
|
||||
-*-text-*-
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2014 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
|
||||
@@ -31,12 +31,17 @@ make source code via Git from the FSF's Savannah project
|
||||
Changes using Git
|
||||
-----------------
|
||||
|
||||
For non-developers, please continue to provide patches as before, or if you
|
||||
For non-developers, you can continue to provide patches as before, or if you
|
||||
make a public repository I can pull from that if you prefer.
|
||||
|
||||
For developers, I'm still new to Git myself, so I don't have a ton of advice.
|
||||
In this release we will continue to create ChangeLog files by hand so please
|
||||
don't forget to update the ChangeLog.
|
||||
Starting with GNU make 4.0 we no longer keep a separate ChangeLog file in
|
||||
source control. We use the Gnulib git-to-changelog conversion script to
|
||||
convert the Git comments into ChangeLog-style entries for release. As a
|
||||
result, please format your Git comments carefully so they will look clean
|
||||
after conversion. In particular, each line of your comment will have a TAB
|
||||
added before it so be sure your comment lines are not longer than 72
|
||||
characters; prefer 70 or less. Please use standard ChangeLog formats for
|
||||
your commit messages (sans the leading TAB of course).
|
||||
|
||||
Rule #1: Don't rewrite pushed history (don't use "git push --force").
|
||||
|
||||
@@ -59,12 +64,13 @@ diff chunks in the same file. There is a video available which helps a lot.
|
||||
Coding Standards
|
||||
----------------
|
||||
|
||||
GNU make code adheres to the GNU Coding Standards. Additionally, GNU make is
|
||||
a foundational bootstrap package for the GNU project; as such it is very
|
||||
conservative about language features it expects. It should build with any C
|
||||
compiler conforming to the ANSI C89 / ISO C90 standard.
|
||||
GNU make code adheres to the GNU Coding Standards. Please use only spaces and
|
||||
no TAB characters in source code.
|
||||
|
||||
Please use only spaces and no TAB characters in source code.
|
||||
Additionally, GNU make is a foundational bootstrap package for the GNU
|
||||
project; as such it is very conservative about language features it expects.
|
||||
It should build with any C compiler conforming to the ANSI C89 / ISO C90
|
||||
standard.
|
||||
|
||||
|
||||
Building From Git
|
||||
@@ -73,7 +79,7 @@ Building From Git
|
||||
To build GNU make from Git, you will need Autoconf, Automake, and
|
||||
Gettext, and any tools that those utilities require (GNU m4, Perl,
|
||||
etc.). See the configure.ac file to find the minimum versions of each
|
||||
of these tools. You will also need a copy of wget.
|
||||
of these tools. You will also need a copy of wget and gnulib.
|
||||
|
||||
When building from Git you must build in the source directory: "VPATH
|
||||
builds" from remote directories are not supported. Once you've created
|
||||
@@ -83,7 +89,6 @@ there.
|
||||
After checking out the code, you will need to perform these steps to get
|
||||
to the point where you can run "make".
|
||||
|
||||
|
||||
1) $ autoreconf -i
|
||||
|
||||
This rebuilds all the things that need rebuilding, installing
|
||||
@@ -92,12 +97,10 @@ to the point where you can run "make".
|
||||
You may get warnings here about missing files like README, etc.
|
||||
Ignore them, they are harmless.
|
||||
|
||||
|
||||
2) $ ./configure
|
||||
|
||||
Generate a Makefile
|
||||
|
||||
|
||||
3) $ make update
|
||||
|
||||
Use wget to retrieve various other files that GNU make relies on,
|
||||
@@ -106,7 +109,6 @@ to the point where you can run "make".
|
||||
NB: You may need GNU make to correctly perform this step; if you use
|
||||
a platform-local make you may get problems with missing files in doc/.
|
||||
|
||||
|
||||
At this point you have successfully brought your Git copy of the GNU
|
||||
make source directory up to the point where it can be treated
|
||||
more-or-less like the official package you would get from ftp.gnu.org.
|
||||
@@ -158,29 +160,48 @@ Steps to Release
|
||||
----------------
|
||||
|
||||
Here are the things that need to be done (in more or less this order)
|
||||
before making an official release:
|
||||
before making an official release. If something breaks such that you need to
|
||||
change code, be sure to start over again sufficiently that everything is
|
||||
consistent (that's why we don't finalize the Git tag, etc. until the end).
|
||||
|
||||
* Update the configure.ac file with the new release number.
|
||||
* Update the EDITION value in the doc/make.texi file.
|
||||
* Update the NEWS file with the release number and date.
|
||||
* Ensure the Savannah bug list URL in the NEWS file uses the correct
|
||||
"Fixed Release" ID number.
|
||||
* Run "make distcheck" to be sure it all works.
|
||||
* Run "make check-alt-config" to be sure alternative configurations work
|
||||
* Run "make update-makeweb" to get a copy of the GNU make web pages
|
||||
* Run "make update-gnuweb" to get a copy of the GNU website boilerplate pages
|
||||
* Update the web page boilerplate if necessary:
|
||||
../gnu-www/www/server/standards/patch-from-parent ../make-web/make.html \
|
||||
../gnu-www/www/server/standards/boilerplate.html
|
||||
* Run "make gendocs" (requires gnulib) to generate the manual files for
|
||||
the GNU make web pages.
|
||||
* Follow the directions from gendocs for the web page repository
|
||||
* run "make tag-release" to create a Git tag for the release
|
||||
* Push everything:
|
||||
git push --tags origin master
|
||||
|
||||
Manage the Savannah project for GNU make:
|
||||
|
||||
>>> This is only for real releases, not release candidate builds <<<
|
||||
|
||||
* In Savannah modify the "Value", "Rank", and "Description" values for the
|
||||
current "SCM" entry in both "Component Version" and "Fix Release" fields
|
||||
to refer to the new release, for "Bugs" and "Patches".
|
||||
* Update the Savannah bug list URL in the NEWS file to use the correct
|
||||
"Fixed Release" ID number.
|
||||
to refer to the new release. The "Rank" field should be 10 less than the
|
||||
previous release so it orders properly.
|
||||
* In Savannah create a new entry for the "Component Version" and "Fix
|
||||
Release" fields:
|
||||
- Value: SCM
|
||||
- Rank: 20
|
||||
- Descr: Fixed in Git; will be available in the next version of Make.
|
||||
* Run "make distcheck" to be sure it all works.
|
||||
* git tag -u <GPGID> <VER> where GPGID is my GPG key fingerprint,
|
||||
and VER is the release version.
|
||||
* Push everything:
|
||||
git push --tags origin master
|
||||
* Create the new release in the Savannah "Bugs" Administration for
|
||||
both the "Component Version" and "Fixed Release" fields.
|
||||
* Create the new release in the Savannah "Patches" Administration for
|
||||
the "Fixed Release" field.
|
||||
|
||||
Start the next release:
|
||||
|
||||
* Update configure.ac and add a ".90" to the release number.
|
||||
* Update the NEWS file with a new section for the release / date.
|
||||
* Update the Savannah URL for the bugs fixed in the NEWS section.
|
||||
|
||||
|
||||
Publishing a Package
|
||||
@@ -224,15 +245,22 @@ Create the announcement in a text file, then sign it with GPG.
|
||||
|
||||
gpg --clearsign <announcement.txt>
|
||||
|
||||
Upload to gnu.org, then login and send from my account there.
|
||||
Or, use your mail client's PGP/GPG signing capabilities.
|
||||
|
||||
To: bug-make@gnu.org, help-make@gnu.org, make-w32@gnu.org
|
||||
CC: info-gnu@gnu.org
|
||||
BCC: make-alpha@gnu.org
|
||||
Announce the release:
|
||||
|
||||
Add a news item to the Savannah project site.
|
||||
* For release candidate builds:
|
||||
To: bug-make@gnu.org
|
||||
CC: coordinator@translationproject.org
|
||||
BCC: help-make@gnu.org, make-w32@gnu.org, make-alpha@gnu.org
|
||||
|
||||
Add an update to freshmeat.net.
|
||||
* For release builds
|
||||
To: info-gnu@gnu.org, bug-make@gnu.org
|
||||
CC: coordinator@translationproject.org
|
||||
BCC: help-make@gnu.org, make-w32@gnu.org, make-alpha@gnu.org
|
||||
|
||||
* Add a news item to the Savannah project site.
|
||||
* Add an update to freecode.com (nee freshmeat.net)
|
||||
|
||||
|
||||
Appendix A - For The Brave
|
||||
|
||||
@@ -162,7 +162,7 @@ at the right README!
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2014 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
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# NOTE: If you have no 'make' program at all to process this makefile,
|
||||
# run 'build.sh' instead.
|
||||
#
|
||||
# Copyright (C) 1995-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1995-2014 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
|
||||
|
||||
26
TODO.private
26
TODO.private
@@ -99,33 +99,9 @@ The Rest of the List
|
||||
you just can't figure it out. The way variables are expanded now
|
||||
means this isn't 100% trivial, but it probably won't be hard.
|
||||
|
||||
8) Integration of Guile as an embedded scripting language. This means:
|
||||
allowing Guile functions to be declared in makefiles somehow, then
|
||||
providing a syntax for invoking them. At least one formulation of
|
||||
that would have the function resolve to a string which would be
|
||||
substituted in the makefile, kind of like $(shell ...) does now, but
|
||||
using the embedded interpreter so there's no process forked of
|
||||
course. Obviously this is an optional add-on feature.
|
||||
|
||||
It could be more advanced than that, even, who knows? Maybe make
|
||||
could provide Guile functions that allow Guile scripts more direct
|
||||
access to internal make structures, somehow. This kind of thing
|
||||
needs a lot of thought.
|
||||
|
||||
Also there's always the flip side: in some very fundamental ways
|
||||
make isn't the best choice right now for a complex build tool. It's
|
||||
great for simple-to-medium tasks, but there are already other tools
|
||||
available for the really tough situations. Ask yourself,
|
||||
realistically, how much work is worthwhile to add to make, given the
|
||||
fundamentals you can't really overcome without significantly
|
||||
affecting backward compatibility--and then why not use another tool
|
||||
in the first place?
|
||||
|
||||
Something to think about.
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1997-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997-2014 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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
dnl acinclude.m4 -- Extra macros needed for GNU make.
|
||||
dnl
|
||||
dnl Automake will incorporate this into its generated aclocal.m4.
|
||||
dnl Copyright (C) 1998-2013 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 1998-2014 Free Software Foundation, Inc.
|
||||
dnl This file is part of GNU Make.
|
||||
dnl
|
||||
dnl GNU Make is free software; you can redistribute it and/or modify it under
|
||||
|
||||
4
amiga.c
4
amiga.c
@@ -1,5 +1,5 @@
|
||||
/* Running commands on Amiga
|
||||
Copyright (C) 1995-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2014 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
|
||||
@@ -42,7 +42,7 @@ MyExecute (char **argv)
|
||||
buffer = AllocMem (len, MEMF_ANY);
|
||||
|
||||
if (!buffer)
|
||||
fatal (NILF, "MyExecute: Cannot allocate space for calling a command");
|
||||
O (fatal, NILF, "MyExecute: Cannot allocate space for calling a command\n");
|
||||
|
||||
ptr = buffer;
|
||||
|
||||
|
||||
2
amiga.h
2
amiga.h
@@ -1,5 +1,5 @@
|
||||
/* Definitions for amiga specific things
|
||||
Copyright (C) 1995-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2014 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
|
||||
|
||||
65
ar.c
65
ar.c
@@ -1,5 +1,5 @@
|
||||
/* Interface to 'ar' archives for GNU Make.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2014 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Make.
|
||||
|
||||
@@ -43,7 +43,7 @@ ar_name (const char *name)
|
||||
return 0;
|
||||
|
||||
if (p[1] == '(' && end[-1] == ')')
|
||||
fatal (NILF, _("attempt to use unsupported feature: '%s'"), name);
|
||||
OS (fatal, NILF, _("attempt to use unsupported feature: '%s'"), name);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -120,7 +120,7 @@ ar_member_date (const char *name)
|
||||
int
|
||||
ar_touch (const char *name)
|
||||
{
|
||||
error (NILF, _("touch archive member is not available on VMS"));
|
||||
O (error, NILF, _("touch archive member is not available on VMS"));
|
||||
return -1;
|
||||
}
|
||||
#else
|
||||
@@ -144,24 +144,24 @@ ar_touch (const char *name)
|
||||
switch (ar_member_touch (arname, memname))
|
||||
{
|
||||
case -1:
|
||||
error (NILF, _("touch: Archive '%s' does not exist"), arname);
|
||||
OS (error, NILF, _("touch: Archive '%s' does not exist"), arname);
|
||||
break;
|
||||
case -2:
|
||||
error (NILF, _("touch: '%s' is not a valid archive"), arname);
|
||||
OS (error, NILF, _("touch: '%s' is not a valid archive"), arname);
|
||||
break;
|
||||
case -3:
|
||||
perror_with_name ("touch: ", arname);
|
||||
break;
|
||||
case 1:
|
||||
error (NILF,
|
||||
_("touch: Member '%s' does not exist in '%s'"), memname, arname);
|
||||
OSS (error, NILF,
|
||||
_("touch: Member '%s' does not exist in '%s'"), memname, arname);
|
||||
break;
|
||||
case 0:
|
||||
val = 0;
|
||||
break;
|
||||
default:
|
||||
error (NILF,
|
||||
_("touch: Bad return code from ar_member_touch on '%s'"), name);
|
||||
OS (error, NILF,
|
||||
_("touch: Bad return code from ar_member_touch on '%s'"), name);
|
||||
}
|
||||
|
||||
free (arname);
|
||||
@@ -172,10 +172,20 @@ ar_touch (const char *name)
|
||||
|
||||
/* State of an 'ar_glob' run, passed to 'ar_glob_match'. */
|
||||
|
||||
/* On VMS, (object) modules in libraries do not have suffixes. That is, to
|
||||
find a match for a pattern, the pattern must not have any suffix. So the
|
||||
suffix of the pattern is saved and the pattern is stripped (ar_glob).
|
||||
If there is a match and the match, which is a module name, is added to
|
||||
the chain, the saved suffix is added back to construct a source filename
|
||||
(ar_glob_match). */
|
||||
|
||||
struct ar_glob_state
|
||||
{
|
||||
const char *arname;
|
||||
const char *pattern;
|
||||
#ifdef VMS
|
||||
char *suffix;
|
||||
#endif
|
||||
unsigned int size;
|
||||
struct nameseq *chain;
|
||||
unsigned int n;
|
||||
@@ -196,7 +206,13 @@ ar_glob_match (int desc UNUSED, const char *mem, int truncated UNUSED,
|
||||
{
|
||||
/* We have a match. Add it to the chain. */
|
||||
struct nameseq *new = xcalloc (state->size);
|
||||
new->name = strcache_add (concat (4, state->arname, "(", mem, ")"));
|
||||
#ifdef VMS
|
||||
if (state->suffix)
|
||||
new->name = strcache_add(
|
||||
concat(5, state->arname, "(", mem, state->suffix, ")"));
|
||||
else
|
||||
#endif
|
||||
new->name = strcache_add(concat(4, state->arname, "(", mem, ")"));
|
||||
new->next = state->chain;
|
||||
state->chain = new;
|
||||
++state->n;
|
||||
@@ -248,7 +264,9 @@ ar_glob (const char *arname, const char *member_pattern, unsigned int size)
|
||||
struct nameseq *n;
|
||||
const char **names;
|
||||
unsigned int i;
|
||||
|
||||
#ifdef VMS
|
||||
char *vms_member_pattern;
|
||||
#endif
|
||||
if (! glob_pattern_p (member_pattern, 1))
|
||||
return 0;
|
||||
|
||||
@@ -256,11 +274,36 @@ ar_glob (const char *arname, const char *member_pattern, unsigned int size)
|
||||
ar_glob_match will accumulate them in STATE.chain. */
|
||||
state.arname = arname;
|
||||
state.pattern = member_pattern;
|
||||
#ifdef VMS
|
||||
{
|
||||
/* In a copy of the pattern, find the suffix, save it and remove it from
|
||||
the pattern */
|
||||
char *lastdot;
|
||||
vms_member_pattern = xstrdup(member_pattern);
|
||||
lastdot = strrchr(vms_member_pattern, '.');
|
||||
state.suffix = lastdot;
|
||||
if (lastdot)
|
||||
{
|
||||
state.suffix = xstrdup(lastdot);
|
||||
*lastdot = 0;
|
||||
}
|
||||
state.pattern = vms_member_pattern;
|
||||
}
|
||||
#endif
|
||||
state.size = size;
|
||||
state.chain = 0;
|
||||
state.n = 0;
|
||||
ar_scan (arname, ar_glob_match, &state);
|
||||
|
||||
#ifdef VMS
|
||||
/* Deallocate any duplicated string */
|
||||
free(vms_member_pattern);
|
||||
if (state.suffix)
|
||||
{
|
||||
free(state.suffix);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (state.chain == 0)
|
||||
return 0;
|
||||
|
||||
|
||||
287
arscan.c
287
arscan.c
@@ -1,5 +1,5 @@
|
||||
/* Library function for scanning an archive file.
|
||||
Copyright (C) 1987-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987-2014 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
|
||||
@@ -16,6 +16,11 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
|
||||
#ifdef TEST
|
||||
/* Hack, the real error() routine eventually pulls in die from main.c */
|
||||
#define error(a, b, c, d)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#else
|
||||
@@ -30,99 +35,139 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#include <credef.h>
|
||||
#include <descrip.h>
|
||||
#include <ctype.h>
|
||||
#include <ssdef.h>
|
||||
#include <stsdef.h>
|
||||
#include <rmsdef.h>
|
||||
globalvalue unsigned int LBR$_HDRTRUNC;
|
||||
|
||||
#if __DECC
|
||||
#include <unixlib.h>
|
||||
#include <lbr$routines.h>
|
||||
#endif
|
||||
const char *
|
||||
vmsify (const char *name, int type);
|
||||
|
||||
/* Time conversion from VMS to Unix
|
||||
Conversion from local time (stored in library) to GMT (needed for gmake)
|
||||
Note: The tm_gmtoff element is a VMS extension to the ANSI standard. */
|
||||
static time_t
|
||||
vms_time_to_unix(void *vms_time)
|
||||
{
|
||||
struct tm *tmp;
|
||||
time_t unix_time;
|
||||
|
||||
unix_time = decc$fix_time(vms_time);
|
||||
tmp = localtime(&unix_time);
|
||||
unix_time -= tmp->tm_gmtoff;
|
||||
|
||||
return unix_time;
|
||||
}
|
||||
|
||||
|
||||
/* VMS library routines need static variables for callback */
|
||||
static void *VMS_lib_idx;
|
||||
|
||||
static char *VMS_saved_memname;
|
||||
|
||||
static time_t VMS_member_date;
|
||||
static const void *VMS_saved_arg;
|
||||
|
||||
static long int (*VMS_function) ();
|
||||
|
||||
static long int VMS_function_ret;
|
||||
|
||||
|
||||
/* This is a callback procedure for lib$get_index */
|
||||
static int
|
||||
VMS_get_member_info (struct dsc$descriptor_s *module, unsigned long *rfa)
|
||||
VMS_get_member_info(struct dsc$descriptor_s *module, unsigned long *rfa)
|
||||
{
|
||||
int status, i;
|
||||
long int fnval;
|
||||
const int truncated = 0; /* Member name may be truncated */
|
||||
time_t member_date; /* Member date */
|
||||
char *filename;
|
||||
unsigned int buffer_length; /* Actual buffer length */
|
||||
|
||||
time_t val;
|
||||
/* Unused constants - Make does not actually use most of these */
|
||||
const int file_desc = -1; /* archive file descriptor for reading the data */
|
||||
const int header_position = 0; /* Header position */
|
||||
const int data_position = 0; /* Data position in file */
|
||||
const int data_size = 0; /* Data size */
|
||||
const int uid = 0; /* member gid */
|
||||
const int gid = 0; /* member gid */
|
||||
const int mode = 0; /* member protection mode */
|
||||
/* End of unused constants */
|
||||
|
||||
static struct dsc$descriptor_s bufdesc =
|
||||
{ 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, NULL };
|
||||
|
||||
/* Only need the module definition */
|
||||
struct mhddef *mhd;
|
||||
char filename[128];
|
||||
|
||||
bufdesc.dsc$a_pointer = filename;
|
||||
bufdesc.dsc$w_length = sizeof (filename);
|
||||
|
||||
status = lbr$set_module (&VMS_lib_idx, rfa, &bufdesc,
|
||||
&bufdesc.dsc$w_length, 0);
|
||||
if (! (status & 1))
|
||||
/* If a previous callback is non-zero, just return that status */
|
||||
if (VMS_function_ret)
|
||||
{
|
||||
error (NILF, _("lbr$set_module() failed to extract module info, status = %d"),
|
||||
status);
|
||||
|
||||
lbr$close (&VMS_lib_idx);
|
||||
|
||||
return 0;
|
||||
return SS$_NORMAL;
|
||||
}
|
||||
|
||||
mhd = (struct mhddef *) filename;
|
||||
/* lbr_set_module returns more than just the module header. So allocate
|
||||
a buffer which is big enough: the maximum LBR$C_MAXHDRSIZ. That's at
|
||||
least bigger than the size of struct mhddef.
|
||||
If the request is too small, a buffer truncated warning is issued so
|
||||
it can be reissued with a larger buffer.
|
||||
We do not care if the buffer is truncated, so that is still a success. */
|
||||
mhd = xmalloc(LBR$C_MAXHDRSIZ);
|
||||
bufdesc.dsc$a_pointer = (char *) mhd;
|
||||
bufdesc.dsc$w_length = LBR$C_MAXHDRSIZ;
|
||||
|
||||
#ifdef __DECC
|
||||
/* John Fowler <jfowler@nyx.net> writes this is needed in his environment,
|
||||
* but that decc$fix_time() isn't documented to work this way. Let me
|
||||
* know if this causes problems in other VMS environments.
|
||||
*/
|
||||
{
|
||||
/* Modified by M. Gehre at 11-JAN-2008 because old formula is wrong:
|
||||
* val = decc$fix_time (&mhd->mhd$l_datim) + timezone - daylight*3600;
|
||||
* a) daylight specifies, if the timezone has daylight saving enabled, not
|
||||
* if it is active
|
||||
* b) what we need is the information, if daylight saving was active, if
|
||||
* the library module was replaced. This information we get using the
|
||||
* localtime function
|
||||
*/
|
||||
status = lbr$set_module(&VMS_lib_idx, rfa, &bufdesc, &buffer_length, 0);
|
||||
|
||||
struct tm *tmp;
|
||||
if ((status != LBR$_HDRTRUNC) && !$VMS_STATUS_SUCCESS(status))
|
||||
{
|
||||
ON(error, NILF,
|
||||
_("lbr$set_module() failed to extract module info, status = %d"),
|
||||
status);
|
||||
|
||||
/* Conversion from VMS time to C time */
|
||||
val = decc$fix_time (&mhd->mhd$l_datim);
|
||||
lbr$close(&VMS_lib_idx);
|
||||
|
||||
/*
|
||||
* Conversion from local time (stored in library) to GMT (needed for gmake)
|
||||
* Note: The tm_gmtoff element is a VMS extension to the ANSI standard.
|
||||
*/
|
||||
tmp = localtime (&val);
|
||||
val -= tmp->tm_gmtoff;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
#ifdef TEST
|
||||
/* When testing this code, it is useful to know the length returned */
|
||||
printf("Input length = %d, actual = %d\n",
|
||||
bufdesc.dsc$w_length, buffer_length);
|
||||
#endif
|
||||
|
||||
/* Conversion from VMS time to C time.
|
||||
VMS defectlet - mhddef is sub-optimal, for the time, it has a 32 bit
|
||||
longword, mhd$l_datim, and a 32 bit fill instead of two longwords, or
|
||||
equivalent. */
|
||||
member_date = vms_time_to_unix(&mhd->mhd$l_datim);
|
||||
free(mhd);
|
||||
|
||||
/* Here we have a problem. The module name on VMS does not have
|
||||
a file type, but the filename pattern in the "VMS_saved_arg"
|
||||
may have one.
|
||||
But only the method being called knows how to interpret the
|
||||
filename pattern.
|
||||
There are currently two different formats being used.
|
||||
This means that we need a VMS specific code in those methods
|
||||
to handle it. */
|
||||
filename = xmalloc(module->dsc$w_length + 1);
|
||||
|
||||
/* TODO: We may need an option to preserve the case of the module
|
||||
For now force the module name to lower case */
|
||||
for (i = 0; i < module->dsc$w_length; i++)
|
||||
filename[i] = _tolower ((unsigned char)module->dsc$a_pointer[i]);
|
||||
filename[i] = _tolower((unsigned char )module->dsc$a_pointer[i]);
|
||||
|
||||
filename[i] = '\0';
|
||||
|
||||
VMS_member_date = (time_t) -1;
|
||||
VMS_function_ret = (*VMS_function)(file_desc, filename, truncated,
|
||||
header_position, data_position, data_size, member_date, uid, gid, mode,
|
||||
VMS_saved_arg);
|
||||
|
||||
fnval =
|
||||
(*VMS_function) (-1, filename, 0, 0, 0, 0, val, 0, 0, 0,
|
||||
VMS_saved_memname);
|
||||
|
||||
if (fnval)
|
||||
{
|
||||
VMS_member_date = fnval;
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return 1;
|
||||
free(filename);
|
||||
return SS$_NORMAL;
|
||||
}
|
||||
|
||||
|
||||
/* Takes three arguments ARCHIVE, FUNCTION and ARG.
|
||||
|
||||
Open the archive named ARCHIVE, find its members one by one,
|
||||
@@ -153,60 +198,89 @@ VMS_get_member_info (struct dsc$descriptor_s *module, unsigned long *rfa)
|
||||
Returns 0 if have scanned successfully. */
|
||||
|
||||
long int
|
||||
ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
ar_scan (const char *archive, ar_member_func_t function, const void *varg)
|
||||
{
|
||||
char *p;
|
||||
char *vms_archive;
|
||||
|
||||
static struct dsc$descriptor_s libdesc =
|
||||
{ 0, DSC$K_DTYPE_T, DSC$K_CLASS_S, NULL };
|
||||
|
||||
unsigned long func = LBR$C_READ;
|
||||
unsigned long type = LBR$C_TYP_UNK;
|
||||
unsigned long index = 1;
|
||||
|
||||
const unsigned long func = LBR$C_READ;
|
||||
const unsigned long type = LBR$C_TYP_UNK;
|
||||
const unsigned long index = 1;
|
||||
unsigned long lib_idx;
|
||||
int status;
|
||||
|
||||
status = lbr$ini_control (&VMS_lib_idx, &func, &type, 0);
|
||||
VMS_saved_arg = varg;
|
||||
|
||||
if (! (status & 1))
|
||||
/* Null archive string can show up in test and cause an access violation */
|
||||
if (archive == NULL)
|
||||
{
|
||||
error (NILF, _("lbr$ini_control() failed with status = %d"), status);
|
||||
return -2;
|
||||
}
|
||||
|
||||
/* there is no such descriptor with "const char *dsc$a_pointer" */
|
||||
libdesc.dsc$a_pointer = (char *)archive;
|
||||
libdesc.dsc$w_length = strlen (archive);
|
||||
|
||||
status = lbr$open (&VMS_lib_idx, &libdesc, 0, 0, 0, 0, 0);
|
||||
|
||||
if (! (status & 1))
|
||||
{
|
||||
error (NILF, _("unable to open library '%s' to lookup member '%s'"),
|
||||
archive, (char *)arg);
|
||||
/* Null filenames do not exist */
|
||||
return -1;
|
||||
}
|
||||
|
||||
VMS_saved_memname = (char *)arg;
|
||||
/* archive path name must be in VMS format */
|
||||
vms_archive = (char *) vmsify(archive, 0);
|
||||
|
||||
/* For comparison, delete .obj from arg name. */
|
||||
status = lbr$ini_control(&VMS_lib_idx, &func, &type, 0);
|
||||
|
||||
p = strrchr (VMS_saved_memname, '.');
|
||||
if (p)
|
||||
*p = '\0';
|
||||
if (!$VMS_STATUS_SUCCESS(status))
|
||||
{
|
||||
ON(error, NILF, _("lbr$ini_control() failed with status = %d"), status);
|
||||
return -2;
|
||||
}
|
||||
|
||||
libdesc.dsc$a_pointer = vms_archive;
|
||||
libdesc.dsc$w_length = strlen(vms_archive);
|
||||
|
||||
status = lbr$open(&VMS_lib_idx, &libdesc, 0, NULL, 0, NULL, 0);
|
||||
|
||||
if (!$VMS_STATUS_SUCCESS(status))
|
||||
{
|
||||
|
||||
/* TODO: A library format failure could mean that this is a file
|
||||
generated by the GNU AR utility and in that case, we need to
|
||||
take the UNIX codepath. This will also take a change to the
|
||||
GNV AR wrapper program. */
|
||||
|
||||
switch (status)
|
||||
{
|
||||
case RMS$_FNF:
|
||||
/* Archive does not exist */
|
||||
return -1;
|
||||
default:
|
||||
#ifndef TEST
|
||||
OSN(error, NILF,
|
||||
_("unable to open library '%s' to lookup member status %d"),
|
||||
archive, status);
|
||||
#endif
|
||||
/* For library format errors, specification says to return -2 */
|
||||
return -2;
|
||||
}
|
||||
}
|
||||
|
||||
VMS_function = function;
|
||||
|
||||
VMS_member_date = (time_t) -1;
|
||||
lbr$get_index (&VMS_lib_idx, &index, VMS_get_member_info, 0);
|
||||
/* Clear the return status, as we are supposed to stop calling the
|
||||
callback function if it becomes non-zero, and this is a static
|
||||
variable. */
|
||||
VMS_function_ret = 0;
|
||||
|
||||
/* Undo the damage. */
|
||||
if (p)
|
||||
*p = '.';
|
||||
status = lbr$get_index(&VMS_lib_idx, &index, VMS_get_member_info, NULL, 0);
|
||||
|
||||
lbr$close (&VMS_lib_idx);
|
||||
lbr$close(&VMS_lib_idx);
|
||||
|
||||
return VMS_member_date > 0 ? VMS_member_date : 0;
|
||||
/* Unless a failure occurred in the lbr$ routines, return the
|
||||
the status from the 'function' routine. */
|
||||
if ($VMS_STATUS_SUCCESS(status))
|
||||
{
|
||||
return VMS_function_ret;
|
||||
}
|
||||
|
||||
/* This must be something wrong with the library and an error
|
||||
message should already have been printed. */
|
||||
return -2;
|
||||
}
|
||||
|
||||
#else /* !VMS */
|
||||
@@ -251,10 +325,10 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
#endif
|
||||
|
||||
#ifndef WINDOWS32
|
||||
# ifndef __BEOS__
|
||||
# if !defined (__ANDROID__) && !defined (__BEOS__)
|
||||
# include <ar.h>
|
||||
# else
|
||||
/* BeOS 5 doesn't have <ar.h> but has archives in the same format
|
||||
/* These platforms don't have <ar.h> but have archives in the same format
|
||||
* as many other Unices. This was taken from GNU binutils for BeOS.
|
||||
*/
|
||||
# define ARMAG "!<arch>\n" /* String that begins an archive file. */
|
||||
@@ -751,9 +825,32 @@ ar_name_equal (const char *name, const char *mem, int truncated)
|
||||
#endif /* !__hpux && !cray */
|
||||
#endif /* !AIAMAG */
|
||||
}
|
||||
#endif /* !VMS */
|
||||
|
||||
return !strcmp (name, mem);
|
||||
#else
|
||||
/* VMS members do not have suffixes, but the filenames usually
|
||||
have.
|
||||
Do we need to strip VMS disk/directory format paths?
|
||||
|
||||
Most VMS compilers etc. by default are case insensitive
|
||||
but produce uppercase external names, incl. module names.
|
||||
However the VMS librarian (ar) and the linker by default
|
||||
are case sensitive: they take what they get, usually
|
||||
uppercase names. So for the non-default settings of the
|
||||
compilers etc. there is a need to have a case sensitive
|
||||
mode. */
|
||||
{
|
||||
int len;
|
||||
len = strlen(mem);
|
||||
int match;
|
||||
char *dot;
|
||||
if ((dot=strrchr(name,'.')))
|
||||
match = (len == dot - name) && !strncasecmp(name, mem, len);
|
||||
else
|
||||
match = !strcasecmp (name, mem);
|
||||
return match;
|
||||
}
|
||||
#endif /* !VMS */
|
||||
}
|
||||
|
||||
#ifndef VMS
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# Shell script to build GNU Make in the absence of any 'make' program.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1993-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1993-2014 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
|
||||
@@ -22,11 +22,11 @@
|
||||
|
||||
srcdir='@srcdir@'
|
||||
CC='@CC@'
|
||||
CFLAGS='@CFLAGS@'
|
||||
CFLAGS='@CFLAGS@ @GUILE_CFLAGS@'
|
||||
CPPFLAGS='@CPPFLAGS@'
|
||||
LDFLAGS='@LDFLAGS@'
|
||||
LDFLAGS='@AM_LDFLAGS@ @LDFLAGS@'
|
||||
ALLOCA='@ALLOCA@'
|
||||
LOADLIBES='@LIBS@ @LIBINTL@'
|
||||
LOADLIBES='@LIBS@ @GUILE_LIBS@ @LIBINTL@'
|
||||
eval extras=\'@LIBOBJS@\'
|
||||
REMOTE='@REMOTE@'
|
||||
GLOBLIB='@GLOBLIB@'
|
||||
@@ -46,7 +46,7 @@ includedir=${prefix}/include
|
||||
localedir=${prefix}/share/locale
|
||||
aliaspath=${localedir}${PATH_SEPARATOR}.
|
||||
|
||||
defines="-DALIASPATH=\"${aliaspath}\" -DLOCALEDIR=\"${localedir}\" -DLIBDIR=\"${libdir}\" -DINCLUDEDIR=\"${includedir}\""' @DEFS@'
|
||||
defines="-DLOCALEDIR=\"${localedir}\" -DLIBDIR=\"${libdir}\" -DINCLUDEDIR=\"${includedir}\""' @DEFS@'
|
||||
|
||||
# Exit as soon as any command fails.
|
||||
set -e
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
rem Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
rem Copyright (C) 1996-2014 Free Software Foundation, Inc.
|
||||
rem This file is part of GNU Make.
|
||||
rem
|
||||
rem GNU Make is free software; you can redistribute it and/or modify it under
|
||||
@@ -30,7 +30,6 @@ copy config.h.W32 config.h
|
||||
rem Guile configuration
|
||||
set GUILECFLAGS=
|
||||
set GUILELIBS=
|
||||
set GUILESRC=
|
||||
set NOGUILE=
|
||||
set OPT=-O2
|
||||
set COMPILER=
|
||||
@@ -79,7 +78,6 @@ GoTo GuileDone
|
||||
echo "pkg-config not found, building without Guile"
|
||||
:GuileDone
|
||||
if not "%GUILECFLAGS%" == "" echo "Guile found, building with Guile"
|
||||
if not "%GUILECFLAGS%" == "" set GUILESRC=guile.c
|
||||
if not "%GUILECFLAGS%" == "" set GUILECFLAGS=%GUILECFLAGS% -DHAVE_GUILE
|
||||
if "%COMPILER%" == "gcc" if "%OPT%" == "-O0" echo "Building without compiler optimizations"
|
||||
cd w32\subproc
|
||||
@@ -162,8 +160,7 @@ cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D
|
||||
echo WinDebug\fnmatch.obj >>link.dbg
|
||||
cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\w32\pathstuff.c
|
||||
echo WinDebug\pathstuff.obj >>link.dbg
|
||||
if "%GUILESRC%" == "" GoTo LinkDbg
|
||||
cl.exe /nologo /MT /W4 /GX /Zi /YX /Od %GUILECFLAGS%% /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c guile.c
|
||||
cl.exe /nologo /MT /W4 /GX /Zi /YX /Od %GUILECFLAGS% /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c guile.c
|
||||
echo WinDebug\guile.obj >>link.dbg
|
||||
:LinkDbg
|
||||
echo off
|
||||
@@ -241,8 +238,7 @@ cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIND
|
||||
echo WinRel\fnmatch.obj >>link.rel
|
||||
cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\w32\pathstuff.c
|
||||
echo WinRel\pathstuff.obj >>link.rel
|
||||
if "%GUILESRC%" == "" GoTo LinkRel
|
||||
cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c guile.c
|
||||
cl.exe /nologo /MT /W4 /GX /YX /O2 %GUILECFLAGS% /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c guile.c
|
||||
echo WinRel\guile.obj >>link.rel
|
||||
:LinkRel
|
||||
echo off
|
||||
@@ -288,18 +284,13 @@ gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./glob/fnmatch.c -o fnmatch.o
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./w32/pathstuff.c -o pathstuff.o
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./w32/compat/posixfcn.c -o posixfcn.o
|
||||
@echo off
|
||||
set GUILEOBJ=
|
||||
if "%GUILESRC%" == "" GoTo LinkGCC
|
||||
set GUILEOBJ=guile.o
|
||||
echo on
|
||||
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% %GUILECFLAGS% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c guile.c
|
||||
:LinkGCC
|
||||
@echo off
|
||||
Rem The version NN of libgnumake-NN.dll.a should be bumped whenever
|
||||
Rem the API changes in binary-incompatible manner.
|
||||
@echo on
|
||||
gcc -mthreads -gdwarf-2 -g3 -o gnumake.exe variable.o rule.o remote-stub.o commands.o file.o getloadavg.o default.o signame.o expand.o dir.o main.o getopt1.o %GUILEOBJ% job.o output.o read.o version.o getopt.o arscan.o remake.o misc.o hash.o strcache.o ar.o function.o vpath.o implicit.o loadapi.o load.o glob.o fnmatch.o pathstuff.o posixfcn.o w32_misc.o sub_proc.o w32err.o %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -Wl,--out-implib=libgnumake-1.dll.a
|
||||
gcc -mthreads -gdwarf-2 -g3 -o gnumake.exe variable.o rule.o remote-stub.o commands.o file.o getloadavg.o default.o signame.o expand.o dir.o main.o getopt1.o guile.o job.o output.o read.o version.o getopt.o arscan.o remake.o misc.o hash.o strcache.o ar.o function.o vpath.o implicit.o loadapi.o load.o glob.o fnmatch.o pathstuff.o posixfcn.o w32_misc.o sub_proc.o w32err.o %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -Wl,--out-implib=libgnumake-1.dll.a
|
||||
@GoTo BuildEnd
|
||||
:Usage
|
||||
echo Usage: %0 [options] [gcc]
|
||||
@@ -310,8 +301,6 @@ echo. --without-guile Do not compile Guile support even if found
|
||||
echo. --help Display these instructions and exit
|
||||
:BuildEnd
|
||||
@echo off
|
||||
set GUILEOBJ=
|
||||
set GUILESRC=
|
||||
set GUILELIBS=
|
||||
set GUILECFLAGS=
|
||||
set PKGMSC=
|
||||
|
||||
23
commands.c
23
commands.c
@@ -1,5 +1,5 @@
|
||||
/* Command processing for GNU Make.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2014 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
|
||||
@@ -14,8 +14,6 @@ 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 <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include "makeint.h"
|
||||
#include "filedef.h"
|
||||
#include "dep.h"
|
||||
@@ -403,7 +401,7 @@ chop_commands (struct commands *cmds)
|
||||
CMDS->any_recurse flag. */
|
||||
|
||||
if (nlines > USHRT_MAX)
|
||||
fatal (&cmds->fileinfo, _("Recipe has too many lines (%ud)"), nlines);
|
||||
ON (fatal, &cmds->fileinfo, _("Recipe has too many lines (%ud)"), nlines);
|
||||
|
||||
cmds->ncommand_lines = nlines;
|
||||
cmds->command_lines = lines;
|
||||
@@ -587,7 +585,7 @@ fatal_error_signal (int sig)
|
||||
if (sig == SIGQUIT)
|
||||
/* We don't want to send ourselves SIGQUIT, because it will
|
||||
cause a core dump. Just exit instead. */
|
||||
exit (EXIT_FAILURE);
|
||||
exit (MAKE_TROUBLE);
|
||||
#endif
|
||||
|
||||
#ifdef WINDOWS32
|
||||
@@ -627,11 +625,13 @@ delete_target (struct file *file, const char *on_behalf_of)
|
||||
if (ar_member_date (file->name) != file_date)
|
||||
{
|
||||
if (on_behalf_of)
|
||||
error (NILF, _("*** [%s] Archive member '%s' may be bogus; not deleted"),
|
||||
on_behalf_of, file->name);
|
||||
OSS (error, NILF,
|
||||
_("*** [%s] Archive member '%s' may be bogus; not deleted"),
|
||||
on_behalf_of, file->name);
|
||||
else
|
||||
error (NILF, _("*** Archive member '%s' may be bogus; not deleted"),
|
||||
file->name);
|
||||
OS (error, NILF,
|
||||
_("*** Archive member '%s' may be bogus; not deleted"),
|
||||
file->name);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -643,9 +643,10 @@ delete_target (struct file *file, const char *on_behalf_of)
|
||||
&& FILE_TIMESTAMP_STAT_MODTIME (file->name, st) != file->last_mtime)
|
||||
{
|
||||
if (on_behalf_of)
|
||||
error (NILF, _("*** [%s] Deleting file '%s'"), on_behalf_of, file->name);
|
||||
OSS (error, NILF,
|
||||
_("*** [%s] Deleting file '%s'"), on_behalf_of, file->name);
|
||||
else
|
||||
error (NILF, _("*** Deleting file '%s'"), file->name);
|
||||
OS (error, NILF, _("*** Deleting file '%s'"), file->name);
|
||||
if (unlink (file->name) < 0
|
||||
&& errno != ENOENT) /* It disappeared; so what. */
|
||||
perror_with_name ("unlink: ", file->name);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Definition of data structures describing shell commands for GNU Make.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2014 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* config.h -- hand-massaged for Amiga -*-C-*-
|
||||
Copyright (C) 1995-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2014 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
|
||||
@@ -318,6 +318,12 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define if you have the kstat library (-lkstat). */
|
||||
/* #undef HAVE_LIBKSTAT */
|
||||
|
||||
/* Define to 1 if you have the `isatty' function. */
|
||||
/* #undef HAVE_ISATTY */
|
||||
|
||||
/* Define to 1 if you have the `ttyname' function. */
|
||||
/* #undef HAVE_TTYNAME */
|
||||
|
||||
/* Define if you have the sun library (-lsun). */
|
||||
/* #undef HAVE_LIBSUN */
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* config.h-vms. Generated by hand by Klaus Kämpf <kkaempf@rmi.de> -*-C-*-
|
||||
|
||||
Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-2014 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
|
||||
@@ -18,6 +18,12 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* config.h. Generated automatically by configure. */
|
||||
/* config.h.in. Generated automatically from configure.ac by autoheader. */
|
||||
|
||||
/* Pull in types.h here to get __CRTL_VER defined for old versions of the
|
||||
compiler which don't define it. */
|
||||
#ifdef __DECC
|
||||
# include <types.h>
|
||||
#endif
|
||||
|
||||
/* Define to 1 if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
@@ -356,6 +362,12 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define to 1 if you have the sun library (-lsun). */
|
||||
/* #undef HAVE_LIBSUN */
|
||||
|
||||
/* Define to 1 if you have the `isatty' function. */
|
||||
/* #undef HAVE_ISATTY */
|
||||
|
||||
/* Define to 1 if you have the `ttyname' function. */
|
||||
/* #undef HAVE_TTYNAME */
|
||||
|
||||
/* Use high resolution file timestamps if nonzero. */
|
||||
#define FILE_TIMESTAMP_HI_RES 0
|
||||
|
||||
@@ -372,15 +384,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* #undef HAVE_VMSDIR_H */
|
||||
/* #undef _DIRENT_HAVE_D_NAMLEN */
|
||||
|
||||
/* On older systems without 7.0 backport of CRTL the first one is defined */
|
||||
#ifdef __CRTL_VER
|
||||
# if __CRTL_VER < 70000000
|
||||
# define HAVE_VMSDIR_H 1
|
||||
# endif
|
||||
#else
|
||||
# if __VMS_VER < 70000000
|
||||
# define HAVE_VMSDIR_H 1
|
||||
# endif
|
||||
/* On older systems without 7.0 backport of CRTL use non-VMS code for opendir() etc. */
|
||||
#if __CRTL_VER < 70000000
|
||||
# define HAVE_VMSDIR_H 1
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_VMSDIR_H) && defined(HAVE_DIRENT_H)
|
||||
@@ -414,5 +420,13 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Output sync sypport */
|
||||
#define NO_OUTPUT_SYNC
|
||||
|
||||
/* Define to 1 to write even short single-line actions into a VMS/DCL command
|
||||
file; this also enables exporting make environment variables into the
|
||||
(sub-)process, which executes the action.
|
||||
The usual make rules apply whether a shell variable - here a DCL symbol or
|
||||
VMS logical [see CRTL getenv()] - is added to the make environment and
|
||||
is exported. */
|
||||
#define USE_DCL_COM_FILE 1
|
||||
|
||||
/* Build host information. */
|
||||
#define MAKE_HOST "VMS"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* config.h.W32 -- hand-massaged config.h file for Windows builds -*-C-*-
|
||||
|
||||
Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-2014 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
|
||||
@@ -292,6 +292,13 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define to 1 if you have the 'strsignal' function. */
|
||||
/* #undef HAVE_STRSIGNAL */
|
||||
|
||||
/* Define to 1 if you have the `isatty' function. */
|
||||
#define HAVE_ISATTY 1
|
||||
|
||||
/* Define to 1 if you have the `ttyname' function. */
|
||||
#define HAVE_TTYNAME 1
|
||||
char *ttyname (int);
|
||||
|
||||
/* Define to 1 if 'n_un.n_name' is a member of 'struct nlist'. */
|
||||
/* #undef HAVE_STRUCT_NLIST_N_UN_N_NAME */
|
||||
|
||||
|
||||
1
config/.gitignore
vendored
1
config/.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
ar-lib
|
||||
compile
|
||||
config.guess
|
||||
config.rpath
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
* Makefile.am: New file.
|
||||
|
||||
|
||||
Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2014 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
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*-Makefile-*-, or close enough
|
||||
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2014 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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Test if the system uses DOS-style pathnames (drive specs and backslashes)
|
||||
# By Paul Smith <psmith@gnu.org>. Based on dos.m4 by Jim Meyering.
|
||||
#
|
||||
# Copyright (C) 1993-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1993-2014 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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* configh.dos -- hand-massaged config.h file for MS-DOS builds -*-C-*-
|
||||
|
||||
Copyright (C) 1994-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1994-2014 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
|
||||
|
||||
34
configure.ac
34
configure.ac
@@ -1,6 +1,6 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
#
|
||||
# Copyright (C) 1993-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1993-2014 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
|
||||
@@ -16,7 +16,7 @@
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
AC_INIT([GNU make],[3.99.92],[bug-make@gnu.org])
|
||||
AC_INIT([GNU make],[4.1],[bug-make@gnu.org])
|
||||
|
||||
AC_PREREQ([2.62])
|
||||
|
||||
@@ -26,9 +26,13 @@ AC_CONFIG_SRCDIR([vpath.c])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
|
||||
# Automake setup
|
||||
AM_INIT_AUTOMAKE([1.11.1 silent-rules])
|
||||
# We have to enable "foreign" because ChangeLog is auto-generated
|
||||
# We cannot enable -Werror because gettext 0.18.1 has invalid content
|
||||
# When we update gettext to 0.18.3 or better we can add it again.
|
||||
AM_INIT_AUTOMAKE([1.11.1 silent-rules foreign -Wall])
|
||||
|
||||
# Checks for programs.
|
||||
AC_USE_SYSTEM_EXTENSIONS
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_RANLIB
|
||||
@@ -37,6 +41,9 @@ AC_CHECK_PROG([AR], [ar], [ar], [ar])
|
||||
# Perl is needed for the test suite (only)
|
||||
AC_CHECK_PROG([PERL], [perl], [perl], [perl])
|
||||
|
||||
# Needed for w32/Makefile.am
|
||||
AM_PROG_AR
|
||||
|
||||
# Specialized system macros
|
||||
AC_CANONICAL_HOST
|
||||
AC_AIX
|
||||
@@ -44,7 +51,6 @@ AC_ISC_POSIX
|
||||
AC_MINIX
|
||||
|
||||
# Enable gettext, in "external" mode.
|
||||
|
||||
AM_GNU_GETTEXT_VERSION([0.18.1])
|
||||
AM_GNU_GETTEXT([external])
|
||||
|
||||
@@ -134,7 +140,7 @@ AC_CHECK_FUNCS([strdup strndup mkstemp mktemp fdopen fileno \
|
||||
dup dup2 getcwd realpath sigsetmask sigaction \
|
||||
getgroups seteuid setegid setlinebuf setreuid setregid \
|
||||
getrlimit setrlimit setvbuf pipe strerror strsignal \
|
||||
lstat readlink atexit])
|
||||
lstat readlink atexit isatty ttyname])
|
||||
|
||||
# We need to check declarations, not just existence, because on Tru64 this
|
||||
# function is not declared without special flags, which themselves cause
|
||||
@@ -243,8 +249,8 @@ AS_IF([test "$PATH_SEPARATOR" = ';'],
|
||||
AC_SUBST([REMOTE]) REMOTE=stub
|
||||
use_customs=false
|
||||
AC_ARG_WITH([customs],
|
||||
[ AC_HELP_STRING([--with-customs=DIR],
|
||||
[enable remote jobs via Customs--see README.customs])],
|
||||
[AC_HELP_STRING([--with-customs=DIR],
|
||||
[enable remote jobs via Customs--see README.customs])],
|
||||
[ AS_CASE([$withval], [n|no], [:],
|
||||
[make_cppflags="$CPPFLAGS"
|
||||
AS_CASE([$withval],
|
||||
@@ -317,20 +323,20 @@ AC_ARG_ENABLE([load],
|
||||
[make_cv_load="$enableval" user_load="$enableval"],
|
||||
[make_cv_load="yes"])
|
||||
|
||||
AS_CASE([/$ac_cv_func_dlopen/$ac_cv_func_dlsym/$ac_cv_func_dlerror/],
|
||||
AS_CASE([/$ac_cv_have_decl_dlopen/$ac_cv_have_decl_dlsym/$ac_cv_have_decl_dlerror/],
|
||||
[*/no/*], [make_cv_load=no])
|
||||
|
||||
# We might need -ldl
|
||||
AS_IF([test "$make_cv_load" = yes], [
|
||||
AC_SEARCH_LIBS([dlopen], [dl], [], [make_cv_load=])
|
||||
])
|
||||
|
||||
AS_CASE([/$make_cv_load/$user_load/],
|
||||
[*/no/*], [make_cv_load=no],
|
||||
[AC_DEFINE(MAKE_LOAD, 1,
|
||||
[Define to 1 to enable 'load' support in GNU make.])
|
||||
])
|
||||
|
||||
# We might need -ldl
|
||||
AS_IF([test "$make_cv_load" = yes], [
|
||||
AC_SEARCH_LIBS([dlopen], [dl], [], [make_cv_load=])
|
||||
])
|
||||
|
||||
# If we want load support, we might need to link with export-dynamic.
|
||||
# See if we can figure it out. Unfortunately this is very difficult.
|
||||
# For example passing -rdynamic to the SunPRO linker gives a warning
|
||||
@@ -498,7 +504,7 @@ AS_IF([test "x$make_cv_load" = xno && test "x$user_load" = xyes],
|
||||
|
||||
# Specify what files are to be created.
|
||||
AC_CONFIG_FILES([Makefile glob/Makefile po/Makefile.in config/Makefile \
|
||||
doc/Makefile w32/Makefile])
|
||||
doc/Makefile w32/Makefile tests/config-flags.pm])
|
||||
|
||||
# OK, do it!
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
rem Copyright (C) 1994-2013 Free Software Foundation, Inc.
|
||||
rem Copyright (C) 1994-2014 Free Software Foundation, Inc.
|
||||
rem This file is part of GNU Make.
|
||||
rem
|
||||
rem GNU Make is free software; you can redistribute it and/or modify it under
|
||||
|
||||
2
debug.h
2
debug.h
@@ -1,5 +1,5 @@
|
||||
/* Debugging macros and interface.
|
||||
Copyright (C) 1999-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999-2014 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
|
||||
|
||||
78
default.c
78
default.c
@@ -1,5 +1,5 @@
|
||||
/* Data base of default implicit rules for GNU Make.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2014 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
|
||||
@@ -38,9 +38,11 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
static char default_suffixes[]
|
||||
#ifdef VMS
|
||||
= ".exe .olb .ln .obj .c .cxx .cc .pas .p .for .f .r .y .l .mar \
|
||||
.s .ss .i .ii .mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
|
||||
.w .ch .cweb .web .com .sh .elc .el";
|
||||
/* VMS should include all UNIX/POSIX + some VMS extensions */
|
||||
= ".out .exe .a .olb .hlb .tlb .mlb .ln .o .obj .c .cxx .cc .cpp .pas .p \
|
||||
.for .f .r .y .l .ym .yl .mar .s .ss .i .ii .mod .sym .def .h .info .dvi \
|
||||
.tex .texinfo .texi .txinfo .mem .hlp .brn .rnh .rno .rnt .rnx .w .ch .cweb \
|
||||
.web .com .sh .elc .el";
|
||||
#elif defined(__EMX__)
|
||||
= ".out .a .ln .o .c .cc .C .cpp .p .f .F .m .r .y .l .ym .yl .s .S \
|
||||
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
|
||||
@@ -53,19 +55,35 @@ static char default_suffixes[]
|
||||
|
||||
static struct pspec default_pattern_rules[] =
|
||||
{
|
||||
#ifdef VMS
|
||||
{ "(%)", "%",
|
||||
"@if f$$search(\"$@\") .eqs. \"\" then $(LIBRARY)/CREATE/"
|
||||
"$(or "
|
||||
"$(patsubst %,TEXT,$(filter %.tlb %.TLB,$@)),"
|
||||
"$(patsubst %,HELP,$(filter %.hlb %.HLB,$@)),"
|
||||
"$(patsubst %,MACRO,$(filter %.mlb %.MLB,$@)),"
|
||||
"$(and "
|
||||
"$(patsubst %,SHARE,$(filter %.olb %.OLB,$@)),"
|
||||
"$(patsubst %,SHARE,$(filter %.exe %.EXE,$<))),"
|
||||
"OBJECT)"
|
||||
" $@\n"
|
||||
"$(AR) $(ARFLAGS) $@ $<" },
|
||||
|
||||
#else
|
||||
{ "(%)", "%",
|
||||
"$(AR) $(ARFLAGS) $@ $<" },
|
||||
#endif
|
||||
/* The X.out rules are only in BSD's default set because
|
||||
BSD Make has no null-suffix rules, so 'foo.out' and
|
||||
'foo' are the same thing. */
|
||||
#ifdef VMS
|
||||
{ "%.exe", "%",
|
||||
"copy $< $@" },
|
||||
#else
|
||||
"$(CP) $< $@" },
|
||||
|
||||
#endif
|
||||
{ "%.out", "%",
|
||||
"@rm -f $@ \n cp $< $@" },
|
||||
#endif
|
||||
|
||||
/* Syntax is "ctangle foo.w foo.ch foo.c". */
|
||||
{ "%.c", "%.w %.ch",
|
||||
"$(CTANGLE) $^ $@" },
|
||||
@@ -78,18 +96,20 @@ static struct pspec default_pattern_rules[] =
|
||||
static struct pspec default_terminal_rules[] =
|
||||
{
|
||||
#ifdef VMS
|
||||
|
||||
/* RCS. */
|
||||
{ "%", "%$$5lv", /* Multinet style */
|
||||
"if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
|
||||
"if f$$search(\"$@\") .nes. \"\" then +$(CHECKOUT,v)" },
|
||||
{ "%", "[.$$rcs]%$$5lv", /* Multinet style */
|
||||
"if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
|
||||
"if f$$search(\"$@\") .nes. \"\" then +$(CHECKOUT,v)" },
|
||||
{ "%", "%_v", /* Normal style */
|
||||
"if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
|
||||
"if f$$search(\"$@\") .nes. \"\" then +$(CHECKOUT,v)" },
|
||||
{ "%", "[.rcs]%_v", /* Normal style */
|
||||
"if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
|
||||
"if f$$search(\"$@\") .nes. \"\" then +$(CHECKOUT,v)" },
|
||||
|
||||
/* SCCS. */
|
||||
/* ain't no SCCS on vms */
|
||||
|
||||
#else
|
||||
/* RCS. */
|
||||
{ "%", "%,v",
|
||||
@@ -108,7 +128,7 @@ static struct pspec default_terminal_rules[] =
|
||||
{ 0, 0, 0 }
|
||||
};
|
||||
|
||||
static char *default_suffix_rules[] =
|
||||
static const char *default_suffix_rules[] =
|
||||
{
|
||||
#ifdef VMS
|
||||
".obj.exe",
|
||||
@@ -149,6 +169,8 @@ static char *default_suffix_rules[] =
|
||||
"$(COMPILE.c)/noprep/noobj/machine /list=$@ $<",
|
||||
".c.obj",
|
||||
"$(COMPILE.c) /obj=$@ $<",
|
||||
".c.o",
|
||||
"$(COMPILE.c) /obj=$@ $<",
|
||||
".cc.ii",
|
||||
"$(COMPILE.cc)/prep /list=$@ $<",
|
||||
".cc.ss",
|
||||
@@ -157,12 +179,20 @@ static char *default_suffix_rules[] =
|
||||
"$(COMPILE.cc)/noprep/noobj/machine /list=$@ $<",
|
||||
".cc.obj",
|
||||
"$(COMPILE.cc) /obj=$@ $<",
|
||||
".cc.o",
|
||||
"$(COMPILE.cc) /obj=$@ $<",
|
||||
".cxx.obj",
|
||||
"$(COMPILE.cxx) /obj=$@ $<",
|
||||
".cxx.o",
|
||||
"$(COMPILE.cxx) /obj=$@ $<",
|
||||
".for.obj",
|
||||
"$(COMPILE.for) /obj=$@ $<",
|
||||
".for.o",
|
||||
"$(COMPILE.for) /obj=$@ $<",
|
||||
".pas.obj",
|
||||
"$(COMPILE.pas) /obj=$@ $<",
|
||||
".pas.o",
|
||||
"$(COMPILE.pas) /obj=$@ $<",
|
||||
|
||||
".y.c",
|
||||
"$(YACC.y) $< \n rename y_tab.c $@",
|
||||
@@ -322,7 +352,8 @@ static const char *default_variables[] =
|
||||
#ifdef __VAX
|
||||
"ARCH", "VAX",
|
||||
#endif
|
||||
"AR", "library/obj",
|
||||
"AR", "library",
|
||||
"LIBRARY", "library",
|
||||
"ARFLAGS", "/replace",
|
||||
"AS", "macro",
|
||||
"MACRO", "macro",
|
||||
@@ -332,15 +363,21 @@ static const char *default_variables[] =
|
||||
"CC", "cc",
|
||||
#endif
|
||||
"CD", "builtin_cd",
|
||||
"MAKE", "make",
|
||||
"ECHO", "write sys$$output \"",
|
||||
"ECHO", "builtin_echo",
|
||||
#ifdef GCC_IS_NATIVE
|
||||
"C++", "gcc/plus",
|
||||
"CXX", "gcc/plus",
|
||||
#else
|
||||
"C++", "cxx",
|
||||
"CXX", "cxx",
|
||||
#ifndef __ia64
|
||||
"CXXLD", "cxxlink",
|
||||
"CXXLINK", "cxxlink",
|
||||
#else
|
||||
/* CXXLINK is not used on VMS/IA64 */
|
||||
"CXXLD", "link",
|
||||
"CXXLINK", "link",
|
||||
#endif
|
||||
#endif
|
||||
"CO", "co",
|
||||
"CPP", "$(CC) /preprocess_only",
|
||||
@@ -393,6 +430,7 @@ static const char *default_variables[] =
|
||||
|
||||
"MV", "rename/new_version",
|
||||
"CP", "copy",
|
||||
".LIBPATTERNS", "%.olb lib%.a",
|
||||
|
||||
#else /* !VMS */
|
||||
|
||||
@@ -523,6 +561,8 @@ static const char *default_variables[] =
|
||||
".LIBPATTERNS", "lib%.a $(DJDIR)/lib/lib%.a",
|
||||
#elif defined(__APPLE__)
|
||||
".LIBPATTERNS", "lib%.dylib lib%.a",
|
||||
#elif defined(__CYGWIN__) || defined(WINDOWS32)
|
||||
".LIBPATTERNS", "lib%.dll.a %.dll.a lib%.a %.lib lib%.dll %.dll",
|
||||
#else
|
||||
".LIBPATTERNS", "lib%.so lib%.a",
|
||||
#endif
|
||||
@@ -546,8 +586,8 @@ set_default_suffixes (void)
|
||||
else
|
||||
{
|
||||
struct dep *d;
|
||||
char *p = default_suffixes;
|
||||
suffix_file->deps = enter_prereqs (PARSE_SIMPLE_SEQ (&p, struct dep),
|
||||
const char *p = default_suffixes;
|
||||
suffix_file->deps = enter_prereqs (PARSE_SIMPLE_SEQ ((char **)&p, struct dep),
|
||||
NULL);
|
||||
for (d = suffix_file->deps; d; d = d->next)
|
||||
d->file->builtin = 1;
|
||||
@@ -564,7 +604,7 @@ set_default_suffixes (void)
|
||||
void
|
||||
install_default_suffix_rules (void)
|
||||
{
|
||||
char **s;
|
||||
const char **s;
|
||||
|
||||
if (no_builtin_rules_flag)
|
||||
return;
|
||||
@@ -576,7 +616,7 @@ install_default_suffix_rules (void)
|
||||
assert (f->cmds == 0);
|
||||
f->cmds = xmalloc (sizeof (struct commands));
|
||||
f->cmds->fileinfo.filenm = 0;
|
||||
f->cmds->commands = s[1];
|
||||
f->cmds->commands = xstrdup (s[1]);
|
||||
f->cmds->command_lines = 0;
|
||||
f->cmds->recipe_prefix = RECIPEPREFIX_DEFAULT;
|
||||
f->builtin = 1;
|
||||
|
||||
2
dep.h
2
dep.h
@@ -1,5 +1,5 @@
|
||||
/* Definitions of dependency data structures for GNU Make.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2014 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
|
||||
|
||||
13
dir.c
13
dir.c
@@ -1,5 +1,5 @@
|
||||
/* Directory hashing for GNU Make.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2014 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
|
||||
@@ -674,7 +674,7 @@ dir_contents_file_exists_p (struct directory_contents *dir,
|
||||
if (d == 0)
|
||||
{
|
||||
if (errno)
|
||||
fatal (NILF, "INTERNAL: readdir: %s\n", strerror (errno));
|
||||
pfatal_with_name ("INTERNAL: readdir");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1172,13 +1172,6 @@ read_dirstream (__ptr_t stream)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
ansi_free (void *p)
|
||||
{
|
||||
if (p)
|
||||
free (p);
|
||||
}
|
||||
|
||||
/* On 64 bit ReliantUNIX (5.44 and above) in LFS mode, stat() is actually a
|
||||
* macro for stat64(). If stat is a macro, make a local wrapper function to
|
||||
* invoke it.
|
||||
@@ -1224,7 +1217,7 @@ dir_setup_glob (glob_t *gl)
|
||||
{
|
||||
gl->gl_opendir = open_dirstream;
|
||||
gl->gl_readdir = read_dirstream;
|
||||
gl->gl_closedir = ansi_free;
|
||||
gl->gl_closedir = free;
|
||||
gl->gl_stat = local_stat;
|
||||
/* We don't bother setting gl_lstat, since glob never calls it.
|
||||
The slot is only there for compatibility with 4.4 BSD. */
|
||||
|
||||
2
doc/.gitignore
vendored
2
doc/.gitignore
vendored
@@ -1,3 +1,5 @@
|
||||
manual/
|
||||
gendocs_template
|
||||
fdl.texi
|
||||
make-stds.texi
|
||||
stamp-vti
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*-Makefile-*-, or close enough
|
||||
# Copyright (C) 2000-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2000-2014 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
|
||||
@@ -22,14 +22,3 @@ info_TEXINFOS = make.texi
|
||||
make_TEXINFOS = fdl.texi make-stds.texi
|
||||
|
||||
CLEANFILES = make*.html
|
||||
|
||||
## ----------------------------- ##
|
||||
## Other documentation formats. ##
|
||||
## ----------------------------- ##
|
||||
|
||||
html: make_1.html
|
||||
|
||||
make_1.html: $(info_TEXINFOS) $(make_TEXINFOS)
|
||||
$(TEXI2HTML) $(TEXI2HTML_FLAGS) $(srcdir)/make.texi
|
||||
|
||||
.PHONY: html
|
||||
|
||||
165
doc/make.texi
165
doc/make.texi
@@ -3,7 +3,7 @@
|
||||
@setfilename make.info
|
||||
|
||||
@include version.texi
|
||||
@set EDITION 0.72
|
||||
@set EDITION 0.73
|
||||
|
||||
@settitle GNU @code{make}
|
||||
@setchapternewpage odd
|
||||
@@ -26,7 +26,7 @@ of @cite{The GNU Make Manual}, for GNU @code{make} version @value{VERSION}.
|
||||
|
||||
Copyright @copyright{} 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
|
||||
1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007,
|
||||
2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
|
||||
2008, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
|
||||
|
||||
@quotation
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
@@ -304,7 +304,7 @@ Using Implicit Rules
|
||||
|
||||
* Using Implicit:: How to use an existing implicit rule
|
||||
to get the recipes for updating a file.
|
||||
* Catalogue of Rules:: A list of built-in implicit rules.
|
||||
* Catalogue of Rules:: A list of built-in rules.
|
||||
* Implicit Variables:: How to change what predefined rules do.
|
||||
* Chained Rules:: How to use a chain of implicit rules.
|
||||
* Pattern Rules:: How to define new implicit rules.
|
||||
@@ -1528,7 +1528,7 @@ A rule is always expanded the same way, regardless of the form:
|
||||
|
||||
@example
|
||||
@var{immediate} : @var{immediate} ; @var{deferred}
|
||||
@var{deferred}
|
||||
@var{deferred}
|
||||
@end example
|
||||
|
||||
That is, the target and prerequisite sections are expanded immediately,
|
||||
@@ -2584,30 +2584,14 @@ will be executed every time you say @samp{make clean}.
|
||||
@cindex @code{rm} (shell command)
|
||||
|
||||
@findex .PHONY
|
||||
The phony target will cease to work if anything ever does create a file
|
||||
named @file{clean} in this directory. Since it has no prerequisites, the
|
||||
file @file{clean} would inevitably be considered up to date, and its
|
||||
recipe would not be executed. To avoid this problem, you can explicitly
|
||||
declare the target to be phony, using the special target @code{.PHONY}
|
||||
In this example, the @file{clean} target will not work properly if a
|
||||
file named @file{clean} is ever created in this directory. Since it
|
||||
has no prerequisites, @file{clean} would always be considered up to
|
||||
date and its recipe would not be executed. To avoid this problem you
|
||||
can explicitly declare the target to be phony by making it a
|
||||
prerequisite of the special target @code{.PHONY}
|
||||
(@pxref{Special Targets, ,Special Built-in Target Names}) as follows:
|
||||
|
||||
@example
|
||||
.PHONY : clean
|
||||
@end example
|
||||
|
||||
@noindent
|
||||
Once this is done, @samp{make clean} will run the recipe regardless of
|
||||
whether there is a file named @file{clean}.
|
||||
|
||||
Since it knows that phony targets do not name actual files that could be
|
||||
remade from other files, @code{make} skips the implicit rule search for
|
||||
phony targets (@pxref{Implicit Rules}). This is why declaring a target
|
||||
phony is good for performance, even if you are not worried about the
|
||||
actual file existing.
|
||||
|
||||
Thus, you first write the line that states that @code{clean} is a
|
||||
phony target, then you write the rule, like this:
|
||||
|
||||
@example
|
||||
@group
|
||||
.PHONY: clean
|
||||
@@ -2616,12 +2600,16 @@ clean:
|
||||
@end group
|
||||
@end example
|
||||
|
||||
Another example of the usefulness of phony targets is in conjunction
|
||||
with recursive invocations of @code{make} (for more information, see
|
||||
@ref{Recursion, ,Recursive Use of @code{make}}). In this case the
|
||||
makefile will often contain a variable which lists a number of
|
||||
sub-directories to be built. One way to handle this is with one rule
|
||||
whose recipe is a shell loop over the sub-directories, like this:
|
||||
@noindent
|
||||
Once this is done, @samp{make clean} will run the recipe regardless of
|
||||
whether there is a file named @file{clean}.
|
||||
|
||||
Phony targets are also useful in conjunction with recursive
|
||||
invocations of @code{make} (@pxref{Recursion, ,Recursive Use of @code{make}}).
|
||||
In this situation the makefile will often contain a variable which
|
||||
lists a number of sub-directories to be built. A simplistic way to
|
||||
handle this is to define one rule with a recipe that loops over the
|
||||
sub-directories, like this:
|
||||
|
||||
@example
|
||||
@group
|
||||
@@ -2644,9 +2632,9 @@ you cannot take advantage of @code{make}'s ability to build targets in
|
||||
parallel (@pxref{Parallel, ,Parallel Execution}), since there is only
|
||||
one rule.
|
||||
|
||||
By declaring the sub-directories as phony targets (you must do this as
|
||||
the sub-directory obviously always exists; otherwise it won't be built)
|
||||
you can remove these problems:
|
||||
By declaring the sub-directories as @code{.PHONY} targets (you must do
|
||||
this as the sub-directory obviously always exists; otherwise it won't
|
||||
be built) you can remove these problems:
|
||||
|
||||
@example
|
||||
@group
|
||||
@@ -2668,6 +2656,11 @@ built until after the @file{baz} sub-directory is complete; this kind of
|
||||
relationship declaration is particularly important when attempting
|
||||
parallel builds.
|
||||
|
||||
The implicit rule search (@pxref{Implicit Rules}) is skipped for
|
||||
@code{.PHONY} targets. This is why declaring a target as
|
||||
@code{.PHONY} is good for performance, even if you are not worried
|
||||
about the actual file existing.
|
||||
|
||||
A phony target should not be a prerequisite of a real target file; if it
|
||||
is, its recipe will be run every time @code{make} goes to update that
|
||||
file. As long as a phony target is never a prerequisite of a real
|
||||
@@ -4808,10 +4801,17 @@ to GNU @code{make}, and hence do not want to add GNU
|
||||
@code{make}-specific flags to the @code{MAKEFLAGS} variable, you can
|
||||
add them to the @code{GNUMAKEFLAGS} variable instead. This variable
|
||||
is parsed just before @code{MAKEFLAGS}, in the same way as
|
||||
@code{MAKEFLAGS}. Note, however, that when @code{make} constructs
|
||||
@code{MAKEFLAGS} to pass to a recursive @code{make} it will include
|
||||
all flags. GNU @code{make} never sets the @code{GNUMAKEFLAGS}
|
||||
variable itself.
|
||||
@code{MAKEFLAGS}. When @code{make} constructs @code{MAKEFLAGS} to
|
||||
pass to a recursive @code{make} it will include all flags, even those
|
||||
taken from @code{GNUMAKEFLAGS}. As a result, after parsing
|
||||
@code{GNUMAKEFLAGS} GNU @code{make} sets this variable to the empty
|
||||
string to avoid duplicating flags during recursion.
|
||||
|
||||
It's best to use @code{GNUMAKEFLAGS} only with flags which won't
|
||||
materially change the behavior of your makefiles. If your makefiles
|
||||
require GNU make anyway then simply use @code{MAKEFLAGS}. Flags such
|
||||
as @samp{--no-print-directory} or @samp{--output-sync} may be
|
||||
appropriate for @code{GNUMAKEFLAGS}.
|
||||
|
||||
@node -w Option, , Options/Recursion, Recursion
|
||||
@subsection The @samp{--print-directory} Option
|
||||
@@ -5802,7 +5802,7 @@ CFLAGS += -pg # enable profiling
|
||||
@noindent
|
||||
The first line defines the @code{CFLAGS} variable with a reference to another
|
||||
variable, @code{includes}. (@code{CFLAGS} is used by the rules for C
|
||||
compilation; @pxref{Catalogue of Rules, ,Catalogue of Implicit Rules}.)
|
||||
compilation; @pxref{Catalogue of Rules, ,Catalogue of Built-In Rules}.)
|
||||
Using @samp{=} for the definition makes @code{CFLAGS} a recursively-expanded
|
||||
variable, meaning @w{@samp{$(includes) -O}} is @emph{not} expanded when
|
||||
@code{make} processes the definition of @code{CFLAGS}. Thus, @code{includes}
|
||||
@@ -6321,6 +6321,28 @@ will contain the number of times this instance has restarted. Note
|
||||
this is not the same as recursion (counted by the @code{MAKELEVEL}
|
||||
variable). You should not set, modify, or export this variable.
|
||||
|
||||
@vindex MAKE_TERMOUT @r{(whether stdout is a terminal)}
|
||||
@vindex MAKE_TERMERR @r{(whether stderr is a terminal)}
|
||||
@item MAKE_TERMOUT
|
||||
@itemx MAKE_TERMERR
|
||||
When @code{make} starts it will check whether stdout and stderr will
|
||||
show their output on a terminal. If so, it will set
|
||||
@code{MAKE_TERMOUT} and @code{MAKE_TERMERR}, respectively, to the name
|
||||
of the terminal device (or @code{true} if this cannot be determined).
|
||||
If set these variables will be marked for export. These variables
|
||||
will not be changed by @code{make} and they will not be modified if
|
||||
already set.
|
||||
|
||||
These values can be used (particularly in combination with output
|
||||
synchronization (@pxref{Parallel Output, ,Output During Parallel
|
||||
Execution}) to determine whether @code{make} itself is writing to a
|
||||
terminal; they can be tested to decide whether to force recipe
|
||||
commands to generate colorized output for example.
|
||||
|
||||
If you invoke a sub-@code{make} and redirect its stdout or stderr it
|
||||
is your responsibility to reset or unexport these variables as well,
|
||||
if your makefiles rely on them.
|
||||
|
||||
@vindex .RECIPEPREFIX @r{(change the recipe prefix character)}
|
||||
@item .RECIPEPREFIX
|
||||
The first character of the value of this variable is used as the
|
||||
@@ -7509,7 +7531,7 @@ exist.
|
||||
The syntax of the @code{file} function is:
|
||||
|
||||
@example
|
||||
$(file @var{op} @var{filename},@var{text})
|
||||
$(file @var{op} @var{filename}[,@var{text}])
|
||||
@end example
|
||||
|
||||
The operator @var{op} can be either @code{>} which indicates overwrite
|
||||
@@ -7521,8 +7543,9 @@ When the @code{file} function is expanded all its arguments are
|
||||
expanded first, then the file indicated by @var{filename} will be
|
||||
opened in the mode described by @var{op}. Finally @var{text} will be
|
||||
written to the file. If @var{text} does not already end in a newline,
|
||||
a final newline will be written. The result of evaluating the
|
||||
@code{file} function is always the empty string.
|
||||
even if empty, a final newline will be written. If the @var{text}
|
||||
argument is not given, nothing will be written. The result of
|
||||
evaluating the @code{file} function is always the empty string.
|
||||
|
||||
It is a fatal error if the file cannot be opened for writing, or if
|
||||
the write operation fails.
|
||||
@@ -7549,7 +7572,7 @@ input file, you might write your recipe like this:
|
||||
@example
|
||||
@group
|
||||
program: $(OBJECTS)
|
||||
$(file >$@@.in,) $(foreach O,$^,$(file >>$@@.in,$O))
|
||||
$(file >$@@.in) $(foreach O,$^,$(file >>$@@.in,$O))
|
||||
$(CMD) $(CMDFLAGS) @@$@@.in
|
||||
@@rm $@@.in
|
||||
@end group
|
||||
@@ -8927,7 +8950,7 @@ retained for compatibility.
|
||||
@menu
|
||||
* Using Implicit:: How to use an existing implicit rule
|
||||
to get the recipes for updating a file.
|
||||
* Catalogue of Rules:: A list of built-in implicit rules.
|
||||
* Catalogue of Rules:: A list of built-in rules.
|
||||
* Implicit Variables:: How to change what predefined rules do.
|
||||
* Chained Rules:: How to use a chain of implicit rules.
|
||||
* Pattern Rules:: How to define new implicit rules.
|
||||
@@ -8979,7 +9002,7 @@ compiler; and so on.
|
||||
Of course, when you write the makefile, you know which implicit rule you
|
||||
want @code{make} to use, and you know it will choose that one because you
|
||||
know which possible prerequisite files are supposed to exist.
|
||||
@xref{Catalogue of Rules, ,Catalogue of Implicit Rules},
|
||||
@xref{Catalogue of Rules, ,Catalogue of Built-In Rules},
|
||||
for a catalogue of all the predefined implicit rules.
|
||||
|
||||
Above, we said an implicit rule applies if the required prerequisites ``exist
|
||||
@@ -9009,7 +9032,7 @@ make an object file, a @file{.o} file, from a Pascal source file, a
|
||||
@file{.p} file. For example, if @file{foo.c} also exists, the implicit
|
||||
rule to make an object file from a C source file is used instead,
|
||||
because it appears before the Pascal rule in the list of predefined
|
||||
implicit rules (@pxref{Catalogue of Rules, , Catalogue of Implicit
|
||||
implicit rules (@pxref{Catalogue of Rules, , Catalogue of Built-In
|
||||
Rules}).
|
||||
|
||||
If you do not want an implicit rule to be used for a target that has no
|
||||
@@ -9017,7 +9040,7 @@ recipe, you can give that target an empty recipe by writing a semicolon
|
||||
(@pxref{Empty Recipes, ,Defining Empty Recipes}).
|
||||
|
||||
@node Catalogue of Rules, Implicit Variables, Using Implicit, Implicit Rules
|
||||
@section Catalogue of Implicit Rules
|
||||
@section Catalogue of Built-In Rules
|
||||
@cindex implicit rule, predefined
|
||||
@cindex rule, implicit, predefined
|
||||
|
||||
@@ -11108,16 +11131,14 @@ arguments are as follows:
|
||||
@table @code
|
||||
@item name
|
||||
The function name. This is what the makefile should use to invoke the
|
||||
function. The name must be between 1 and 255 characters long.
|
||||
function. The name must be between 1 and 255 characters long and it
|
||||
may only contain alphanumeric, period (@samp{.}), dash (@samp{-}), and
|
||||
underscore (@samp{_}) characters. It may not begin with a period.
|
||||
|
||||
@item func_ptr
|
||||
A pointer to a function that @code{make} will invoke when it expands
|
||||
the function in a makefile. This function must be defined by the
|
||||
loaded object. GNU @code{make} will call it with three arguments:
|
||||
@code{name} (the same name as above), @code{argc} (the number of
|
||||
arguments to the function), and @code{argv} (the list of arguments to
|
||||
the function). The last argument (that is, @code{argv[argc]} will be
|
||||
null (@code{0}).
|
||||
loaded object.
|
||||
|
||||
@item min_args
|
||||
The minimum number of arguments the function will accept. Must be
|
||||
@@ -11133,12 +11154,30 @@ arguments. If the value is 0, then any number of arguments is
|
||||
accepted. If the value is greater than 0, then it must be greater
|
||||
than or equal to @code{min_args}.
|
||||
|
||||
@item expand_args
|
||||
If this value is 0, then @code{make} will not expand the arguments to
|
||||
the function before passing them to @code{func_ptr}. If the value is
|
||||
non-0, then the arguments will be expanded first.
|
||||
@item flags
|
||||
Flags that specify how this function will operate; the desired flags
|
||||
should be OR'd together. If the @code{GMK_FUNC_NOEXPAND} flag is
|
||||
given then the function arguments will not be expanded before the
|
||||
function is called; otherwise they will be expanded first.
|
||||
@end table
|
||||
|
||||
@subsubheading Registered Function Interface
|
||||
@findex gmk_func_ptr
|
||||
|
||||
A function registered with @code{make} must match the
|
||||
@code{gmk_func_ptr} type. It will be invoked with three parameters:
|
||||
@code{name} (the name of the function), @code{argc} (the number of
|
||||
arguments to the function), and @code{argv} (an array of pointers to
|
||||
arguments to the function). The last pointer (that is,
|
||||
@code{argv[argc]}) will be null (@code{0}).
|
||||
|
||||
The return value of the function is the result of expanding the
|
||||
function. If the function expands to nothing the return value may be
|
||||
null. Otherwise, it must be a pointer to a string created with
|
||||
@code{gmk_alloc}. Once the function returns, @code{make} owns this
|
||||
string and will free it when appropriate; it cannot be accessed by the
|
||||
loaded object.
|
||||
|
||||
@subsubheading GNU @code{make} Facilities
|
||||
|
||||
There are some facilities exported by GNU @code{make} for use by
|
||||
@@ -11177,6 +11216,12 @@ should never pass memory that you've allocated directly to any
|
||||
memory returned to you by any @code{make} function. Instead, use the
|
||||
@code{gmk_alloc} and @code{gmk_free} functions.
|
||||
|
||||
In particular, the string returned to @code{make} by a function
|
||||
registered using @code{gmk_add_function} @emph{must} be allocated
|
||||
using @code{gmk_alloc}, and the string returned from the @code{make}
|
||||
@code{gmk_expand} function @emph{must} be freed (when no longer
|
||||
needed) using @code{gmk_free}.
|
||||
|
||||
@table @code
|
||||
@item gmk_alloc
|
||||
@findex gmk_alloc
|
||||
@@ -11543,7 +11588,7 @@ functionality in that it will check out SCCS files for makefiles.
|
||||
|
||||
@item
|
||||
Various new built-in implicit rules.
|
||||
@xref{Catalogue of Rules, ,Catalogue of Implicit Rules}.
|
||||
@xref{Catalogue of Rules, ,Catalogue of Built-In Rules}.
|
||||
|
||||
@item
|
||||
Load dynamic objects which can modify the behavior of @code{make}.
|
||||
@@ -11666,7 +11711,7 @@ special treatment.
|
||||
|
||||
This appendix summarizes the directives, text manipulation functions,
|
||||
and special variables which GNU @code{make} understands.
|
||||
@xref{Special Targets}, @ref{Catalogue of Rules, ,Catalogue of Implicit Rules},
|
||||
@xref{Special Targets}, @ref{Catalogue of Rules, ,Catalogue of Built-In Rules},
|
||||
and @ref{Options Summary, ,Summary of Options},
|
||||
for other summaries.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
rem Copyright (C) 1998-2013 Free Software Foundation, Inc.
|
||||
rem Copyright (C) 1998-2014 Free Software Foundation, Inc.
|
||||
rem This file is part of GNU Make.
|
||||
rem
|
||||
rem GNU Make is free software; you can redistribute it and/or modify it under
|
||||
|
||||
14
expand.c
14
expand.c
@@ -1,5 +1,5 @@
|
||||
/* Variable expansion functions for GNU Make.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2014 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
|
||||
@@ -121,9 +121,9 @@ recursively_expand_for_file (struct variable *v, struct file *file)
|
||||
{
|
||||
if (!v->exp_count)
|
||||
/* Expanding V causes infinite recursion. Lose. */
|
||||
fatal (*expanding_var,
|
||||
_("Recursive variable '%s' references itself (eventually)"),
|
||||
v->name);
|
||||
OS (fatal, *expanding_var,
|
||||
_("Recursive variable '%s' references itself (eventually)"),
|
||||
v->name);
|
||||
--v->exp_count;
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ variable_expand_string (char *line, const char *string, long length)
|
||||
end = strchr (beg, closeparen);
|
||||
if (end == 0)
|
||||
/* Unterminated variable reference. */
|
||||
fatal (*expanding_var, _("unterminated variable reference"));
|
||||
O (fatal, *expanding_var, _("unterminated variable reference"));
|
||||
p1 = lindex (beg, end, '$');
|
||||
if (p1 != 0)
|
||||
{
|
||||
@@ -377,7 +377,6 @@ variable_expand_string (char *line, const char *string, long length)
|
||||
Look up the value of the variable. */
|
||||
o = reference_variable (o, beg, end - beg);
|
||||
|
||||
if (abeg)
|
||||
free (abeg);
|
||||
}
|
||||
break;
|
||||
@@ -447,8 +446,7 @@ expand_argument (const char *str, const char *end)
|
||||
|
||||
r = allocated_variable_expand (tmp);
|
||||
|
||||
if (alloc)
|
||||
free (alloc);
|
||||
free (alloc);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
35
file.c
35
file.c
@@ -1,5 +1,5 @@
|
||||
/* Target file management for GNU Make.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2014 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
|
||||
@@ -261,22 +261,25 @@ rehash_file (struct file *from_file, const char *to_hname)
|
||||
to_file->cmds = from_file->cmds;
|
||||
else if (from_file->cmds != to_file->cmds)
|
||||
{
|
||||
size_t l = strlen (from_file->name);
|
||||
/* We have two sets of commands. We will go with the
|
||||
one given in the rule explicitly mentioning this name,
|
||||
but give a message to let the user know what's going on. */
|
||||
if (to_file->cmds->fileinfo.filenm != 0)
|
||||
error (&from_file->cmds->fileinfo,
|
||||
l + strlen (to_file->cmds->fileinfo.filenm) + INTSTR_LENGTH,
|
||||
_("Recipe was specified for file '%s' at %s:%lu,"),
|
||||
from_file->name, to_file->cmds->fileinfo.filenm,
|
||||
to_file->cmds->fileinfo.lineno);
|
||||
else
|
||||
error (&from_file->cmds->fileinfo,
|
||||
error (&from_file->cmds->fileinfo, l,
|
||||
_("Recipe for file '%s' was found by implicit rule search,"),
|
||||
from_file->name);
|
||||
error (&from_file->cmds->fileinfo,
|
||||
l += strlen (to_hname);
|
||||
error (&from_file->cmds->fileinfo, l,
|
||||
_("but '%s' is now considered the same file as '%s'."),
|
||||
from_file->name, to_hname);
|
||||
error (&from_file->cmds->fileinfo,
|
||||
error (&from_file->cmds->fileinfo, l,
|
||||
_("Recipe for '%s' will be ignored in favor of the one for '%s'."),
|
||||
to_hname, from_file->name);
|
||||
}
|
||||
@@ -297,13 +300,14 @@ rehash_file (struct file *from_file, const char *to_hname)
|
||||
merge_variable_set_lists (&to_file->variables, from_file->variables);
|
||||
|
||||
if (to_file->double_colon && from_file->is_target && !from_file->double_colon)
|
||||
fatal (NILF, _("can't rename single-colon '%s' to double-colon '%s'"),
|
||||
from_file->name, to_hname);
|
||||
OSS (fatal, NILF, _("can't rename single-colon '%s' to double-colon '%s'"),
|
||||
from_file->name, to_hname);
|
||||
if (!to_file->double_colon && from_file->double_colon)
|
||||
{
|
||||
if (to_file->is_target)
|
||||
fatal (NILF, _("can't rename double-colon '%s' to single-colon '%s'"),
|
||||
from_file->name, to_hname);
|
||||
OSS (fatal, NILF,
|
||||
_("can't rename double-colon '%s' to single-colon '%s'"),
|
||||
from_file->name, to_hname);
|
||||
else
|
||||
to_file->double_colon = from_file->double_colon;
|
||||
}
|
||||
@@ -393,7 +397,8 @@ remove_intermediates (int sig)
|
||||
if (!f->dontcare)
|
||||
{
|
||||
if (sig)
|
||||
error (NILF, _("*** Deleting intermediate file '%s'"), f->name);
|
||||
OS (error, NILF,
|
||||
_("*** Deleting intermediate file '%s'"), f->name);
|
||||
else
|
||||
{
|
||||
if (! doneany)
|
||||
@@ -803,10 +808,11 @@ file_timestamp_cons (const char *fname, time_t stamp, long int ns)
|
||||
&& product <= ts && ts <= ORDINARY_MTIME_MAX))
|
||||
{
|
||||
char buf[FILE_TIMESTAMP_PRINT_LEN_BOUND + 1];
|
||||
const char *f = fname ? fname : _("Current time");
|
||||
ts = s <= OLD_MTIME ? ORDINARY_MTIME_MIN : ORDINARY_MTIME_MAX;
|
||||
file_timestamp_sprintf (buf, ts);
|
||||
error (NILF, _("%s: Timestamp out of range; substituting %s"),
|
||||
fname ? fname : _("Current time"), buf);
|
||||
OSS (error, NILF,
|
||||
_("%s: Timestamp out of range; substituting %s"), f, buf);
|
||||
}
|
||||
|
||||
return ts;
|
||||
@@ -1046,9 +1052,10 @@ print_file_data_base (void)
|
||||
/* Verify the integrity of the data base of files. */
|
||||
|
||||
#define VERIFY_CACHED(_p,_n) \
|
||||
do{\
|
||||
if (_p->_n && _p->_n[0] && !strcache_iscached (_p->_n)) \
|
||||
error (NULL, _("%s: Field '%s' not cached: %s"), _p->name, # _n, _p->_n); \
|
||||
do{ \
|
||||
if (_p->_n && _p->_n[0] && !strcache_iscached (_p->_n)) \
|
||||
error (NULL, strlen (_p->name) + CSTRLEN (# _n) + strlen (_p->_n), \
|
||||
_("%s: Field '%s' not cached: %s"), _p->name, # _n, _p->_n); \
|
||||
}while(0)
|
||||
|
||||
static void
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Definition of target file data structures for GNU Make.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2014 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
|
||||
@@ -143,7 +143,7 @@ void print_file_data_base (void);
|
||||
& ((1 << FILE_TIMESTAMP_LO_BITS) - 1)))
|
||||
|
||||
/* Upper bound on length of string "YYYY-MM-DD HH:MM:SS.NNNNNNNNN"
|
||||
representing a file timestamp. The upper bound is not necessarily 19,
|
||||
representing a file timestamp. The upper bound is not necessarily 29,
|
||||
since the year might be less than -999 or greater than 9999.
|
||||
|
||||
Subtract one for the sign bit if in case file timestamps can be negative;
|
||||
|
||||
217
function.c
217
function.c
@@ -1,5 +1,5 @@
|
||||
/* Builtin function expansion for GNU Make.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2014 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
|
||||
@@ -31,7 +31,7 @@ struct function_table_entry
|
||||
{
|
||||
union {
|
||||
char *(*func_ptr) (char *output, char **argv, const char *fname);
|
||||
char *(*alloc_func_ptr) (const char *fname, int argc, char **argv);
|
||||
gmk_func_ptr alloc_func_ptr;
|
||||
} fptr;
|
||||
const char *name;
|
||||
unsigned char len;
|
||||
@@ -269,19 +269,19 @@ patsubst_expand (char *o, const char *text, char *pattern, char *replace)
|
||||
static const struct function_table_entry *
|
||||
lookup_function (const char *s)
|
||||
{
|
||||
struct function_table_entry function_table_entry_key;
|
||||
const char *e = s;
|
||||
|
||||
while (*e && ( (*e >= 'a' && *e <= 'z') || *e == '-'))
|
||||
while (STOP_SET (*e, MAP_USERFUNC))
|
||||
e++;
|
||||
if (*e == '\0' || isblank ((unsigned char) *e))
|
||||
{
|
||||
struct function_table_entry function_table_entry_key;
|
||||
function_table_entry_key.name = s;
|
||||
function_table_entry_key.len = e - s;
|
||||
|
||||
return hash_find_item (&function_table, &function_table_entry_key);
|
||||
}
|
||||
return 0;
|
||||
if (e == s || !STOP_SET(*e, MAP_NUL|MAP_SPACE))
|
||||
return NULL;
|
||||
|
||||
function_table_entry_key.name = s;
|
||||
function_table_entry_key.len = e - s;
|
||||
|
||||
return hash_find_item (&function_table, &function_table_entry_key);
|
||||
}
|
||||
|
||||
|
||||
@@ -519,8 +519,25 @@ func_notdir_suffix (char *o, char **argv, const char *funcname)
|
||||
|
||||
int is_suffix = funcname[0] == 's';
|
||||
int is_notdir = !is_suffix;
|
||||
int stop = MAP_PATHSEP | (is_suffix ? MAP_DOT : 0);
|
||||
int stop = MAP_DIRSEP | (is_suffix ? MAP_DOT : 0);
|
||||
#ifdef VMS
|
||||
/* For VMS list_iterator points to a comma separated list. To use the common
|
||||
[find_]next_token, create a local copy and replace the commas with
|
||||
spaces. Obviously, there is a problem if there is a ',' in the VMS filename
|
||||
(can only happen on ODS5), the same problem as with spaces in filenames,
|
||||
which seems to be present in make on all platforms. */
|
||||
char *vms_list_iterator = alloca(strlen(list_iterator) + 1);
|
||||
int i;
|
||||
for (i = 0; list_iterator[i]; i++)
|
||||
if (list_iterator[i] == ',')
|
||||
vms_list_iterator[i] = ' ';
|
||||
else
|
||||
vms_list_iterator[i] = list_iterator[i];
|
||||
vms_list_iterator[i] = list_iterator[i];
|
||||
while ((p2 = find_next_token((const char**) &vms_list_iterator, &len)) != 0)
|
||||
#else
|
||||
while ((p2 = find_next_token (&list_iterator, &len)) != 0)
|
||||
#endif
|
||||
{
|
||||
const char *p = p2 + len - 1;
|
||||
|
||||
@@ -548,7 +565,11 @@ func_notdir_suffix (char *o, char **argv, const char *funcname)
|
||||
|
||||
if (is_notdir || p >= p2)
|
||||
{
|
||||
#ifdef VMS
|
||||
o = variable_buffer_output (o, ",", 1);
|
||||
#else
|
||||
o = variable_buffer_output (o, " ", 1);
|
||||
#endif
|
||||
doneany = 1;
|
||||
}
|
||||
}
|
||||
@@ -572,8 +593,21 @@ func_basename_dir (char *o, char **argv, const char *funcname)
|
||||
|
||||
int is_basename = funcname[0] == 'b';
|
||||
int is_dir = !is_basename;
|
||||
int stop = MAP_PATHSEP | (is_basename ? MAP_DOT : 0) | MAP_NUL;
|
||||
int stop = MAP_DIRSEP | (is_basename ? MAP_DOT : 0) | MAP_NUL;
|
||||
#ifdef VMS
|
||||
/* As in func_notdir_suffix ... */
|
||||
char *vms_p3 = alloca(strlen(p3) + 1);
|
||||
int i;
|
||||
for (i = 0; p3[i]; i++)
|
||||
if (p3[i] == ',')
|
||||
vms_p3[i] = ' ';
|
||||
else
|
||||
vms_p3[i] = p3[i];
|
||||
vms_p3[i] = p3[i];
|
||||
while ((p2 = find_next_token((const char**) &vms_p3, &len)) != 0)
|
||||
#else
|
||||
while ((p2 = find_next_token (&p3, &len)) != 0)
|
||||
#endif
|
||||
{
|
||||
const char *p = p2 + len - 1;
|
||||
while (p >= p2 && ! STOP_SET (*p, stop))
|
||||
@@ -602,7 +636,11 @@ func_basename_dir (char *o, char **argv, const char *funcname)
|
||||
/* The entire name is the basename. */
|
||||
o = variable_buffer_output (o, p2, len);
|
||||
|
||||
#ifdef VMS
|
||||
o = variable_buffer_output (o, ",", 1);
|
||||
#else
|
||||
o = variable_buffer_output (o, " ", 1);
|
||||
#endif
|
||||
doneany = 1;
|
||||
}
|
||||
|
||||
@@ -726,7 +764,7 @@ check_numeric (const char *s, const char *msg)
|
||||
break;
|
||||
|
||||
if (s <= end || end - beg < 0)
|
||||
fatal (*expanding_var, "%s: '%s'", msg, beg);
|
||||
OSS (fatal, *expanding_var, "%s: '%s'", msg, beg);
|
||||
}
|
||||
|
||||
|
||||
@@ -743,8 +781,8 @@ func_word (char *o, char **argv, const char *funcname UNUSED)
|
||||
i = atoi (argv[0]);
|
||||
|
||||
if (i == 0)
|
||||
fatal (*expanding_var,
|
||||
_("first argument to 'word' function must be greater than 0"));
|
||||
O (fatal, *expanding_var,
|
||||
_("first argument to 'word' function must be greater than 0"));
|
||||
|
||||
end_p = argv[1];
|
||||
while ((p = find_next_token (&end_p, 0)) != 0)
|
||||
@@ -770,8 +808,8 @@ func_wordlist (char *o, char **argv, const char *funcname UNUSED)
|
||||
|
||||
start = atoi (argv[0]);
|
||||
if (start < 1)
|
||||
fatal (*expanding_var,
|
||||
"invalid first argument to 'wordlist' function: '%d'", start);
|
||||
ON (fatal, *expanding_var,
|
||||
"invalid first argument to 'wordlist' function: '%d'", start);
|
||||
|
||||
count = atoi (argv[1]) - start + 1;
|
||||
|
||||
@@ -1082,10 +1120,10 @@ func_error (char *o, char **argv, const char *funcname)
|
||||
switch (*funcname)
|
||||
{
|
||||
case 'e':
|
||||
fatal (reading_file, "%s", msg);
|
||||
OS (fatal, reading_file, "%s", msg);
|
||||
|
||||
case 'w':
|
||||
error (reading_file, "%s", msg);
|
||||
OS (error, reading_file, "%s", msg);
|
||||
break;
|
||||
|
||||
case 'i':
|
||||
@@ -1094,7 +1132,7 @@ func_error (char *o, char **argv, const char *funcname)
|
||||
break;
|
||||
|
||||
default:
|
||||
fatal (*expanding_var, "Internal error: func_error: '%s'", funcname);
|
||||
OS (fatal, *expanding_var, "Internal error: func_error: '%s'", funcname);
|
||||
}
|
||||
|
||||
/* The warning function expands to the empty string. */
|
||||
@@ -1416,7 +1454,7 @@ int shell_function_pid = 0, shell_function_completed;
|
||||
|
||||
|
||||
int
|
||||
windows32_openpipe (int *pipedes, pid_t *pid_p, char **command_argv, char **envp)
|
||||
windows32_openpipe (int *pipedes, int errfd, pid_t *pid_p, char **command_argv, char **envp)
|
||||
{
|
||||
SECURITY_ATTRIBUTES saAttr;
|
||||
HANDLE hIn = INVALID_HANDLE_VALUE;
|
||||
@@ -1457,11 +1495,12 @@ windows32_openpipe (int *pipedes, pid_t *pid_p, char **command_argv, char **envp
|
||||
}
|
||||
if (hIn == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
error (NILF, _("windows32_openpipe: DuplicateHandle(In) failed (e=%ld)\n"), e);
|
||||
ON (error, NILF,
|
||||
_("windows32_openpipe: DuplicateHandle(In) failed (e=%ld)\n"), e);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
tmpErr = GetStdHandle (STD_ERROR_HANDLE);
|
||||
tmpErr = (HANDLE)_get_osfhandle (errfd);
|
||||
if (DuplicateHandle (GetCurrentProcess (), tmpErr,
|
||||
GetCurrentProcess (), &hErr,
|
||||
0, TRUE, DUPLICATE_SAME_ACCESS) == FALSE)
|
||||
@@ -1480,14 +1519,15 @@ windows32_openpipe (int *pipedes, pid_t *pid_p, char **command_argv, char **envp
|
||||
}
|
||||
if (hErr == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
error (NILF, _("windows32_openpipe: DuplicateHandle(Err) failed (e=%ld)\n"), e);
|
||||
ON (error, NILF,
|
||||
_("windows32_openpipe: DuplicateHandle(Err) failed (e=%ld)\n"), e);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (! CreatePipe (&hChildOutRd, &hChildOutWr, &saAttr, 0))
|
||||
{
|
||||
error (NILF, _("CreatePipe() failed (e=%ld)\n"), GetLastError());
|
||||
ON (error, NILF, _("CreatePipe() failed (e=%ld)\n"), GetLastError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1495,7 +1535,7 @@ windows32_openpipe (int *pipedes, pid_t *pid_p, char **command_argv, char **envp
|
||||
|
||||
if (!hProcess)
|
||||
{
|
||||
error (NILF, _("windows32_openpipe(): process_init_fd() failed\n"));
|
||||
O (error, NILF, _("windows32_openpipe(): process_init_fd() failed\n"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1608,7 +1648,7 @@ char *
|
||||
func_shell_base (char *o, char **argv, int trim_newlines)
|
||||
{
|
||||
fprintf (stderr, "This platform does not support shell\n");
|
||||
die (EXIT_FAILURE);
|
||||
die (MAKE_TROUBLE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1620,7 +1660,7 @@ char *
|
||||
func_shell_base (char *o, char **argv, int trim_newlines)
|
||||
{
|
||||
char *batch_filename = NULL;
|
||||
|
||||
int errfd;
|
||||
#ifdef __MSDOS__
|
||||
FILE *fpipe;
|
||||
#endif
|
||||
@@ -1636,9 +1676,9 @@ func_shell_base (char *o, char **argv, int trim_newlines)
|
||||
are used to run the commands, because we normally refrain from
|
||||
creating batch files under -n. */
|
||||
int j_p_f = just_print_flag;
|
||||
|
||||
just_print_flag = 0;
|
||||
#endif
|
||||
|
||||
/* Construct the argument list. */
|
||||
command_argv = construct_command_argv (argv[0], NULL, NULL, 0,
|
||||
&batch_filename);
|
||||
@@ -1652,15 +1692,15 @@ func_shell_base (char *o, char **argv, int trim_newlines)
|
||||
#endif
|
||||
|
||||
/* Using a target environment for 'shell' loses in cases like:
|
||||
export var = $(shell echo foobie)
|
||||
because target_environment hits a loop trying to expand $(var)
|
||||
to put it in the environment. This is even more confusing when
|
||||
var was not explicitly exported, but just appeared in the
|
||||
calling environment.
|
||||
export var = $(shell echo foobie)
|
||||
bad := $(var)
|
||||
because target_environment hits a loop trying to expand $(var) to put it
|
||||
in the environment. This is even more confusing when 'var' was not
|
||||
explicitly exported, but just appeared in the calling environment.
|
||||
|
||||
See Savannah bug #10593.
|
||||
|
||||
envp = target_environment (NILF);
|
||||
envp = target_environment (NULL);
|
||||
*/
|
||||
|
||||
envp = environ;
|
||||
@@ -1678,6 +1718,9 @@ func_shell_base (char *o, char **argv, int trim_newlines)
|
||||
/* Set up the output in case the shell writes something. */
|
||||
output_start ();
|
||||
|
||||
errfd = (output_context && output_context->err >= 0
|
||||
? output_context->err : FD_STDERR);
|
||||
|
||||
#if defined(__MSDOS__)
|
||||
fpipe = msdos_openpipe (pipedes, &pid, argv[0]);
|
||||
if (pipedes[0] < 0)
|
||||
@@ -1686,7 +1729,7 @@ func_shell_base (char *o, char **argv, int trim_newlines)
|
||||
return o;
|
||||
}
|
||||
#elif defined(WINDOWS32)
|
||||
windows32_openpipe (pipedes, &pid, command_argv, envp);
|
||||
windows32_openpipe (pipedes, errfd, &pid, command_argv, envp);
|
||||
/* Restore the value of just_print_flag. */
|
||||
just_print_flag = j_p_f;
|
||||
|
||||
@@ -1710,7 +1753,7 @@ func_shell_base (char *o, char **argv, int trim_newlines)
|
||||
CLOSE_ON_EXEC(pipedes[1]);
|
||||
CLOSE_ON_EXEC(pipedes[0]);
|
||||
/* Never use fork()/exec() here! Use spawn() instead in exec_command() */
|
||||
pid = child_execute_job (FD_STDIN, pipedes[1], FD_STDOUT, command_argv, envp);
|
||||
pid = child_execute_job (FD_STDIN, pipedes[1], errfd, command_argv, envp);
|
||||
if (pid < 0)
|
||||
perror_with_name (error_prefix, "spawn");
|
||||
# else /* ! __EMX__ */
|
||||
@@ -1724,9 +1767,7 @@ func_shell_base (char *o, char **argv, int trim_newlines)
|
||||
if (stack_limit.rlim_cur)
|
||||
setrlimit (RLIMIT_STACK, &stack_limit);
|
||||
# endif
|
||||
child_execute_job (FD_STDIN, pipedes[1],
|
||||
output_context ? output_context->err : FD_STDERR,
|
||||
command_argv, envp);
|
||||
child_execute_job (FD_STDIN, pipedes[1], errfd, command_argv, envp);
|
||||
}
|
||||
else
|
||||
# endif
|
||||
@@ -1948,8 +1989,12 @@ func_not (char *o, char **argv, char *funcname UNUSED)
|
||||
|
||||
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
#define IS_ABSOLUTE(n) (n[0] && n[1] == ':')
|
||||
#define ROOT_LEN 3
|
||||
# ifdef __CYGWIN__
|
||||
# define IS_ABSOLUTE(n) ((n[0] && n[1] == ':') || STOP_SET (n[0], MAP_DIRSEP))
|
||||
# else
|
||||
# define IS_ABSOLUTE(n) (n[0] && n[1] == ':')
|
||||
# endif
|
||||
# define ROOT_LEN 3
|
||||
#else
|
||||
#define IS_ABSOLUTE(n) (n[0] == '/')
|
||||
#define ROOT_LEN 1
|
||||
@@ -1979,9 +2024,9 @@ abspath (const char *name, char *apath)
|
||||
strcpy (apath, starting_directory);
|
||||
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
if (STOP_SET (name[0], MAP_PATHSEP))
|
||||
if (STOP_SET (name[0], MAP_DIRSEP))
|
||||
{
|
||||
if (STOP_SET (name[1], MAP_PATHSEP))
|
||||
if (STOP_SET (name[1], MAP_DIRSEP))
|
||||
{
|
||||
/* A UNC. Don't prepend a drive letter. */
|
||||
apath[0] = name[0];
|
||||
@@ -2000,13 +2045,17 @@ abspath (const char *name, char *apath)
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(__CYGWIN__) && defined(HAVE_DOS_PATHS)
|
||||
if (STOP_SET (name[0], MAP_DIRSEP))
|
||||
root_len = 1;
|
||||
#endif
|
||||
strncpy (apath, name, root_len);
|
||||
apath[root_len] = '\0';
|
||||
dest = apath + root_len;
|
||||
/* Get past the root, since we already copied it. */
|
||||
name += root_len;
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
if (! STOP_SET (apath[2], MAP_PATHSEP))
|
||||
if (! STOP_SET (apath[root_len - 1], MAP_DIRSEP))
|
||||
{
|
||||
/* Convert d:foo into d:./foo and increase root_len. */
|
||||
apath[2] = '.';
|
||||
@@ -2017,7 +2066,7 @@ abspath (const char *name, char *apath)
|
||||
name--;
|
||||
}
|
||||
else
|
||||
apath[2] = '/'; /* make sure it's a forward slash */
|
||||
apath[root_len - 1] = '/'; /* make sure it's a forward slash */
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2026,11 +2075,11 @@ abspath (const char *name, char *apath)
|
||||
unsigned long len;
|
||||
|
||||
/* Skip sequence of multiple path-separators. */
|
||||
while (STOP_SET (*start, MAP_PATHSEP))
|
||||
while (STOP_SET (*start, MAP_DIRSEP))
|
||||
++start;
|
||||
|
||||
/* Find end of path component. */
|
||||
for (end = start; ! STOP_SET (*end, MAP_PATHSEP|MAP_NUL); ++end)
|
||||
for (end = start; ! STOP_SET (*end, MAP_DIRSEP|MAP_NUL); ++end)
|
||||
;
|
||||
|
||||
len = end - start;
|
||||
@@ -2043,12 +2092,12 @@ abspath (const char *name, char *apath)
|
||||
{
|
||||
/* Back up to previous component, ignore if at root already. */
|
||||
if (dest > apath + root_len)
|
||||
for (--dest; ! STOP_SET (dest[-1], MAP_PATHSEP); --dest)
|
||||
for (--dest; ! STOP_SET (dest[-1], MAP_DIRSEP); --dest)
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! STOP_SET (dest[-1], MAP_PATHSEP))
|
||||
if (! STOP_SET (dest[-1], MAP_DIRSEP))
|
||||
*dest++ = '/';
|
||||
|
||||
if (dest + len >= apath_limit)
|
||||
@@ -2061,7 +2110,7 @@ abspath (const char *name, char *apath)
|
||||
}
|
||||
|
||||
/* Unless it is root strip trailing separator. */
|
||||
if (dest > apath + root_len && STOP_SET (dest[-1], MAP_PATHSEP))
|
||||
if (dest > apath + root_len && STOP_SET (dest[-1], MAP_DIRSEP))
|
||||
--dest;
|
||||
|
||||
*dest = '\0';
|
||||
@@ -2139,20 +2188,25 @@ func_file (char *o, char **argv, const char *funcname UNUSED)
|
||||
|
||||
fp = fopen (fn, mode);
|
||||
if (fp == NULL)
|
||||
fatal (reading_file, _("open: %s: %s"), fn, strerror (errno));
|
||||
else
|
||||
{
|
||||
const char *err = strerror (errno);
|
||||
OSS (fatal, reading_file, _("open: %s: %s"), fn, err);
|
||||
}
|
||||
if (argv[1])
|
||||
{
|
||||
int l = strlen (argv[1]);
|
||||
int nl = (l == 0 || argv[1][l-1] != '\n');
|
||||
int nl = l == 0 || argv[1][l-1] != '\n';
|
||||
|
||||
if (fputs (argv[1], fp) == EOF || (nl && fputc ('\n', fp) == EOF))
|
||||
fatal (reading_file, _("write: %s: %s"), fn, strerror (errno));
|
||||
|
||||
fclose (fp);
|
||||
{
|
||||
const char *err = strerror (errno);
|
||||
OSS (fatal, reading_file, _("write: %s: %s"), fn, err);
|
||||
}
|
||||
}
|
||||
fclose (fp);
|
||||
}
|
||||
else
|
||||
fatal (reading_file, _("Invalid file operation: %s"), fn);
|
||||
OS (fatal, reading_file, _("Invalid file operation: %s"), fn);
|
||||
|
||||
return o;
|
||||
}
|
||||
@@ -2266,7 +2320,7 @@ expand_builtin_function (char *o, int argc, char **argv,
|
||||
char *p;
|
||||
|
||||
if (argc < (int)entry_p->minimum_args)
|
||||
fatal (*expanding_var,
|
||||
fatal (*expanding_var, strlen (entry_p->name),
|
||||
_("insufficient number of arguments (%d) to function '%s'"),
|
||||
argc, entry_p->name);
|
||||
|
||||
@@ -2278,8 +2332,8 @@ expand_builtin_function (char *o, int argc, char **argv,
|
||||
return o;
|
||||
|
||||
if (!entry_p->fptr.func_ptr)
|
||||
fatal (*expanding_var,
|
||||
_("unimplemented on this platform: function '%s'"), entry_p->name);
|
||||
OS (fatal, *expanding_var,
|
||||
_("unimplemented on this platform: function '%s'"), entry_p->name);
|
||||
|
||||
if (!entry_p->alloc_fn)
|
||||
return entry_p->fptr.func_ptr (o, argv, entry_p->name);
|
||||
@@ -2341,7 +2395,7 @@ handle_function (char **op, const char **stringp)
|
||||
break;
|
||||
|
||||
if (count >= 0)
|
||||
fatal (*expanding_var,
|
||||
fatal (*expanding_var, strlen (entry_p->name),
|
||||
_("unterminated call to function '%s': missing '%c'"),
|
||||
entry_p->name, closeparen);
|
||||
|
||||
@@ -2409,7 +2463,7 @@ handle_function (char **op, const char **stringp)
|
||||
if (entry_p->expand_args)
|
||||
for (argvp=argv; *argvp != 0; ++argvp)
|
||||
free (*argvp);
|
||||
else if (abeg)
|
||||
else
|
||||
free (abeg);
|
||||
|
||||
return 1;
|
||||
@@ -2436,7 +2490,7 @@ func_call (char *o, char **argv, const char *funcname UNUSED)
|
||||
/* There is no way to define a variable with a space in the name, so strip
|
||||
leading and trailing whitespace as a favor to the user. */
|
||||
fname = argv[0];
|
||||
while (*fname != '\0' && isspace ((unsigned char)*fname))
|
||||
while (isspace ((unsigned char)*fname))
|
||||
++fname;
|
||||
|
||||
cp = fname + strlen (fname) - 1;
|
||||
@@ -2521,28 +2575,37 @@ func_call (char *o, char **argv, const char *funcname UNUSED)
|
||||
}
|
||||
|
||||
void
|
||||
define_new_function (const gmk_floc *flocp,
|
||||
const char *name, int min, int max, int expand,
|
||||
char *(*func)(const char *, int, char **))
|
||||
define_new_function (const gmk_floc *flocp, const char *name,
|
||||
unsigned int min, unsigned int max, unsigned int flags,
|
||||
gmk_func_ptr func)
|
||||
{
|
||||
const char *e = name;
|
||||
struct function_table_entry *ent;
|
||||
size_t len = strlen (name);
|
||||
size_t len;
|
||||
|
||||
while (STOP_SET (*e, MAP_USERFUNC))
|
||||
e++;
|
||||
len = e - name;
|
||||
|
||||
if (len == 0)
|
||||
O (fatal, flocp, _("Empty function name"));
|
||||
if (*name == '.' || *e != '\0')
|
||||
OS (fatal, flocp, _("Invalid function name: %s"), name);
|
||||
if (len > 255)
|
||||
fatal (flocp, _("Function name too long: %s\n"), name);
|
||||
if (min < 0 || min > 255)
|
||||
fatal (flocp, _("Invalid minimum argument count (%d) for function %s\n"),
|
||||
min, name);
|
||||
if (max < 0 || max > 255 || (max && max < min))
|
||||
fatal (flocp, _("Invalid maximum argument count (%d) for function %s\n"),
|
||||
max, name);
|
||||
OS (fatal, flocp, _("Function name too long: %s"), name);
|
||||
if (min > 255)
|
||||
ONS (fatal, flocp,
|
||||
_("Invalid minimum argument count (%d) for function %s"), min, name);
|
||||
if (max > 255 || (max && max < min))
|
||||
ONS (fatal, flocp,
|
||||
_("Invalid maximum argument count (%d) for function %s"), max, name);
|
||||
|
||||
ent = xmalloc (sizeof (struct function_table_entry));
|
||||
ent->name = name;
|
||||
ent->len = len;
|
||||
ent->minimum_args = min;
|
||||
ent->maximum_args = max;
|
||||
ent->expand_args = expand ? 1 : 0;
|
||||
ent->expand_args = ANY_SET(flags, GMK_FUNC_NOEXPAND) ? 0 : 1;
|
||||
ent->alloc_fn = 1;
|
||||
ent->fptr.alloc_func_ptr = func;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Get the system load averages.
|
||||
Copyright (C) 1985-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1985-2014 Free Software Foundation, Inc.
|
||||
|
||||
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
|
||||
|
||||
2
getopt.c
2
getopt.c
@@ -3,7 +3,7 @@ NOTE: getopt is now part of the C library, so if you don't know what
|
||||
"Keep this file name-space clean" means, talk to drepper@gnu.org
|
||||
before changing it!
|
||||
|
||||
Copyright (C) 1987-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987-2014 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@gnu.org.
|
||||
|
||||
2
getopt.h
2
getopt.h
@@ -1,5 +1,5 @@
|
||||
/* Declarations for getopt.
|
||||
Copyright (C) 1989-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1989-2014 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@gnu.org.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* getopt_long and getopt_long_only entry points for GNU getopt.
|
||||
Copyright (C) 1987-1994, 1996-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987-1994, 1996-2014 Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@gnu.org.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Convenience header for conditional use of GNU <libintl.h>.
|
||||
Copyright (C) 1995-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995-2014 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
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
2013-10-20 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* glob.c (glob): Cherry-pick a471e96a5352a5f0bde6d32dd36d33524811a2b1
|
||||
from git://sourceware.org/git/glibc.git to fix SV 18123,
|
||||
https://sourceware.org/bugzilla/show_bug.cgi?id=10278
|
||||
|
||||
2008-09-28 Juan Manuel Guerrero <juan.guerrero@gmx.de>
|
||||
|
||||
* glob.c (my_realloc) [__DJGPP__]: Don't define, and don't
|
||||
|
||||
@@ -377,6 +377,11 @@ glob (pattern, flags, errfunc, pglob)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* POSIX requires all slashes to be matched. This means that with
|
||||
a trailing slash we must match only directories. */
|
||||
if (pattern[0] && pattern[strlen (pattern) - 1] == '/')
|
||||
flags |= GLOB_ONLYDIR;
|
||||
|
||||
if (flags & GLOB_BRACE)
|
||||
{
|
||||
const char *begin = strchr (pattern, '{');
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
;; Contents of the (gnu make) Guile module
|
||||
;; Copyright (C) 2011-2013 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2011-2014 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
|
||||
|
||||
30
gnumake.h
30
gnumake.h
@@ -1,7 +1,7 @@
|
||||
/* External interfaces usable by dynamic objects loaded into GNU Make.
|
||||
--THIS API IS A "TECHNOLOGY PREVIEW" ONLY. IT IS NOT A STABLE INTERFACE--
|
||||
|
||||
Copyright (C) 2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2013-2014 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
|
||||
@@ -26,6 +26,7 @@ typedef struct
|
||||
unsigned long lineno;
|
||||
} gmk_floc;
|
||||
|
||||
typedef char *(*gmk_func_ptr)(const char *nm, unsigned int argc, char **argv);
|
||||
|
||||
#ifdef _WIN32
|
||||
# ifdef GMK_BUILDING_MAKE
|
||||
@@ -38,17 +39,17 @@ typedef struct
|
||||
#endif
|
||||
|
||||
/* Free memory returned by the gmk_expand() function. */
|
||||
void GMK_EXPORT gmk_free (char *str);
|
||||
GMK_EXPORT void gmk_free (char *str);
|
||||
|
||||
/* Allocate memory in GNU make's context. */
|
||||
char * GMK_EXPORT gmk_alloc (unsigned int len);
|
||||
GMK_EXPORT char *gmk_alloc (unsigned int len);
|
||||
|
||||
/* Run $(eval ...) on the provided string BUFFER. */
|
||||
void GMK_EXPORT gmk_eval (const char *buffer, const gmk_floc *floc);
|
||||
GMK_EXPORT void gmk_eval (const char *buffer, const gmk_floc *floc);
|
||||
|
||||
/* Run GNU make expansion on the provided string STR.
|
||||
Returns an allocated buffer that the caller must free with gmk_free(). */
|
||||
char * GMK_EXPORT gmk_expand (const char *str);
|
||||
GMK_EXPORT char *gmk_expand (const char *str);
|
||||
|
||||
/* Register a new GNU make function NAME (maximum of 255 chars long).
|
||||
When the function is expanded in the makefile, FUNC will be invoked with
|
||||
@@ -60,14 +61,19 @@ char * GMK_EXPORT gmk_expand (const char *str);
|
||||
|
||||
MIN_ARGS is the minimum number of arguments the function requires.
|
||||
MAX_ARGS is the maximum number of arguments (or 0 if there's no maximum).
|
||||
MIN_ARGS and MAX_ARGS must be >= 0 and <= 255.
|
||||
MIN_ARGS and MAX_ARGS may not exceed 255.
|
||||
|
||||
If EXPAND_ARGS is 0, the arguments to the function will not be expanded
|
||||
before FUNC is called. If EXPAND_ARGS is non-0, they will be expanded.
|
||||
The FLAGS value may be GMK_FUNC_DEFAULT, or one or more of the following
|
||||
flags OR'd together:
|
||||
|
||||
GMK_FUNC_NOEXPAND: the arguments to the function will be not be expanded
|
||||
before FUNC is called.
|
||||
*/
|
||||
void GMK_EXPORT gmk_add_function (const char *name,
|
||||
char *(*func)(const char *nm,
|
||||
int argc, char **argv),
|
||||
int min_args, int max_args, int expand_args);
|
||||
GMK_EXPORT void gmk_add_function (const char *name, gmk_func_ptr func,
|
||||
unsigned int min_args, unsigned int max_args,
|
||||
unsigned int flags);
|
||||
|
||||
#define GMK_FUNC_DEFAULT 0x00
|
||||
#define GMK_FUNC_NOEXPAND 0x01
|
||||
|
||||
#endif /* _GNUMAKE_H_ */
|
||||
|
||||
35
guile.c
35
guile.c
@@ -1,5 +1,5 @@
|
||||
/* GNU Guile interface for GNU Make.
|
||||
Copyright (C) 2011-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2011-2014 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
|
||||
@@ -15,6 +15,9 @@ You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
|
||||
#ifdef HAVE_GUILE
|
||||
|
||||
#include "gnumake.h"
|
||||
|
||||
#include "debug.h"
|
||||
@@ -24,6 +27,16 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <libguile.h>
|
||||
|
||||
/* Pre-2.0 versions of Guile don't have a typedef for gsubr function types. */
|
||||
#if SCM_MAJOR_VERSION < 2
|
||||
# define GSUBR_TYPE SCM (*) ()
|
||||
/* Guile 1.x doesn't really support i18n. */
|
||||
# define EVAL_STRING(_s) scm_c_eval_string (_s)
|
||||
#else
|
||||
# define GSUBR_TYPE scm_t_subr
|
||||
# define EVAL_STRING(_s) scm_eval_string (scm_from_utf8_string (_s))
|
||||
#endif
|
||||
|
||||
static SCM make_mod = SCM_EOL;
|
||||
static SCM obj_to_str = SCM_EOL;
|
||||
|
||||
@@ -72,10 +85,10 @@ guile_define_module (void *data UNUSED)
|
||||
#include "gmk-default.h"
|
||||
|
||||
/* Register a subr for GNU make's eval capability. */
|
||||
scm_c_define_gsubr ("gmk-expand", 1, 0, 0, (scm_t_subr) guile_expand_wrapper);
|
||||
scm_c_define_gsubr ("gmk-expand", 1, 0, 0, (GSUBR_TYPE) guile_expand_wrapper);
|
||||
|
||||
/* Register a subr for GNU make's eval capability. */
|
||||
scm_c_define_gsubr ("gmk-eval", 1, 0, 0, (scm_t_subr) guile_eval_wrapper);
|
||||
scm_c_define_gsubr ("gmk-eval", 1, 0, 0, (GSUBR_TYPE) guile_eval_wrapper);
|
||||
|
||||
/* Define the rest of the module. */
|
||||
scm_c_eval_string (GUILE_module_defn);
|
||||
@@ -100,12 +113,12 @@ guile_init (void *arg UNUSED)
|
||||
static void *
|
||||
internal_guile_eval (void *arg)
|
||||
{
|
||||
return cvt_scm_to_str (scm_c_eval_string (arg));
|
||||
return cvt_scm_to_str (EVAL_STRING (arg));
|
||||
}
|
||||
|
||||
/* This is the function registered with make */
|
||||
static char *
|
||||
func_guile (const char *funcname UNUSED, int argc UNUSED, char **argv)
|
||||
func_guile (const char *funcname UNUSED, unsigned int argc UNUSED, char **argv)
|
||||
{
|
||||
static int init = 0;
|
||||
|
||||
@@ -130,7 +143,17 @@ int
|
||||
guile_gmake_setup (const gmk_floc *flocp UNUSED)
|
||||
{
|
||||
/* Create a make function "guile". */
|
||||
gmk_add_function ("guile", func_guile, 0, 1, 1);
|
||||
gmk_add_function ("guile", func_guile, 0, 1, GMK_FUNC_DEFAULT);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int
|
||||
guile_gmake_setup (const gmk_floc *flocp UNUSED)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
2
hash.c
2
hash.c
@@ -48,7 +48,7 @@ hash_init (struct hash_table *ht, unsigned long size,
|
||||
{
|
||||
fprintf (stderr, _("can't allocate %lu bytes for hash table: memory exhausted"),
|
||||
ht->ht_size * (unsigned long) sizeof (struct token *));
|
||||
exit (1);
|
||||
exit (MAKE_TROUBLE);
|
||||
}
|
||||
|
||||
ht->ht_capacity = ht->ht_size - (ht->ht_size / 16); /* 93.75% loading factor */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Implicit rule searching for GNU Make.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2014 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
|
||||
|
||||
389
job.c
389
job.c
@@ -1,5 +1,5 @@
|
||||
/* Job execution and handling for GNU Make.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2014 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
|
||||
@@ -31,14 +31,14 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#ifdef WINDOWS32
|
||||
#include <windows.h>
|
||||
|
||||
char *default_shell = "sh.exe";
|
||||
const char *default_shell = "sh.exe";
|
||||
int no_default_sh_exe = 1;
|
||||
int batch_mode_shell = 1;
|
||||
HANDLE main_thread;
|
||||
|
||||
#elif defined (_AMIGA)
|
||||
|
||||
char default_shell[] = "";
|
||||
const char *default_shell = "";
|
||||
extern int MyExecute (char **);
|
||||
int batch_mode_shell = 0;
|
||||
|
||||
@@ -48,28 +48,28 @@ int batch_mode_shell = 0;
|
||||
says so. It is without an explicit path so we get a chance
|
||||
to search the $PATH for it (since MSDOS doesn't have standard
|
||||
directories we could trust). */
|
||||
char *default_shell = "command.com";
|
||||
const char *default_shell = "command.com";
|
||||
int batch_mode_shell = 0;
|
||||
|
||||
#elif defined (__EMX__)
|
||||
|
||||
char *default_shell = "/bin/sh";
|
||||
const char *default_shell = "/bin/sh";
|
||||
int batch_mode_shell = 0;
|
||||
|
||||
#elif defined (VMS)
|
||||
|
||||
# include <descrip.h>
|
||||
char default_shell[] = "";
|
||||
const char *default_shell = "";
|
||||
int batch_mode_shell = 0;
|
||||
|
||||
#elif defined (__riscos__)
|
||||
|
||||
char default_shell[] = "";
|
||||
const char *default_shell = "";
|
||||
int batch_mode_shell = 0;
|
||||
|
||||
#else
|
||||
|
||||
char default_shell[] = "/bin/sh";
|
||||
const char *default_shell = "/bin/sh";
|
||||
int batch_mode_shell = 0;
|
||||
|
||||
#endif
|
||||
@@ -359,7 +359,7 @@ create_batch_file (char const *base, int unixy, int *fd)
|
||||
*fd = -1;
|
||||
if (error_string == NULL)
|
||||
error_string = _("Cannot create a temporary file\n");
|
||||
fatal (NILF, error_string);
|
||||
O (fatal, NILF, error_string);
|
||||
|
||||
/* not reached */
|
||||
return NULL;
|
||||
@@ -474,6 +474,7 @@ child_error (struct child *child,
|
||||
const struct file *f = child->file;
|
||||
const gmk_floc *flocp = &f->cmds->fileinfo;
|
||||
const char *nm;
|
||||
size_t l = strlen (f->name);
|
||||
|
||||
if (ignored && silent_flag)
|
||||
return;
|
||||
@@ -498,7 +499,10 @@ child_error (struct child *child,
|
||||
|
||||
OUTPUT_SET (&child->output);
|
||||
|
||||
message (0, _("%s: recipe for target '%s' failed"), nm, f->name);
|
||||
message (0, l + strlen (nm),
|
||||
_("%s: recipe for target '%s' failed"), nm, f->name);
|
||||
|
||||
l += strlen (pre) + strlen (post);
|
||||
|
||||
#ifdef VMS
|
||||
if ((exit_code & 1) != 0)
|
||||
@@ -506,15 +510,23 @@ child_error (struct child *child,
|
||||
OUTPUT_UNSET ();
|
||||
return;
|
||||
}
|
||||
|
||||
error (NILF, _("%s[%s] Error 0x%x%s"), pre, f->name, exit_code, post);
|
||||
/* Check for a Posix compatible VMS style exit code:
|
||||
decode and print the Posix exit code */
|
||||
if ((exit_code & 0x35a000) == 0x35a000)
|
||||
error(NILF, l + INTSTR_LENGTH, _("%s[%s] Error %d%s"), pre, f->name,
|
||||
((exit_code & 0x7f8) >> 3), post);
|
||||
else
|
||||
error(NILF, l + INTSTR_LENGTH, _("%s[%s] Error 0x%x%s"), pre, f->name,
|
||||
exit_code, post);
|
||||
#else
|
||||
if (exit_sig == 0)
|
||||
error (NILF, _("%s[%s] Error %d%s"), pre, f->name, exit_code, post);
|
||||
error (NILF, l + INTSTR_LENGTH,
|
||||
_("%s[%s] Error %d%s"), pre, f->name, exit_code, post);
|
||||
else
|
||||
{
|
||||
const char *s = strsignal (exit_sig);
|
||||
error (NILF, _("%s[%s] %s%s%s"), pre, f->name, s, dump, post);
|
||||
error (NILF, l + strlen (s) + strlen (dump),
|
||||
_("%s[%s] %s%s%s"), pre, f->name, s, dump, post);
|
||||
}
|
||||
#endif /* VMS */
|
||||
|
||||
@@ -606,7 +618,7 @@ reap_children (int block, int err)
|
||||
Only print this message once no matter how many jobs are left. */
|
||||
fflush (stdout);
|
||||
if (!printed)
|
||||
error (NILF, _("*** Waiting for unfinished jobs...."));
|
||||
O (error, NILF, _("*** Waiting for unfinished jobs...."));
|
||||
printed = 1;
|
||||
}
|
||||
|
||||
@@ -975,7 +987,7 @@ reap_children (int block, int err)
|
||||
if (!err && child_failed && !dontcare && !keep_going_flag &&
|
||||
/* fatal_error_signal will die with the right signal. */
|
||||
!handling_fatal_signal)
|
||||
die (2);
|
||||
die (MAKE_FAILURE);
|
||||
|
||||
/* Only block for one child. */
|
||||
block = 0;
|
||||
@@ -992,8 +1004,8 @@ free_child (struct child *child)
|
||||
output_close (&child->output);
|
||||
|
||||
if (!jobserver_tokens)
|
||||
fatal (NILF, "INTERNAL: Freeing child %p (%s) but no tokens left!\n",
|
||||
child, child->file->name);
|
||||
ONS (fatal, NILF, "INTERNAL: Freeing child %p (%s) but no tokens left!\n",
|
||||
child, child->file->name);
|
||||
|
||||
/* If we're using the jobserver and this child is not the only outstanding
|
||||
job, put a token back into the pipe for it. */
|
||||
@@ -1004,8 +1016,9 @@ free_child (struct child *child)
|
||||
if (! release_jobserver_semaphore ())
|
||||
{
|
||||
DWORD err = GetLastError ();
|
||||
fatal (NILF, _("release jobserver semaphore: (Error %ld: %s)"),
|
||||
err, map_windows32_error_to_string (err));
|
||||
const char *estr = map_windows32_error_to_string (err);
|
||||
ONS (fatal, NILF,
|
||||
_("release jobserver semaphore: (Error %ld: %s)"), err, estr);
|
||||
}
|
||||
|
||||
DB (DB_JOBS, (_("Released token for child %p (%s).\n"), child, child->file->name));
|
||||
@@ -1108,10 +1121,20 @@ set_child_handler_action_flags (int set_handler, int set_alarm)
|
||||
/* If we're about to enter the read(), set an alarm to wake up in a
|
||||
second so we can check if the load has dropped and we can start more
|
||||
work. On the way out, turn off the alarm and set SIG_DFL. */
|
||||
alarm (set_handler ? 1 : 0);
|
||||
sa.sa_handler = set_handler ? job_noop : SIG_DFL;
|
||||
sa.sa_flags = 0;
|
||||
sigaction (SIGALRM, &sa, NULL);
|
||||
if (set_handler)
|
||||
{
|
||||
sa.sa_handler = job_noop;
|
||||
sa.sa_flags = 0;
|
||||
sigaction (SIGALRM, &sa, NULL);
|
||||
alarm (1);
|
||||
}
|
||||
else
|
||||
{
|
||||
alarm (0);
|
||||
sa.sa_handler = SIG_DFL;
|
||||
sa.sa_flags = 0;
|
||||
sigaction (SIGALRM, &sa, NULL);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -1137,6 +1160,8 @@ start_job_command (struct child *child)
|
||||
char *argv;
|
||||
#else
|
||||
char **argv;
|
||||
int outfd = FD_STDOUT;
|
||||
int errfd = FD_STDERR;
|
||||
#endif
|
||||
|
||||
/* If we have a completely empty commandset, stop now. */
|
||||
@@ -1194,6 +1219,30 @@ start_job_command (struct child *child)
|
||||
char *end = 0;
|
||||
#ifdef VMS
|
||||
argv = p;
|
||||
/* Although construct_command_argv contains some code for VMS, it was/is
|
||||
not called/used. Please note, for VMS argv is a string (not an array
|
||||
of strings) which contains the complete command line, which for
|
||||
multi-line variables still includes the newlines. So detect newlines
|
||||
and set 'end' (which is used for child->command_ptr) instead of
|
||||
(re-)writing construct_command_argv */
|
||||
if (!one_shell)
|
||||
{
|
||||
char *s = p;
|
||||
int instring = 0;
|
||||
while (*s)
|
||||
{
|
||||
if (*s == '"')
|
||||
instring = !instring;
|
||||
else if (*s == '\\' && !instring && *(s+1) != 0)
|
||||
s++;
|
||||
else if (*s == '\n' && !instring)
|
||||
{
|
||||
end = s;
|
||||
break;
|
||||
}
|
||||
++s;
|
||||
}
|
||||
}
|
||||
#else
|
||||
argv = construct_command_argv (p, &end, child->file,
|
||||
child->file->cmds->lines_flags[child->command_line - 1],
|
||||
@@ -1277,7 +1326,7 @@ start_job_command (struct child *child)
|
||||
/* Print the command if appropriate. */
|
||||
if (just_print_flag || trace_flag
|
||||
|| (!(flags & COMMANDS_SILENT) && !silent_flag))
|
||||
message (0, "%s", p);
|
||||
OS (message, 0, "%s", p);
|
||||
|
||||
/* Tell update_goal_chain that a command has been started on behalf of
|
||||
this target. It is important that this happens here and not in
|
||||
@@ -1426,6 +1475,16 @@ start_job_command (struct child *child)
|
||||
|
||||
parent_environ = environ;
|
||||
|
||||
#ifndef NO_OUTPUT_SYNC
|
||||
/* Divert child output if output_sync in use. */
|
||||
if (child->output.syncout)
|
||||
{
|
||||
if (child->output.out >= 0)
|
||||
outfd = child->output.out;
|
||||
if (child->output.err >= 0)
|
||||
errfd = child->output.err;
|
||||
}
|
||||
#endif
|
||||
# ifdef __EMX__
|
||||
/* If we aren't running a recursive command and we have a jobserver
|
||||
pipe, close it before exec'ing. */
|
||||
@@ -1439,7 +1498,7 @@ start_job_command (struct child *child)
|
||||
|
||||
/* Never use fork()/exec() here! Use spawn() instead in exec_command() */
|
||||
child->pid = child_execute_job (child->good_stdin ? FD_STDIN : bad_stdin,
|
||||
FD_STDOUT, FD_STDERR,
|
||||
outfd, errfd,
|
||||
argv, child->environment);
|
||||
if (child->pid < 0)
|
||||
{
|
||||
@@ -1464,9 +1523,6 @@ start_job_command (struct child *child)
|
||||
environ = parent_environ; /* Restore value child may have clobbered. */
|
||||
if (child->pid == 0)
|
||||
{
|
||||
int outfd = FD_STDOUT;
|
||||
int errfd = FD_STDERR;
|
||||
|
||||
/* We are the child side. */
|
||||
unblock_sigs ();
|
||||
|
||||
@@ -1485,16 +1541,6 @@ start_job_command (struct child *child)
|
||||
if (stack_limit.rlim_cur)
|
||||
setrlimit (RLIMIT_STACK, &stack_limit);
|
||||
#endif
|
||||
|
||||
/* Divert child output if output_sync in use. */
|
||||
if (child->output.syncout)
|
||||
{
|
||||
if (child->output.out >= 0)
|
||||
outfd = child->output.out;
|
||||
if (child->output.err >= 0)
|
||||
errfd = child->output.err;
|
||||
}
|
||||
|
||||
child_execute_job (child->good_stdin ? FD_STDIN : bad_stdin,
|
||||
outfd, errfd, argv, child->environment);
|
||||
}
|
||||
@@ -1593,14 +1639,18 @@ start_job_command (struct child *child)
|
||||
sync_Path_environment ();
|
||||
|
||||
#ifndef NO_OUTPUT_SYNC
|
||||
/* Divert child output if output_sync in use. Don't capture
|
||||
recursive make output unless we are synchronizing "make" mode. */
|
||||
if (child->output.syncout)
|
||||
hPID = process_easy (argv, child->environment,
|
||||
child->output.out, child->output.err);
|
||||
else
|
||||
/* Divert child output if output_sync in use. */
|
||||
if (child->output.syncout)
|
||||
{
|
||||
if (child->output.out >= 0)
|
||||
outfd = child->output.out;
|
||||
if (child->output.err >= 0)
|
||||
errfd = child->output.err;
|
||||
}
|
||||
#else
|
||||
outfd = errfd = -1;
|
||||
#endif
|
||||
hPID = process_easy (argv, child->environment, -1, -1);
|
||||
hPID = process_easy (argv, child->environment, outfd, errfd);
|
||||
|
||||
if (hPID != INVALID_HANDLE_VALUE)
|
||||
child->pid = (pid_t) hPID;
|
||||
@@ -1940,7 +1990,7 @@ new_job (struct file *file)
|
||||
/* There must be at least one child already, or we have no business
|
||||
waiting for a token. */
|
||||
if (!children)
|
||||
fatal (NILF, "INTERNAL: no children as we go to sleep on read\n");
|
||||
O (fatal, NILF, "INTERNAL: no children as we go to sleep on read\n");
|
||||
|
||||
#ifdef WINDOWS32
|
||||
/* On Windows we simply wait for the jobserver semaphore to become
|
||||
@@ -1950,8 +2000,10 @@ new_job (struct file *file)
|
||||
if (got_token < 0)
|
||||
{
|
||||
DWORD err = GetLastError ();
|
||||
fatal (NILF, _("semaphore or child process wait: (Error %ld: %s)"),
|
||||
err, map_windows32_error_to_string (err));
|
||||
const char *estr = map_windows32_error_to_string (err);
|
||||
ONS (fatal, NILF,
|
||||
_("semaphore or child process wait: (Error %ld: %s)"),
|
||||
err, estr);
|
||||
}
|
||||
#else
|
||||
/* Set interruptible system calls, and read() for a job token. */
|
||||
@@ -2000,10 +2052,11 @@ new_job (struct file *file)
|
||||
}
|
||||
|
||||
if (newer[0] == '\0')
|
||||
message (0, _("%s: target '%s' does not exist"), nm, c->file->name);
|
||||
OSS (message, 0,
|
||||
_("%s: target '%s' does not exist"), nm, c->file->name);
|
||||
else
|
||||
message (0, _("%s: update target '%s' due to: %s"), nm,
|
||||
c->file->name, newer);
|
||||
OSSS (message, 0,
|
||||
_("%s: update target '%s' due to: %s"), nm, c->file->name, newer);
|
||||
|
||||
free (newer);
|
||||
}
|
||||
@@ -2114,8 +2167,8 @@ load_too_high (void)
|
||||
{
|
||||
if (errno == 0)
|
||||
/* An errno value of zero means getloadavg is just unsupported. */
|
||||
error (NILF,
|
||||
_("cannot enforce load limits on this operating system"));
|
||||
O (error, NILF,
|
||||
_("cannot enforce load limits on this operating system"));
|
||||
else
|
||||
perror_with_name (_("cannot enforce load limit: "), "getloadavg");
|
||||
}
|
||||
@@ -2196,7 +2249,7 @@ child_execute_job (int stdin_fd, int stdout_fd, int stderr_fd,
|
||||
{
|
||||
save_stdin = dup (FD_STDIN);
|
||||
if (save_stdin < 0)
|
||||
fatal (NILF, _("no more file handles: could not duplicate stdin\n"));
|
||||
O (fatal, NILF, _("no more file handles: could not duplicate stdin\n"));
|
||||
CLOSE_ON_EXEC (save_stdin);
|
||||
|
||||
dup2 (stdin_fd, FD_STDIN);
|
||||
@@ -2207,7 +2260,8 @@ child_execute_job (int stdin_fd, int stdout_fd, int stderr_fd,
|
||||
{
|
||||
save_stdout = dup (FD_STDOUT);
|
||||
if (save_stdout < 0)
|
||||
fatal (NILF, _("no more file handles: could not duplicate stdout\n"));
|
||||
O (fatal, NILF,
|
||||
_("no more file handles: could not duplicate stdout\n"));
|
||||
CLOSE_ON_EXEC (save_stdout);
|
||||
|
||||
dup2 (stdout_fd, FD_STDOUT);
|
||||
@@ -2220,7 +2274,8 @@ child_execute_job (int stdin_fd, int stdout_fd, int stderr_fd,
|
||||
{
|
||||
save_stderr = dup (FD_STDERR);
|
||||
if (save_stderr < 0)
|
||||
fatal (NILF, _("no more file handles: could not duplicate stderr\n"));
|
||||
O (fatal, NILF,
|
||||
_("no more file handles: could not duplicate stderr\n"));
|
||||
CLOSE_ON_EXEC (save_stderr);
|
||||
}
|
||||
|
||||
@@ -2234,24 +2289,24 @@ child_execute_job (int stdin_fd, int stdout_fd, int stderr_fd,
|
||||
/* Restore stdout/stdin/stderr of the parent and close temporary FDs. */
|
||||
if (save_stdin >= 0)
|
||||
{
|
||||
if (dup2 (save_stdin, FD_STDIN) != 0)
|
||||
fatal (NILF, _("Could not restore stdin\n"));
|
||||
if (dup2 (save_stdin, FD_STDIN) != FD_STDIN)
|
||||
O (fatal, NILF, _("Could not restore stdin\n"));
|
||||
else
|
||||
close (save_stdin);
|
||||
}
|
||||
|
||||
if (save_stdout >= 0)
|
||||
{
|
||||
if (dup2 (save_stdout, FD_STDOUT) != 0)
|
||||
fatal (NILF, _("Could not restore stdout\n"));
|
||||
if (dup2 (save_stdout, FD_STDOUT) != FD_STDOUT)
|
||||
O (fatal, NILF, _("Could not restore stdout\n"));
|
||||
else
|
||||
close (save_stdout);
|
||||
}
|
||||
|
||||
if (save_stderr >= 0)
|
||||
{
|
||||
if (dup2 (save_stderr, FD_STDERR) != 0)
|
||||
fatal (NILF, _("Could not restore stderr\n"));
|
||||
if (dup2 (save_stderr, FD_STDERR) != FD_STDERR)
|
||||
O (fatal, NILF, _("Could not restore stderr\n"));
|
||||
else
|
||||
close (save_stderr);
|
||||
}
|
||||
@@ -2400,13 +2455,13 @@ exec_command (char **argv, char **envp)
|
||||
switch (errno)
|
||||
{
|
||||
case ENOENT:
|
||||
error (NILF, _("%s: Command not found"), argv[0]);
|
||||
OS (error, NILF, _("%s: Command not found"), argv[0]);
|
||||
break;
|
||||
case ENOEXEC:
|
||||
{
|
||||
/* The file is not executable. Try it as a shell script. */
|
||||
extern char *getenv ();
|
||||
char *shell;
|
||||
const char *shell;
|
||||
char **new_argv;
|
||||
int argc;
|
||||
int i=1;
|
||||
@@ -2434,7 +2489,7 @@ exec_command (char **argv, char **envp)
|
||||
# endif
|
||||
|
||||
new_argv = alloca ((1 + argc + 1) * sizeof (char *));
|
||||
new_argv[0] = shell;
|
||||
new_argv[0] = (char *)shell;
|
||||
|
||||
# ifdef __EMX__
|
||||
if (!unixy_shell)
|
||||
@@ -2460,7 +2515,7 @@ exec_command (char **argv, char **envp)
|
||||
execvp (shell, new_argv);
|
||||
# endif
|
||||
if (errno == ENOENT)
|
||||
error (NILF, _("%s: Shell program not found"), shell);
|
||||
OS (error, NILF, _("%s: Shell program not found"), shell);
|
||||
else
|
||||
perror_with_name ("execvp: ", shell);
|
||||
break;
|
||||
@@ -2469,7 +2524,7 @@ exec_command (char **argv, char **envp)
|
||||
# ifdef __EMX__
|
||||
case EINVAL:
|
||||
/* this nasty error was driving me nuts :-( */
|
||||
error (NILF, _("spawnvpe: environment space might be exhausted"));
|
||||
O (error, NILF, _("spawnvpe: environment space might be exhausted"));
|
||||
/* FALLTHROUGH */
|
||||
# endif
|
||||
|
||||
@@ -2487,7 +2542,8 @@ exec_command (char **argv, char **envp)
|
||||
#endif /* !VMS */
|
||||
}
|
||||
#else /* On Amiga */
|
||||
void exec_command (char **argv)
|
||||
void
|
||||
exec_command (char **argv)
|
||||
{
|
||||
MyExecute (argv);
|
||||
}
|
||||
@@ -2504,7 +2560,7 @@ void clean_tmp (void)
|
||||
avoid using a shell. This routine handles only ' quoting, and " quoting
|
||||
when no backslash, $ or ' characters are seen in the quotes. Starting
|
||||
quotes may be escaped with a backslash. If any of the characters in
|
||||
sh_chars[] is seen, or any of the builtin commands listed in sh_cmds[]
|
||||
sh_chars is seen, or any of the builtin commands listed in sh_cmds
|
||||
is the first word of a line, the shell is used.
|
||||
|
||||
If RESTP is not NULL, *RESTP is set to point to the first newline in LINE.
|
||||
@@ -2519,9 +2575,9 @@ void clean_tmp (void)
|
||||
is overridden. */
|
||||
|
||||
static char **
|
||||
construct_command_argv_internal (char *line, char **restp, char *shell,
|
||||
char *shellflags, char *ifs, int flags,
|
||||
char **batch_filename UNUSED)
|
||||
construct_command_argv_internal (char *line, char **restp, const char *shell,
|
||||
const char *shellflags, const char *ifs,
|
||||
int flags, char **batch_filename UNUSED)
|
||||
{
|
||||
#ifdef __MSDOS__
|
||||
/* MSDOS supports both the stock DOS shell and ports of Unixy shells.
|
||||
@@ -2546,61 +2602,58 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
|
||||
DOS_CHARS also include characters special to 4DOS/NDOS, so we
|
||||
won't have to tell one from another and have one more set of
|
||||
commands and special characters. */
|
||||
static char sh_chars_dos[] = "*?[];|<>%^&()";
|
||||
static char *sh_cmds_dos[] = { "break", "call", "cd", "chcp", "chdir", "cls",
|
||||
"copy", "ctty", "date", "del", "dir", "echo",
|
||||
"erase", "exit", "for", "goto", "if", "md",
|
||||
"mkdir", "path", "pause", "prompt", "rd",
|
||||
"rmdir", "rem", "ren", "rename", "set",
|
||||
"shift", "time", "type", "ver", "verify",
|
||||
"vol", ":", 0 };
|
||||
static const char *sh_chars_dos = "*?[];|<>%^&()";
|
||||
static const char *sh_cmds_dos[] =
|
||||
{ "break", "call", "cd", "chcp", "chdir", "cls", "copy", "ctty", "date",
|
||||
"del", "dir", "echo", "erase", "exit", "for", "goto", "if", "md",
|
||||
"mkdir", "path", "pause", "prompt", "rd", "rmdir", "rem", "ren",
|
||||
"rename", "set", "shift", "time", "type", "ver", "verify", "vol", ":",
|
||||
0 };
|
||||
|
||||
static char sh_chars_sh[] = "#;\"*?[]&|<>(){}$`^";
|
||||
static char *sh_cmds_sh[] = { "cd", "echo", "eval", "exec", "exit", "login",
|
||||
"logout", "set", "umask", "wait", "while",
|
||||
"for", "case", "if", ":", ".", "break",
|
||||
"continue", "export", "read", "readonly",
|
||||
"shift", "times", "trap", "switch", "unset",
|
||||
"ulimit", 0 };
|
||||
static const char *sh_chars_sh = "#;\"*?[]&|<>(){}$`^";
|
||||
static const char *sh_cmds_sh[] =
|
||||
{ "cd", "echo", "eval", "exec", "exit", "login", "logout", "set", "umask",
|
||||
"wait", "while", "for", "case", "if", ":", ".", "break", "continue",
|
||||
"export", "read", "readonly", "shift", "times", "trap", "switch",
|
||||
"unset", "ulimit", 0 };
|
||||
|
||||
const char *sh_chars;
|
||||
const char **sh_cmds;
|
||||
|
||||
char *sh_chars;
|
||||
char **sh_cmds;
|
||||
#elif defined (__EMX__)
|
||||
static char sh_chars_dos[] = "*?[];|<>%^&()";
|
||||
static char *sh_cmds_dos[] = { "break", "call", "cd", "chcp", "chdir", "cls",
|
||||
"copy", "ctty", "date", "del", "dir", "echo",
|
||||
"erase", "exit", "for", "goto", "if", "md",
|
||||
"mkdir", "path", "pause", "prompt", "rd",
|
||||
"rmdir", "rem", "ren", "rename", "set",
|
||||
"shift", "time", "type", "ver", "verify",
|
||||
"vol", ":", 0 };
|
||||
static const char *sh_chars_dos = "*?[];|<>%^&()";
|
||||
static const char *sh_cmds_dos[] =
|
||||
{ "break", "call", "cd", "chcp", "chdir", "cls", "copy", "ctty", "date",
|
||||
"del", "dir", "echo", "erase", "exit", "for", "goto", "if", "md",
|
||||
"mkdir", "path", "pause", "prompt", "rd", "rmdir", "rem", "ren",
|
||||
"rename", "set", "shift", "time", "type", "ver", "verify", "vol", ":",
|
||||
0 };
|
||||
|
||||
static char sh_chars_os2[] = "*?[];|<>%^()\"'&";
|
||||
static char *sh_cmds_os2[] = { "call", "cd", "chcp", "chdir", "cls", "copy",
|
||||
"date", "del", "detach", "dir", "echo",
|
||||
"endlocal", "erase", "exit", "for", "goto", "if",
|
||||
"keys", "md", "mkdir", "move", "path", "pause",
|
||||
"prompt", "rd", "rem", "ren", "rename", "rmdir",
|
||||
"set", "setlocal", "shift", "start", "time",
|
||||
"type", "ver", "verify", "vol", ":", 0 };
|
||||
static const char *sh_chars_os2 = "*?[];|<>%^()\"'&";
|
||||
static const char *sh_cmds_os2[] =
|
||||
{ "call", "cd", "chcp", "chdir", "cls", "copy", "date", "del", "detach",
|
||||
"dir", "echo", "endlocal", "erase", "exit", "for", "goto", "if", "keys",
|
||||
"md", "mkdir", "move", "path", "pause", "prompt", "rd", "rem", "ren",
|
||||
"rename", "rmdir", "set", "setlocal", "shift", "start", "time", "type",
|
||||
"ver", "verify", "vol", ":", 0 };
|
||||
|
||||
static char sh_chars_sh[] = "#;\"*?[]&|<>(){}$`^~'";
|
||||
static char *sh_cmds_sh[] = { "echo", "cd", "eval", "exec", "exit", "login",
|
||||
"logout", "set", "umask", "wait", "while",
|
||||
"for", "case", "if", ":", ".", "break",
|
||||
"continue", "export", "read", "readonly",
|
||||
"shift", "times", "trap", "switch", "unset",
|
||||
0 };
|
||||
char *sh_chars;
|
||||
char **sh_cmds;
|
||||
static const char *sh_chars_sh = "#;\"*?[]&|<>(){}$`^~'";
|
||||
static const char *sh_cmds_sh[] =
|
||||
{ "echo", "cd", "eval", "exec", "exit", "login", "logout", "set", "umask",
|
||||
"wait", "while", "for", "case", "if", ":", ".", "break", "continue",
|
||||
"export", "read", "readonly", "shift", "times", "trap", "switch",
|
||||
"unset", 0 };
|
||||
|
||||
const char *sh_chars;
|
||||
const char **sh_cmds;
|
||||
|
||||
#elif defined (_AMIGA)
|
||||
static char sh_chars[] = "#;\"|<>()?*$`";
|
||||
static char *sh_cmds[] = { "cd", "eval", "if", "delete", "echo", "copy",
|
||||
"rename", "set", "setenv", "date", "makedir",
|
||||
"skip", "else", "endif", "path", "prompt",
|
||||
"unset", "unsetenv", "version",
|
||||
0 };
|
||||
static const char *sh_chars = "#;\"|<>()?*$`";
|
||||
static const char *sh_cmds[] =
|
||||
{ "cd", "eval", "if", "delete", "echo", "copy", "rename", "set", "setenv",
|
||||
"date", "makedir", "skip", "else", "endif", "path", "prompt", "unset",
|
||||
"unsetenv", "version", 0 };
|
||||
|
||||
#elif defined (WINDOWS32)
|
||||
/* We used to have a double quote (") in sh_chars_dos[] below, but
|
||||
that caused any command line with quoted file names be run
|
||||
@@ -2609,49 +2662,54 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
|
||||
can handle quoted file names just fine, removing the quote lifts
|
||||
the limit from a very frequent use case, because using quoted
|
||||
file names is commonplace on MS-Windows. */
|
||||
static char sh_chars_dos[] = "|&<>";
|
||||
static char *sh_cmds_dos[] = { "assoc", "break", "call", "cd", "chcp",
|
||||
"chdir", "cls", "color", "copy", "ctty",
|
||||
"date", "del", "dir", "echo", "echo.",
|
||||
"endlocal", "erase", "exit", "for", "ftype",
|
||||
"goto", "if", "if", "md", "mkdir", "move",
|
||||
"path", "pause", "prompt", "rd", "rem", "ren",
|
||||
"rename", "rmdir", "set", "setlocal",
|
||||
"shift", "time", "title", "type", "ver",
|
||||
"verify", "vol", ":", 0 };
|
||||
static char sh_chars_sh[] = "#;\"*?[]&|<>(){}$`^";
|
||||
static char *sh_cmds_sh[] = { "cd", "eval", "exec", "exit", "login",
|
||||
"logout", "set", "umask", "wait", "while", "for",
|
||||
"case", "if", ":", ".", "break", "continue",
|
||||
"export", "read", "readonly", "shift", "times",
|
||||
"trap", "switch", "test",
|
||||
static const char *sh_chars_dos = "|&<>";
|
||||
static const char *sh_cmds_dos[] =
|
||||
{ "assoc", "break", "call", "cd", "chcp", "chdir", "cls", "color", "copy",
|
||||
"ctty", "date", "del", "dir", "echo", "echo.", "endlocal", "erase",
|
||||
"exit", "for", "ftype", "goto", "if", "if", "md", "mkdir", "move",
|
||||
"path", "pause", "prompt", "rd", "rem", "ren", "rename", "rmdir",
|
||||
"set", "setlocal", "shift", "time", "title", "type", "ver", "verify",
|
||||
"vol", ":", 0 };
|
||||
|
||||
static const char *sh_chars_sh = "#;\"*?[]&|<>(){}$`^";
|
||||
static const char *sh_cmds_sh[] =
|
||||
{ "cd", "eval", "exec", "exit", "login", "logout", "set", "umask", "wait",
|
||||
"while", "for", "case", "if", ":", ".", "break", "continue", "export",
|
||||
"read", "readonly", "shift", "times", "trap", "switch", "test",
|
||||
#ifdef BATCH_MODE_ONLY_SHELL
|
||||
"echo",
|
||||
"echo",
|
||||
#endif
|
||||
0 };
|
||||
char* sh_chars;
|
||||
char** sh_cmds;
|
||||
0 };
|
||||
|
||||
const char *sh_chars;
|
||||
const char **sh_cmds;
|
||||
#elif defined(__riscos__)
|
||||
static char sh_chars[] = "";
|
||||
static char *sh_cmds[] = { 0 };
|
||||
static const char *sh_chars = "";
|
||||
static const char *sh_cmds[] = { 0 };
|
||||
#else /* must be UNIX-ish */
|
||||
static char sh_chars[] = "#;\"*?[]&|<>(){}$`^~!";
|
||||
static char *sh_cmds[] = { ".", ":", "break", "case", "cd", "continue",
|
||||
"eval", "exec", "exit", "export", "for", "if",
|
||||
"login", "logout", "read", "readonly", "set",
|
||||
"shift", "switch", "test", "times", "trap",
|
||||
"ulimit", "umask", "unset", "wait", "while", 0 };
|
||||
static const char *sh_chars = "#;\"*?[]&|<>(){}$`^~!";
|
||||
static const char *sh_cmds[] =
|
||||
{ ".", ":", "break", "case", "cd", "continue", "eval", "exec", "exit",
|
||||
"export", "for", "if", "login", "logout", "read", "readonly", "set",
|
||||
"shift", "switch", "test", "times", "trap", "ulimit", "umask", "unset",
|
||||
"wait", "while", 0 };
|
||||
|
||||
# ifdef HAVE_DOS_PATHS
|
||||
/* This is required if the MSYS/Cygwin ports (which do not define
|
||||
WINDOWS32) are compiled with HAVE_DOS_PATHS defined, which uses
|
||||
sh_chars_sh[] directly (see below). */
|
||||
static char *sh_chars_sh = sh_chars;
|
||||
sh_chars_sh directly (see below). The value must be identical
|
||||
to that of sh_chars immediately above. */
|
||||
static const char *sh_chars_sh = "#;\"*?[]&|<>(){}$`^~!";
|
||||
# endif /* HAVE_DOS_PATHS */
|
||||
#endif
|
||||
int i;
|
||||
char *p;
|
||||
char *ap;
|
||||
#ifndef NDEBUG
|
||||
char *end;
|
||||
#endif
|
||||
char *ap;
|
||||
const char *cap;
|
||||
const char *cp;
|
||||
int instring, word_has_equals, seen_nonequals, last_argument_was_empty;
|
||||
char **new_argv = 0;
|
||||
char *argstr = 0;
|
||||
@@ -2693,10 +2751,8 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
|
||||
|
||||
slow_flag = strcmp ((s1 ? s1 : ""), (s2 ? s2 : ""));
|
||||
|
||||
if (s1)
|
||||
free (s1);
|
||||
if (s2)
|
||||
free (s2);
|
||||
free (s1);
|
||||
free (s2);
|
||||
}
|
||||
if (slow_flag)
|
||||
goto slow;
|
||||
@@ -2736,12 +2792,12 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
|
||||
#endif /* !__MSDOS__ && !__EMX__ */
|
||||
#endif /* not WINDOWS32 */
|
||||
|
||||
if (ifs != 0)
|
||||
for (ap = ifs; *ap != '\0'; ++ap)
|
||||
if (*ap != ' ' && *ap != '\t' && *ap != '\n')
|
||||
if (ifs)
|
||||
for (cap = ifs; *cap != '\0'; ++cap)
|
||||
if (*cap != ' ' && *cap != '\t' && *cap != '\n')
|
||||
goto slow;
|
||||
|
||||
if (shellflags != 0)
|
||||
if (shellflags)
|
||||
if (shellflags[0] != '-'
|
||||
|| ((shellflags[1] != 'c' || shellflags[2] != '\0')
|
||||
&& (shellflags[1] != 'e' || shellflags[2] != 'c' || shellflags[3] != '\0')))
|
||||
@@ -2754,7 +2810,9 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
|
||||
|
||||
/* All the args can fit in a buffer as big as LINE is. */
|
||||
ap = new_argv[0] = argstr = xmalloc (i);
|
||||
#ifndef NDEBUG
|
||||
end = ap + i;
|
||||
#endif
|
||||
|
||||
/* I is how many complete arguments have been found. */
|
||||
i = 0;
|
||||
@@ -3229,11 +3287,11 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
|
||||
we don't escape them, construct_command_argv_internal will
|
||||
recursively call itself ad nauseam, or until stack overflow,
|
||||
whichever happens first. */
|
||||
for (p = shell; *p != '\0'; ++p)
|
||||
for (cp = shell; *cp != '\0'; ++cp)
|
||||
{
|
||||
if (strchr (sh_chars, *p) != 0)
|
||||
if (strchr (sh_chars, *cp) != 0)
|
||||
*(ap++) = '\\';
|
||||
*(ap++) = *p;
|
||||
*(ap++) = *cp;
|
||||
}
|
||||
*(ap++) = ' ';
|
||||
if (shellflags)
|
||||
@@ -3441,7 +3499,8 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
|
||||
}
|
||||
#else
|
||||
else
|
||||
fatal (NILF, _("%s (line %d) Bad shell context (!unixy && !batch_mode_shell)\n"),
|
||||
fatal (NILF, CSTRLEN (__FILE__) + INTSTR_LENGTH,
|
||||
_("%s (line %d) Bad shell context (!unixy && !batch_mode_shell)\n"),
|
||||
__FILE__, __LINE__);
|
||||
#endif
|
||||
|
||||
@@ -3457,7 +3516,7 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
|
||||
avoid using a shell. This routine handles only ' quoting, and " quoting
|
||||
when no backslash, $ or ' characters are seen in the quotes. Starting
|
||||
quotes may be escaped with a backslash. If any of the characters in
|
||||
sh_chars[] is seen, or any of the builtin commands listed in sh_cmds[]
|
||||
sh_chars is seen, or any of the builtin commands listed in sh_cmds
|
||||
is the first word of a line, the shell is used.
|
||||
|
||||
If RESTP is not NULL, *RESTP is set to point to the first newline in LINE.
|
||||
|
||||
10
job.h
10
job.h
@@ -1,5 +1,5 @@
|
||||
/* Definitions for managing subprocesses in GNU Make.
|
||||
Copyright (C) 1992-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992-2014 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
|
||||
@@ -39,8 +39,8 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifdef NO_OUTPUT_SYNC
|
||||
# define RECORD_SYNC_MUTEX(m) \
|
||||
error (NILF, \
|
||||
_("-O[TYPE] (--output-sync[=TYPE]) is not configured for this build."));
|
||||
O (error, NILF, \
|
||||
_("-O[TYPE] (--output-sync[=TYPE]) is not configured for this build."));
|
||||
#else
|
||||
# ifdef WINDOWS32
|
||||
/* For emulations in w32/compat/posixfcn.c. */
|
||||
@@ -80,7 +80,7 @@ typedef int sync_handle_t; /* file descriptor */
|
||||
# define RECORD_SYNC_MUTEX(m) (void)(m)
|
||||
|
||||
# endif
|
||||
#endif /* !OUTPUT_SYNC */
|
||||
#endif /* !NO_OUTPUT_SYNC */
|
||||
|
||||
/* Structure describing a running or dead child process. */
|
||||
|
||||
@@ -128,7 +128,7 @@ int child_execute_job (char *argv, struct child *child);
|
||||
# define FD_STDERR (fileno (stderr))
|
||||
# if defined(__EMX__)
|
||||
int child_execute_job (int stdin_fd, int stdout_fd, int stderr_fd,
|
||||
char **argv, char **envp)
|
||||
char **argv, char **envp);
|
||||
# else
|
||||
void child_execute_job (int stdin_fd, int stdout_fd, int stderr_fd,
|
||||
char **argv, char **envp) __attribute__ ((noreturn));
|
||||
|
||||
37
load.c
37
load.c
@@ -1,5 +1,5 @@
|
||||
/* Loading dynamic objects for GNU Make.
|
||||
Copyright (C) 2012-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2012-2014 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
|
||||
@@ -30,6 +30,11 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#include "filedef.h"
|
||||
#include "variable.h"
|
||||
|
||||
/* Tru64 V4.0 does not have this flag */
|
||||
#ifndef RTLD_GLOBAL
|
||||
# define RTLD_GLOBAL 0
|
||||
#endif
|
||||
|
||||
struct load_list
|
||||
{
|
||||
struct load_list *next;
|
||||
@@ -50,7 +55,10 @@ load_object (const gmk_floc *flocp, int noerror,
|
||||
{
|
||||
global_dl = dlopen (NULL, RTLD_NOW|RTLD_GLOBAL);
|
||||
if (! global_dl)
|
||||
fatal (flocp, _("Failed to open global symbol table: %s"), dlerror ());
|
||||
{
|
||||
const char *err = dlerror ();
|
||||
OS (fatal, flocp, _("Failed to open global symbol table: %s"), err);
|
||||
}
|
||||
}
|
||||
|
||||
symp = (load_func_t) dlsym (global_dl, symname);
|
||||
@@ -74,23 +82,28 @@ load_object (const gmk_floc *flocp, int noerror,
|
||||
/* Still no? Then fail. */
|
||||
if (! dlp)
|
||||
{
|
||||
const char *err = dlerror ();
|
||||
if (noerror)
|
||||
DB (DB_BASIC, ("%s", dlerror ()));
|
||||
DB (DB_BASIC, ("%s", err));
|
||||
else
|
||||
error (flocp, "%s", dlerror ());
|
||||
OS (error, flocp, "%s", err);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Assert that the GPL license symbol is defined. */
|
||||
symp = (load_func_t) dlsym (dlp, "plugin_is_GPL_compatible");
|
||||
if (! symp)
|
||||
fatal (flocp, _("Loaded object %s is not declared to be GPL compatible"),
|
||||
ldname);
|
||||
OS (fatal, flocp,
|
||||
_("Loaded object %s is not declared to be GPL compatible"),
|
||||
ldname);
|
||||
|
||||
symp = (load_func_t) dlsym (dlp, symname);
|
||||
if (! symp)
|
||||
fatal (flocp, _("Failed to load symbol %s from %s: %s"),
|
||||
symname, ldname, dlerror ());
|
||||
{
|
||||
const char *err = dlerror ();
|
||||
OSSS (fatal, flocp, _("Failed to load symbol %s from %s: %s"),
|
||||
symname, ldname, err);
|
||||
}
|
||||
|
||||
/* Add this symbol to a trivial lookup table. This is not efficient but
|
||||
it's highly unlikely we'll be loading lots of objects, and we only
|
||||
@@ -133,12 +146,13 @@ load_file (const gmk_floc *flocp, const char **ldname, int noerror)
|
||||
|
||||
++fp;
|
||||
if (fp == ep)
|
||||
fatal (flocp, _("Empty symbol name for load: %s"), *ldname);
|
||||
OS (fatal, flocp, _("Empty symbol name for load: %s"), *ldname);
|
||||
|
||||
/* Make a copy of the ldname part. */
|
||||
memcpy (new, *ldname, l);
|
||||
new[l] = '\0';
|
||||
*ldname = new;
|
||||
nmlen = l;
|
||||
|
||||
/* Make a copy of the symbol name part. */
|
||||
symname = new + l + 1;
|
||||
@@ -226,7 +240,8 @@ int
|
||||
load_file (const gmk_floc *flocp, const char **ldname, int noerror)
|
||||
{
|
||||
if (! noerror)
|
||||
fatal (flocp, _("The 'load' operation is not supported on this platform."));
|
||||
O (fatal, flocp,
|
||||
_("The 'load' operation is not supported on this platform."));
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -234,7 +249,7 @@ load_file (const gmk_floc *flocp, const char **ldname, int noerror)
|
||||
void
|
||||
unload_file (const char *name)
|
||||
{
|
||||
fatal (NILF, "INTERNAL: Cannot unload when load is not supported!");
|
||||
O (fatal, NILF, "INTERNAL: Cannot unload when load is not supported!");
|
||||
}
|
||||
|
||||
#endif /* MAKE_LOAD */
|
||||
|
||||
20
loadapi.c
20
loadapi.c
@@ -1,5 +1,5 @@
|
||||
/* API for GNU Make dynamic objects.
|
||||
Copyright (C) 2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2013-2014 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
|
||||
@@ -39,9 +39,18 @@ gmk_free (char *s)
|
||||
void
|
||||
gmk_eval (const char *buffer, const gmk_floc *floc)
|
||||
{
|
||||
char *s = xstrdup (buffer);
|
||||
/* Preserve existing variable buffer context. */
|
||||
char *pbuf;
|
||||
unsigned int plen;
|
||||
char *s;
|
||||
|
||||
install_variable_buffer (&pbuf, &plen);
|
||||
|
||||
s = xstrdup (buffer);
|
||||
eval_buffer (s, floc);
|
||||
free (s);
|
||||
|
||||
restore_variable_buffer (pbuf, plen);
|
||||
}
|
||||
|
||||
/* Expand a string and return an allocated buffer.
|
||||
@@ -54,9 +63,8 @@ gmk_expand (const char *ref)
|
||||
|
||||
/* Register a function to be called from makefiles. */
|
||||
void
|
||||
gmk_add_function (const char *name,
|
||||
char *(*func)(const char *nm, int argc, char **argv),
|
||||
int min, int max, int expand)
|
||||
gmk_add_function (const char *name, gmk_func_ptr func,
|
||||
unsigned int min, unsigned int max, unsigned int flags)
|
||||
{
|
||||
define_new_function (reading_file, name, min, max, expand, func);
|
||||
define_new_function (reading_file, name, min, max, flags, func);
|
||||
}
|
||||
|
||||
131
maintMakefile
131
maintMakefile
@@ -2,8 +2,25 @@
|
||||
# only if you have the full copy of the GNU make sources from the Git
|
||||
# tree, not a dist copy.
|
||||
|
||||
BUGLIST := bug-make@gnu.org
|
||||
|
||||
# These are related to my personal setup.
|
||||
GPG_FINGERPRINT := 6338B6D4
|
||||
|
||||
# SRCROOTDIR is just a handy location to keep source files in
|
||||
SRCROOTDIR ?= $(HOME)/src
|
||||
|
||||
# Where the gnulib project has been locally cloned
|
||||
GNULIBDIR ?= $(SRCROOTDIR)/gnulib
|
||||
|
||||
# Where to put the CVS checkout of the GNU web repository
|
||||
GNUWEBDIR ?= $(SRCROOTDIR)/gnu-www
|
||||
|
||||
# Where to put the CVS checkout of the GNU make web repository
|
||||
MAKEWEBDIR ?= $(SRCROOTDIR)/make/make-web
|
||||
|
||||
# We like mondo-warnings!
|
||||
AM_CFLAGS += -Wall -Wextra -Wdeclaration-after-statement -Wshadow -Wpointer-arith -Wbad-function-cast
|
||||
AM_CFLAGS += -Wall -Wwrite-strings -Wextra -Wdeclaration-after-statement -Wshadow -Wpointer-arith -Wbad-function-cast
|
||||
|
||||
MAKE_MAINTAINER_MODE := -DMAKE_MAINTAINER_MODE
|
||||
AM_CPPFLAGS += $(MAKE_MAINTAINER_MODE)
|
||||
@@ -97,23 +114,40 @@ git-very-clean: git-clean
|
||||
-$(GIT) clean -fd
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
#
|
||||
# The sections below were stolen from the Makefile.maint used by fileutils,
|
||||
# sh-utils, textutils, CPPI, Bison, and Autoconf.
|
||||
|
||||
## ---------------------- ##
|
||||
## Generating ChangeLog. ##
|
||||
## ---------------------- ##
|
||||
|
||||
gl2cl-date := 2013-10-10
|
||||
gl2cl := $(GNULIBDIR)/build-aux/gitlog-to-changelog
|
||||
|
||||
# Rebuild the changelog whenever a new commit is added
|
||||
ChangeLog: .check-git-HEAD
|
||||
if test -f '$(gl2cl)'; then \
|
||||
'$(gl2cl)' --since='$(gl2cl-date)' > '$@'; \
|
||||
else \
|
||||
echo "WARNING: $(gl2cl) is not available. No $@ generated."; \
|
||||
fi
|
||||
|
||||
.PHONY: .check-git-HEAD
|
||||
.check-git-HEAD:
|
||||
sha="`git rev-parse HEAD`"; \
|
||||
[ -f '$@' ] && [ "`cat '$@' 2>/dev/null`" = "$$sha" ] \
|
||||
|| echo "$$sha" > '$@'
|
||||
|
||||
|
||||
## ---------------- ##
|
||||
## Updating files. ##
|
||||
## ---------------- ##
|
||||
|
||||
WGET = wget --passive-ftp -nv
|
||||
WGET = wget --passive-ftp -np -nv
|
||||
ftp-gnu = ftp://ftp.gnu.org/gnu
|
||||
|
||||
move_if_change = if test -r $(target) && cmp -s $(target).t $(target); then \
|
||||
echo $(target) is unchanged; rm -f $(target).t; \
|
||||
else \
|
||||
mv $(target).t $(target); \
|
||||
mv -f $(target).t $(target); \
|
||||
fi
|
||||
|
||||
# ------------------- #
|
||||
@@ -125,8 +159,7 @@ move_if_change = if test -r $(target) && cmp -s $(target).t $(target); then \
|
||||
# http://translation.sf.net/maint/
|
||||
# ftp://tiger.informatik.hu-berlin.de/pub/po/maint/
|
||||
|
||||
po_wget_flags = --recursive --level=1 --no-directories --no-parent \
|
||||
--no-check-certificate
|
||||
po_wget_flags = --recursive --level=1 --no-directories --no-check-certificate
|
||||
po_repo = http://translationproject.org/latest/$(PACKAGE)
|
||||
.PHONY: do-po-update po-update
|
||||
do-po-update:
|
||||
@@ -135,7 +168,8 @@ do-po-update:
|
||||
&& mkdir "$$tmppo" \
|
||||
&& (cd "$$tmppo" \
|
||||
&& $(WGET) $(po_wget_flags) -A '*.po' $(po_repo)) \
|
||||
&& cp "$$tmppo"/*.po $(top_srcdir)/po && rm -rf "$$tmppo"
|
||||
&& cp "$$tmppo"/*.po $(top_srcdir)/po \
|
||||
&& rm -rf "$$tmppo"
|
||||
cd po && $(MAKE) update-po
|
||||
$(MAKE) po-check
|
||||
|
||||
@@ -196,20 +230,22 @@ check-alt-config: \
|
||||
checkcfg.CPPFLAGS^-DNO_OUTPUT_SYNC \
|
||||
checkcfg.CPPFLAGS^-DNO_ARCHIVES
|
||||
|
||||
NR_MAKE = $(MAKE)
|
||||
|
||||
# Check builds both with build.sh and with make
|
||||
checkcfg.%: distdir
|
||||
@ rm -rf $(distdir)/_build \
|
||||
@( rm -rf $(distdir)/_build \
|
||||
&& mkdir $(distdir)/_build \
|
||||
&& cd $(distdir)/_build \
|
||||
&& echo "Testing configure with $(subst ^,=,$*)" \
|
||||
&& ../configure --srcdir=.. $(subst ^,=,$*) \
|
||||
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
CFLAGS='$(AM_CFLAGS)' \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check
|
||||
|
||||
|
||||
.PHONY: update
|
||||
update: po-update scm-update
|
||||
&& ./build.sh \
|
||||
&& ./make $(AM_MAKEFLAGS) check \
|
||||
&& rm -f *.o make \
|
||||
&& $(NR_MAKE) $(AM_MAKEFLAGS) \
|
||||
&& ./make $(AM_MAKEFLAGS) check ) 2>&1 | tee checkcfg.$*.log
|
||||
|
||||
|
||||
## --------------- ##
|
||||
@@ -219,6 +255,8 @@ update: po-update scm-update
|
||||
# Before we build a distribution be sure we run our local checks
|
||||
#distdir: local-check
|
||||
|
||||
.PHONY: local-check po-check changelog-check
|
||||
|
||||
# Checks that don't require Git. Run 'changelog-check' last as
|
||||
# previous test may reveal problems requiring new ChangeLog entries.
|
||||
local-check: po-check changelog-check
|
||||
@@ -243,6 +281,61 @@ po-check:
|
||||
rm -f $@-1 $@-2; \
|
||||
fi
|
||||
|
||||
|
||||
## --------------- ##
|
||||
## Generate docs. ##
|
||||
## --------------- ##
|
||||
|
||||
.PHONY: update-makeweb gendocs
|
||||
|
||||
CVS = cvs
|
||||
|
||||
makeweb-repo = $(USER)@cvs.sv.gnu.org:/web/make
|
||||
gnuweb-repo = :pserver:anonymous@cvs.sv.gnu.org:/web/www
|
||||
gnuweb-dir = www/server/standards
|
||||
|
||||
# Get the GNU make web page boilerplate etc.
|
||||
update-makeweb:
|
||||
[ -d '$(MAKEWEBDIR)' ] || mkdir -p '$(MAKEWEBDIR)'
|
||||
[ -d '$(MAKEWEBDIR)'/CVS ] \
|
||||
&& { cd '$(MAKEWEBDIR)' && $(CVS) update; } \
|
||||
|| { mkdir -p '$(dir $(MAKEWEBDIR))' && cd '$(dir $(MAKEWEBDIR))' \
|
||||
&& $(CVS) -d $(makeweb-repo) co -d '$(notdir $(MAKEWEBDIR))' make; }
|
||||
|
||||
# Get the GNU web page boilerplate etc.
|
||||
update-gnuweb:
|
||||
[ -d '$(GNUWEBDIR)' ] || mkdir -p '$(GNUWEBDIR)'
|
||||
[ -d '$(GNUWEBDIR)/$(gnuweb-dir)'/CVS ] \
|
||||
&& { cd '$(GNUWEBDIR)/$(gnuweb-dir)' && $(CVS) update; } \
|
||||
|| { cd '$(GNUWEBDIR)' && $(CVS) -d $(gnuweb-repo) co '$(gnuweb-dir)'; }
|
||||
|
||||
gendocs: update-gnuweb update-makeweb
|
||||
cp $(GNULIBDIR)/doc/gendocs_template doc
|
||||
cd doc \
|
||||
&& rm -rf doc/manual \
|
||||
&& $(GNULIBDIR)/build-aux/gendocs.sh --email '$(BUGLIST)' \
|
||||
make 'GNU Make Manual'
|
||||
find '$(MAKEWEBDIR)'/manual \( -name CVS -prune \) -o \( -name '[!.]*' -type f -exec rm -f '{}' \; \)
|
||||
cp -r doc/manual '$(MAKEWEBDIR)'
|
||||
@echo 'Status of $(MAKEWEBDIR) repo:' && cd '$(MAKEWEBDIR)' \
|
||||
&& cvs -q -n update | grep -v '^M ' \
|
||||
&& echo '- cvs add <new files>' \
|
||||
&& echo '- cvs remove <deleted files>' \
|
||||
&& echo '- cvs commit' \
|
||||
&& echo '- cvs tag make-$(subst .,-,$(VERSION))'
|
||||
|
||||
## ------------------------- ##
|
||||
## Make release targets. ##
|
||||
## ------------------------- ##
|
||||
|
||||
.PHONY: tag-release
|
||||
tag-release:
|
||||
case '$(VERSION)' in \
|
||||
(*.*.9*) message=" candidate" ;; \
|
||||
(*) message= ;; \
|
||||
esac; \
|
||||
$(GIT) tag -m "GNU Make release$$message $(VERSION)" -u '$(GPG_FINGERPRINT)' '$(VERSION)'
|
||||
|
||||
## ------------------------- ##
|
||||
## GNU FTP upload artifacts. ##
|
||||
## ------------------------- ##
|
||||
@@ -252,7 +345,7 @@ po-check:
|
||||
# you're SOL! :)
|
||||
|
||||
GPG = gpg
|
||||
GPGFLAGS = -u 6338B6D4
|
||||
GPGFLAGS = -u $(GPG_FINGERPRINT)
|
||||
|
||||
DIST_ARCHIVES_SIG = $(addsuffix .sig,$(DIST_ARCHIVES))
|
||||
DIST_ARCHIVES_DIRECTIVE = $(addsuffix .directive.asc,$(DIST_ARCHIVES))
|
||||
@@ -289,7 +382,7 @@ $(UPLOADS): $(DIST_ARCHIVES) $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
|
||||
$(FTPPUT) "$(gnu-upload-host)" "$(gnu-upload-dir)/$(@:upload-%=%)" $^
|
||||
|
||||
|
||||
# Copyright (C) 1997-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1997-2014 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
|
||||
|
||||
2
make.1
2
make.1
@@ -363,7 +363,7 @@ This manual page contributed by Dennis Morse of Stanford University.
|
||||
Further updates contributed by Mike Frysinger. It has been reworked by Roland
|
||||
McGrath. Maintained by Paul Smith.
|
||||
.SH "COPYRIGHT"
|
||||
Copyright \(co 1992-1993, 1996-2013 Free Software Foundation, Inc.
|
||||
Copyright \(co 1992-1993, 1996-2014 Free Software Foundation, Inc.
|
||||
This file is part of
|
||||
.IR "GNU make" .
|
||||
.LP
|
||||
|
||||
@@ -154,11 +154,11 @@
|
||||
<File
|
||||
RelativePath=".\getopt1.c">
|
||||
</File>
|
||||
<!--
|
||||
|
||||
<File
|
||||
RelativePath=".\guile.c">
|
||||
</File>
|
||||
-->
|
||||
|
||||
<File
|
||||
RelativePath=".\hash.c">
|
||||
</File>
|
||||
@@ -171,6 +171,9 @@
|
||||
<File
|
||||
RelativePath=".\job.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\load.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\output.c">
|
||||
</File>
|
||||
@@ -210,6 +213,9 @@
|
||||
<File
|
||||
RelativePath=".\w32\compat\dirent.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\w32\compat\posixfcn.c">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\w32\subproc\misc.c">
|
||||
<FileConfiguration
|
||||
|
||||
36
makefile.com
36
makefile.com
@@ -1,8 +1,7 @@
|
||||
$!
|
||||
$! 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
|
||||
$! P1 = LIST will provide compiler listings.
|
||||
$! P2 = DEBUG will build an image with debug information
|
||||
$! P3 = WALL will enable all warning messages (some are suppressed since
|
||||
$! one macro intentionally causes an error condition)
|
||||
@@ -50,6 +49,12 @@ $ endif
|
||||
$ endif
|
||||
$ endif
|
||||
$!
|
||||
$!
|
||||
$ if (p1 .eqs. "LIST")
|
||||
$ then
|
||||
$ ccopt = ccopt + "/list/show=(expan,inclu)"
|
||||
$ endif
|
||||
$!
|
||||
$! Should we build a debug image
|
||||
$!
|
||||
$ if (p2.eqs."DEBUG")
|
||||
@@ -67,9 +72,11 @@ $ then
|
||||
$ gosub check_cc_qual
|
||||
$ endif
|
||||
$ filelist = "alloca ar arscan commands default dir expand file function " + -
|
||||
"hash implicit job load main misc read remake remote-stub rule " + -
|
||||
"output signame variable version vmsfunctions vmsify vpath " + -
|
||||
"guile hash implicit job load main misc read remake " + -
|
||||
"remote-stub rule output signame variable version " + -
|
||||
"vmsfunctions vmsify vpath " + -
|
||||
"[.glob]glob [.glob]fnmatch getopt1 getopt strcache"
|
||||
$!
|
||||
$ copy config.h-vms config.h
|
||||
$ n=0
|
||||
$ open/write optf make.opt
|
||||
@@ -77,18 +84,14 @@ $ loop:
|
||||
$ cfile = f$elem(n," ",filelist)
|
||||
$ if cfile .eqs. " " then goto linkit
|
||||
$ write sys$output "Compiling ''cfile'..."
|
||||
$ call compileit 'cfile' 'p1'
|
||||
$ call compileit 'cfile'
|
||||
$ n = n + 1
|
||||
$ goto loop
|
||||
$ linkit:
|
||||
$ close optf
|
||||
$ if p1 .nes. "" then goto link_using_library
|
||||
$ link/exe=make make.opt/opt'lopt
|
||||
$ goto cleanup
|
||||
$
|
||||
$ link_using_library:
|
||||
$ link/exe=make make.opt/opt,sys$library:vaxcrtl/lib'lopt
|
||||
$
|
||||
$ cleanup:
|
||||
$ if f$trnlnm("SYS").nes."" then $ deassign sys
|
||||
$ if f$trnlnm("OPTF").nes."" then $ close optf
|
||||
@@ -128,17 +131,22 @@ $!-----------------------------------------------------------------------------
|
||||
$!
|
||||
$ compileit : subroutine
|
||||
$ 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]) -
|
||||
$ if ploc .lt. f$length(p1)
|
||||
$ then
|
||||
$ objdir = f$extract(0, ploc+1, p1)
|
||||
$ write optf p1
|
||||
$ else
|
||||
$ objdir := []
|
||||
$ write optf objdir+p1
|
||||
$ endif
|
||||
$ cc'ccopt'/include=([],[.glob])/obj='objdir' -
|
||||
/define=("allocated_variable_expand_for_file=alloc_var_expand_for_file","unlink=remove","HAVE_CONFIG_H","VMS") -
|
||||
'p1'
|
||||
$ exit
|
||||
$ endsubroutine : compileit
|
||||
$!
|
||||
$!-----------------------------------------------------------------------------
|
||||
$!Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
$!Copyright (C) 1996-2014 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
|
||||
|
||||
88
makefile.vms
88
makefile.vms
@@ -1,6 +1,6 @@
|
||||
# -*-Makefile-*- to build GNU make on VMS
|
||||
#
|
||||
# Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-2014 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
|
||||
@@ -88,13 +88,13 @@ mandir = []
|
||||
# Number to put on the man page filename.
|
||||
manext = 1
|
||||
|
||||
#guile = ,guile.obj
|
||||
guile = ,guile.obj
|
||||
|
||||
objs = commands.obj,job.obj,output.obj,dir.obj,file.obj,misc.obj,hash.obj,\
|
||||
load.obj,main.obj,read.obj,remake.obj,rule.obj,implicit.obj,\
|
||||
default.obj,variable.obj,expand.obj,function.obj,strcache.obj,\
|
||||
vpath.obj,version.obj\
|
||||
$(ARCHIVES)$(ALLOCA)$(extras)$(getopt)$(glob)$(guile)
|
||||
vpath.obj,version.obj$(guile)\
|
||||
$(ARCHIVES)$(ALLOCA)$(extras)$(getopt)$(glob)
|
||||
|
||||
srcs = commands.c job.c output.c dir.c file.c misc.c guile.c hash.c \
|
||||
load.c main.c read.c remake.c rule.c implicit.c \
|
||||
@@ -118,40 +118,56 @@ clean:
|
||||
-$(RM) make.exe;,*.obj;
|
||||
-$(RM) [.glob]*.obj;
|
||||
|
||||
# Automatically generated dependencies.
|
||||
# makeint.h: config.h gnumake.h gettext.h
|
||||
# filedef.h: hash.h
|
||||
ar.obj: ar.c makeint.h filedef.h dep.h [.glob]fnmatch.h
|
||||
arscan.obj: arscan.c makeint.h
|
||||
commands.obj: commands.c makeint.h dep.h commands.h filedef.h variable.h job.h
|
||||
default.obj: default.c makeint.h rule.h dep.h job.h filedef.h commands.h variable.h
|
||||
dir.obj: dir.c makeint.h hash.h [.glob]glob.h
|
||||
expand.obj: expand.c makeint.h commands.h filedef.h job.h rule.h variable.h
|
||||
file.obj: file.c makeint.h commands.h dep.h filedef.h variable.h job.h debug.h
|
||||
function.obj: function.c makeint.h variable.h dep.h commands.h filedef.h debug.h job.h
|
||||
getopt.obj: getopt.c getopt.h config.h gettext.h
|
||||
getopt1.obj: getopt1.c getopt.h config.h
|
||||
guile.obj: guile.c makeint.h debug.h dep.h gmk-default.h
|
||||
hash.obj: hash.c makeint.h hash.h
|
||||
implicit.obj: implicit.c makeint.h rule.h dep.h filedef.h debug.h variable.h job.h commands.h
|
||||
job.obj: job.c vmsjobs.c makeint.h commands.h job.h filedef.h variable.h debug.h
|
||||
output.obj: output.c vmsjobs.c makeint.h output.h filedef.h debug.h
|
||||
load.obj: load.c makeint.h debug.h filedef.h variable.h
|
||||
main.obj: main.c makeint.h commands.h dep.h filedef.h variable.h job.h rule.h debug.h getopt.h
|
||||
misc.obj: misc.c makeint.h dep.h debug.h
|
||||
read.obj: read.c makeint.h commands.h dep.h filedef.h variable.h [.glob]glob.h debug.h rule.h job.h
|
||||
remake.obj: remake.c makeint.h commands.h job.h dep.h filedef.h variable.h debug.h
|
||||
remote-stub.obj: remote-stub.c makeint.h filedef.h job.h commands.h
|
||||
rule.obj: rule.c makeint.h commands.h dep.h filedef.h variable.h rule.h job.h
|
||||
signame.obj: signame.c makeint.h
|
||||
strcache.obj: strcache.c makeint.h hash.h
|
||||
variable.obj: variable.c makeint.h commands.h variable.h dep.h filedef.h job.h rule.h
|
||||
ar.obj: ar.c makeint.h config.h gnumake.h gettext.h filedef.h hash.h dep.h \
|
||||
[.glob]fnmatch.h
|
||||
arscan.obj: arscan.c makeint.h config.h gnumake.h gettext.h
|
||||
commands.obj: commands.c makeint.h config.h gnumake.h gettext.h filedef.h \
|
||||
hash.h dep.h variable.h job.h output.h commands.h
|
||||
default.obj: default.c makeint.h config.h gnumake.h gettext.h filedef.h \
|
||||
hash.h variable.h rule.h dep.h job.h output.h commands.h
|
||||
dir.obj: dir.c makeint.h config.h gnumake.h gettext.h hash.h filedef.h \
|
||||
dep.h [.glob]glob.h
|
||||
expand.obj: expand.c makeint.h config.h gnumake.h gettext.h filedef.h \
|
||||
hash.h job.h output.h commands.h variable.h rule.h
|
||||
file.obj: file.c makeint.h config.h gnumake.h gettext.h filedef.h hash.h \
|
||||
dep.h job.h output.h commands.h variable.h debug.h
|
||||
[.glob]fnmatch.obj: [.glob]fnmatch.c config.h [.glob]fnmatch.h
|
||||
function.obj: function.c makeint.h config.h gnumake.h gettext.h filedef.h \
|
||||
hash.h variable.h dep.h job.h output.h commands.h debug.h
|
||||
getopt.obj: getopt.c config.h gettext.h getopt.h
|
||||
getopt1.obj: getopt1.c config.h getopt.h
|
||||
[.glob]glob.obj: [.glob]glob.c config.h [.glob]fnmatch.h [.glob]glob.h
|
||||
guile.obj: guile.c makeint.h config.h gnumake.h gettext.h
|
||||
hash.obj: hash.c makeint.h config.h gnumake.h gettext.h hash.h
|
||||
implicit.obj: implicit.c makeint.h config.h gnumake.h gettext.h filedef.h \
|
||||
hash.h rule.h dep.h debug.h variable.h job.h output.h commands.h
|
||||
job.obj: job.c makeint.h config.h gnumake.h gettext.h job.h output.h debug.h \
|
||||
filedef.h hash.h commands.h variable.h debug.h vmsjobs.c
|
||||
load.obj: load.c makeint.h config.h gnumake.h gettext.h
|
||||
main.obj: main.c makeint.h config.h gnumake.h gettext.h filedef.h hash.h \
|
||||
dep.h variable.h job.h output.h commands.h rule.h debug.h getopt.h
|
||||
misc.obj: misc.c makeint.h config.h gnumake.h gettext.h filedef.h hash.h \
|
||||
dep.h debug.h
|
||||
output.obj: output.c makeint.h config.h gnumake.h gettext.h job.h output.h
|
||||
read.obj: read.c makeint.h config.h gnumake.h gettext.h [.glob]glob.h \
|
||||
filedef.h hash.h dep.h job.h output.h commands.h variable.h rule.h \
|
||||
debug.h
|
||||
remake.obj: remake.c makeint.h config.h gnumake.h gettext.h filedef.h \
|
||||
hash.h job.h output.h commands.h dep.h variable.h debug.h
|
||||
remote-stub.obj: remote-stub.c makeint.h config.h gnumake.h gettext.h \
|
||||
filedef.h hash.h job.h output.h commands.h
|
||||
rule.obj: rule.c makeint.h config.h gnumake.h gettext.h filedef.h hash.h \
|
||||
dep.h job.h output.h commands.h variable.h rule.h
|
||||
signame.obj: signame.c makeint.h config.h gnumake.h gettext.h
|
||||
strcache.obj: strcache.c makeint.h config.h gnumake.h gettext.h hash.h
|
||||
variable.obj: variable.c makeint.h config.h gnumake.h gettext.h filedef.h \
|
||||
hash.h dep.h job.h output.h commands.h variable.h rule.h
|
||||
version.obj: version.c config.h
|
||||
vmsfunctions.obj: vmsfunctions.c makeint.h vmsdir.h debug.h job.h
|
||||
vmsfunctions.obj: vmsfunctions.c makeint.h config.h gnumake.h gettext.h \
|
||||
debug.h job.h output.h vmsdir.h
|
||||
vmsify.obj: vmsify.c
|
||||
vpath.obj: vpath.c makeint.h filedef.h variable.h
|
||||
[.glob]fnmatch.obj: [.glob]fnmatch.c [.glob]fnmatch.h config.h
|
||||
[.glob]glob.obj: [.glob]glob.c [.glob]glob.h [.glob]fnmatch.h config.h
|
||||
vpath.obj: vpath.c makeint.h config.h gnumake.h gettext.h filedef.h hash.h \
|
||||
variable.h
|
||||
|
||||
config.h: config.h-vms
|
||||
$(CP) $< $@
|
||||
|
||||
78
makeint.h
78
makeint.h
@@ -1,5 +1,5 @@
|
||||
/* Miscellaneous global declarations and portability cruft for GNU Make.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2014 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
|
||||
@@ -173,9 +173,6 @@ unsigned int get_path_max (void);
|
||||
(! INTEGER_TYPE_SIGNED (t) ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))
|
||||
#define INTEGER_TYPE_MAXIMUM(t) (~ (t) 0 - INTEGER_TYPE_MINIMUM (t))
|
||||
|
||||
/* The maximum number of digits needed to represent the largest integer. */
|
||||
#define INTEGER_LENGTH sizeof("18446744073709551616")
|
||||
|
||||
#ifndef CHAR_MAX
|
||||
# define CHAR_MAX INTEGER_TYPE_MAXIMUM (char)
|
||||
#endif
|
||||
@@ -353,8 +350,8 @@ char *strsignal (int signum);
|
||||
# include <malloc.h>
|
||||
# define pipe(_p) _pipe((_p), 512, O_BINARY)
|
||||
# define kill(_pid,_sig) w32_kill((_pid),(_sig))
|
||||
/* MSVC doesn't have ftruncate. */
|
||||
# ifdef _MSC_VER
|
||||
/* MSVC and Watcom C don't have ftruncate. */
|
||||
# if defined(_MSC_VER) || defined(__WATCOMC__)
|
||||
# define ftruncate(_fd,_len) _chsize(_fd,_len)
|
||||
# endif
|
||||
/* MinGW64 doesn't have _S_ISDIR. */
|
||||
@@ -396,10 +393,12 @@ extern int unixy_shell;
|
||||
#define MAP_DOT 0x0200
|
||||
#define MAP_COMMA 0x0400
|
||||
|
||||
/* These are the valid characters for a user-defined function. */
|
||||
#define MAP_USERFUNC 0x2000
|
||||
/* This means not only a '$', but skip the variable reference. */
|
||||
#define MAP_VARIABLE 0x4000
|
||||
/* The set of characters which are path separators is OS-specific. */
|
||||
#define MAP_PATHSEP 0x8000
|
||||
/* The set of characters which are directory separators is OS-specific. */
|
||||
#define MAP_DIRSEP 0x8000
|
||||
|
||||
#ifdef VMS
|
||||
# define MAP_VMSCOMMA MAP_COMMA
|
||||
@@ -407,7 +406,7 @@ extern int unixy_shell;
|
||||
# define MAP_VMSCOMMA 0x0000
|
||||
#endif
|
||||
|
||||
#define STOP_SET(_v,_m) ANY_SET (stopchar_map[(int)(_v)],(_m))
|
||||
#define STOP_SET(_v,_m) ANY_SET (stopchar_map[(unsigned char)(_v)],(_m))
|
||||
|
||||
#if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT)
|
||||
# define SET_STACK_SIZE
|
||||
@@ -419,17 +418,42 @@ extern struct rlimit stack_limit;
|
||||
|
||||
#define NILF ((gmk_floc *)0)
|
||||
|
||||
#define CSTRLEN(_s) (sizeof (_s)-1)
|
||||
#define CSTRLEN(_s) (sizeof (_s)-1)
|
||||
#define STRING_SIZE_TUPLE(_s) (_s), CSTRLEN(_s)
|
||||
|
||||
/* The number of bytes needed to represent the largest integer as a string. */
|
||||
#define INTSTR_LENGTH CSTRLEN ("18446744073709551616")
|
||||
|
||||
#ifdef HAVE_TTYNAME
|
||||
# define TTYNAME(_f) ttyname (_f)
|
||||
#else
|
||||
# define TTYNAME(_f) "true"
|
||||
#endif
|
||||
|
||||
|
||||
const char *concat (unsigned int, ...);
|
||||
void message (int prefix, const char *fmt, ...)
|
||||
__attribute__ ((__format__ (__printf__, 2, 3)));
|
||||
void error (const gmk_floc *flocp, const char *fmt, ...)
|
||||
__attribute__ ((__format__ (__printf__, 2, 3)));
|
||||
void fatal (const gmk_floc *flocp, const char *fmt, ...)
|
||||
__attribute__ ((noreturn, __format__ (__printf__, 2, 3)));
|
||||
void message (int prefix, size_t length, const char *fmt, ...)
|
||||
__attribute__ ((__format__ (__printf__, 3, 4)));
|
||||
void error (const gmk_floc *flocp, size_t length, const char *fmt, ...)
|
||||
__attribute__ ((__format__ (__printf__, 3, 4)));
|
||||
void fatal (const gmk_floc *flocp, size_t length, const char *fmt, ...)
|
||||
__attribute__ ((noreturn, __format__ (__printf__, 3, 4)));
|
||||
|
||||
#define O(_t,_a,_f) _t((_a), 0, (_f))
|
||||
#define OS(_t,_a,_f,_s) _t((_a), strlen (_s), (_f), (_s))
|
||||
#define OSS(_t,_a,_f,_s1,_s2) _t((_a), strlen (_s1) + strlen (_s2), \
|
||||
(_f), (_s1), (_s2))
|
||||
#define OSSS(_t,_a,_f,_s1,_s2,_s3) _t((_a), strlen (_s1) + strlen (_s2) + strlen (_s3), \
|
||||
(_f), (_s1), (_s2), (_s3))
|
||||
#define ON(_t,_a,_f,_n) _t((_a), INTSTR_LENGTH, (_f), (_n))
|
||||
#define ONN(_t,_a,_f,_n1,_n2) _t((_a), INTSTR_LENGTH*2, (_f), (_n1), (_n2))
|
||||
|
||||
#define OSN(_t,_a,_f,_s,_n) _t((_a), strlen (_s) + INTSTR_LENGTH, \
|
||||
(_f), (_s), (_n))
|
||||
#define ONS(_t,_a,_f,_n,_s) _t((_a), INTSTR_LENGTH + strlen (_s), \
|
||||
(_f), (_n), (_s))
|
||||
|
||||
#define OUT_OF_MEM() O (fatal, NILF, _("virtual memory exhausted"))
|
||||
|
||||
void die (int) __attribute__ ((noreturn));
|
||||
void pfatal_with_name (const char *) __attribute__ ((noreturn));
|
||||
@@ -504,9 +528,7 @@ const char *strcache_add_len (const char *str, unsigned int len);
|
||||
int strcache_setbufsize (unsigned int size);
|
||||
|
||||
/* Guile support */
|
||||
#ifdef HAVE_GUILE
|
||||
int guile_gmake_setup (const gmk_floc *flocp);
|
||||
#endif
|
||||
|
||||
/* Loadable object support. Sets to the strcached name of the loaded file. */
|
||||
typedef int (*load_func_t)(const gmk_floc *flocp);
|
||||
@@ -593,7 +615,17 @@ extern double max_load_average;
|
||||
extern int max_load_average;
|
||||
#endif
|
||||
|
||||
#ifdef WINDOWS32
|
||||
extern char *program;
|
||||
#else
|
||||
extern const char *program;
|
||||
#endif
|
||||
|
||||
#ifdef VMS
|
||||
const char *vms_command(const char *argv0);
|
||||
const char *vms_progname(const char *argv0);
|
||||
#endif
|
||||
|
||||
extern char *starting_directory;
|
||||
extern unsigned int makelevel;
|
||||
extern char *version_string, *remote_description, *make_host;
|
||||
@@ -610,10 +642,14 @@ extern int handling_fatal_signal;
|
||||
#define MAX(_a,_b) ((_a)>(_b)?(_a):(_b))
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef VMS
|
||||
# define MAKE_SUCCESS 1
|
||||
# define MAKE_TROUBLE 2
|
||||
# define MAKE_FAILURE 3
|
||||
/* These are the VMS __posix_exit compliant exit codes, constructed out of
|
||||
STS$M_INHIB_MSG, C facility code, a POSIX condition code mask, MAKE_NNN<<3 and
|
||||
the coresponding VMS severity, here STS$K_SUCCESS and STS$K_ERROR. */
|
||||
# define MAKE_SUCCESS 0x1035a001
|
||||
# define MAKE_TROUBLE 0x1035a00a
|
||||
# define MAKE_FAILURE 0x1035a012
|
||||
#else
|
||||
# define MAKE_SUCCESS 0
|
||||
# define MAKE_TROUBLE 1
|
||||
|
||||
12
misc.c
12
misc.c
@@ -1,5 +1,5 @@
|
||||
/* Miscellaneous generic support functions for GNU Make.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2014 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
|
||||
@@ -219,7 +219,7 @@ xmalloc (unsigned int size)
|
||||
/* Make sure we don't allocate 0, for pre-ISO implementations. */
|
||||
void *result = malloc (size ? size : 1);
|
||||
if (result == 0)
|
||||
fatal (NILF, _("virtual memory exhausted"));
|
||||
OUT_OF_MEM();
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -230,7 +230,7 @@ xcalloc (unsigned int size)
|
||||
/* Make sure we don't allocate 0, for pre-ISO implementations. */
|
||||
void *result = calloc (size ? size : 1, 1);
|
||||
if (result == 0)
|
||||
fatal (NILF, _("virtual memory exhausted"));
|
||||
OUT_OF_MEM();
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ xrealloc (void *ptr, unsigned int size)
|
||||
size = 1;
|
||||
result = ptr ? realloc (ptr, size) : malloc (size);
|
||||
if (result == 0)
|
||||
fatal (NILF, _("virtual memory exhausted"));
|
||||
OUT_OF_MEM();
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ xstrdup (const char *ptr)
|
||||
#endif
|
||||
|
||||
if (result == 0)
|
||||
fatal (NILF, _("virtual memory exhausted"));
|
||||
OUT_OF_MEM();
|
||||
|
||||
#ifdef HAVE_STRDUP
|
||||
return result;
|
||||
@@ -281,7 +281,7 @@ xstrndup (const char *str, unsigned int length)
|
||||
#ifdef HAVE_STRNDUP
|
||||
result = strndup (str, length);
|
||||
if (result == 0)
|
||||
fatal (NILF, _("virtual memory exhausted"));
|
||||
OUT_OF_MEM();
|
||||
#else
|
||||
result = xmalloc (length + 1);
|
||||
if (length > 0)
|
||||
|
||||
201
output.c
201
output.c
@@ -1,5 +1,5 @@
|
||||
/* Output to stdout / stderr for GNU make
|
||||
Copyright (C) 2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2013-2014 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
|
||||
@@ -22,7 +22,10 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
# include <fcntl.h>
|
||||
@@ -32,6 +35,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifdef WINDOWS32
|
||||
# include <windows.h>
|
||||
# include <io.h>
|
||||
# include "sub_proc.h"
|
||||
#endif /* WINDOWS32 */
|
||||
|
||||
@@ -43,33 +47,9 @@ unsigned int stdio_traced = 0;
|
||||
#define OUTPUT_ISSET(_out) ((_out)->out >= 0 || (_out)->err >= 0)
|
||||
|
||||
#ifdef HAVE_FCNTL
|
||||
# define STREAM_OK(_s) ((fcntl (fileno (_s), F_GETFD) != -1) || (errno != EBADF))
|
||||
# define STREAM_OK(_s) ((fcntl (fileno (_s), F_GETFD) != -1) || (errno != EBADF))
|
||||
#else
|
||||
# define STREAM_OK(_s) 1
|
||||
#endif
|
||||
|
||||
/* I really want to move to gnulib. However, this is a big undertaking
|
||||
especially for non-UNIX platforms: how to get bootstrapping to work, etc.
|
||||
I don't want to take the time to do it right now. Use a hack to get a
|
||||
useful version of vsnprintf() for Windows. */
|
||||
#ifdef __VMS
|
||||
# define va_copy(_d, _s) ((_d) = (_s))
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
# define va_copy(_d, _s) ((_d) = (_s))
|
||||
# define snprintf msc_vsnprintf
|
||||
static int
|
||||
msc_vsnprintf (char *str, size_t size, const char *format, va_list ap)
|
||||
{
|
||||
int len = -1;
|
||||
|
||||
if (size > 0)
|
||||
len = _vsnprintf_s (str, size, _TRUNCATE, format, ap);
|
||||
if (len == -1)
|
||||
len = _vscprintf (format, ap);
|
||||
|
||||
return len;
|
||||
}
|
||||
# define STREAM_OK(_s) 1
|
||||
#endif
|
||||
|
||||
/* Write a string to the current STDOUT or STDERR. */
|
||||
@@ -92,10 +72,8 @@ _outputs (struct output *out, int is_err, const char *msg)
|
||||
while (1)
|
||||
{
|
||||
EINTRLOOP (r, write (fd, msg, len));
|
||||
if (r == len)
|
||||
if (r == len || r <= 0)
|
||||
break;
|
||||
if (r <= 0)
|
||||
return;
|
||||
len -= r;
|
||||
msg += r;
|
||||
}
|
||||
@@ -106,7 +84,7 @@ _outputs (struct output *out, int is_err, const char *msg)
|
||||
left (according to ENTERING) the current directory. */
|
||||
|
||||
static int
|
||||
log_working_directory (struct output *out, int entering)
|
||||
log_working_directory (int entering)
|
||||
{
|
||||
static char *buf = NULL;
|
||||
static unsigned int len = 0;
|
||||
@@ -115,7 +93,7 @@ log_working_directory (struct output *out, int entering)
|
||||
char *p;
|
||||
|
||||
/* Get enough space for the longest possible output. */
|
||||
need = strlen (program) + INTEGER_LENGTH + 2 + 1;
|
||||
need = strlen (program) + INTSTR_LENGTH + 2 + 1;
|
||||
if (starting_directory)
|
||||
need += strlen (starting_directory);
|
||||
|
||||
@@ -168,7 +146,7 @@ log_working_directory (struct output *out, int entering)
|
||||
else
|
||||
sprintf (p, fmt, program, makelevel, starting_directory);
|
||||
|
||||
_outputs (out, 0, buf);
|
||||
_outputs (NULL, 0, buf);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -262,7 +240,11 @@ pump_from_tmp (int from, FILE *to)
|
||||
if (len <= 0)
|
||||
break;
|
||||
if (fwrite (buffer, len, 1, to) < 1)
|
||||
perror ("fwrite()");
|
||||
{
|
||||
perror ("fwrite()");
|
||||
break;
|
||||
}
|
||||
fflush (to);
|
||||
}
|
||||
|
||||
#ifdef WINDOWS32
|
||||
@@ -387,7 +369,7 @@ output_dump (struct output *out)
|
||||
|
||||
/* Log the working directory for this dump. */
|
||||
if (print_directory_flag && output_sync != OUTPUT_SYNC_RECURSE)
|
||||
traced = log_working_directory (output_context, 1);
|
||||
traced = log_working_directory (1);
|
||||
|
||||
if (outfd_not_empty)
|
||||
pump_from_tmp (out->out, stdout);
|
||||
@@ -395,7 +377,7 @@ output_dump (struct output *out)
|
||||
pump_from_tmp (out->err, stderr);
|
||||
|
||||
if (traced)
|
||||
log_working_directory (output_context, 0);
|
||||
log_working_directory (0);
|
||||
|
||||
/* Exit the critical section. */
|
||||
if (sem)
|
||||
@@ -510,10 +492,10 @@ close_stdout (void)
|
||||
if (prev_fail || fclose_fail)
|
||||
{
|
||||
if (fclose_fail)
|
||||
error (NILF, _("write error: %s"), strerror (errno));
|
||||
perror_with_name (_("write error: stdout"), "");
|
||||
else
|
||||
error (NILF, _("write error"));
|
||||
exit (EXIT_FAILURE);
|
||||
O (error, NILF, _("write error: stdout"));
|
||||
exit (MAKE_TROUBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -558,7 +540,7 @@ output_close (struct output *out)
|
||||
if (! out)
|
||||
{
|
||||
if (stdio_traced)
|
||||
log_working_directory (NULL, 0);
|
||||
log_working_directory (0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -579,15 +561,17 @@ void
|
||||
output_start ()
|
||||
{
|
||||
#ifndef NO_OUTPUT_SYNC
|
||||
if (output_context && output_context->syncout && ! OUTPUT_ISSET(output_context))
|
||||
setup_tmpfile (output_context);
|
||||
/* If we're syncing output make sure the temporary file is set up. */
|
||||
if (output_context && output_context->syncout)
|
||||
if (! OUTPUT_ISSET(output_context))
|
||||
setup_tmpfile (output_context);
|
||||
#endif
|
||||
|
||||
if (! output_context || output_sync == OUTPUT_SYNC_RECURSE)
|
||||
{
|
||||
if (! stdio_traced && print_directory_flag)
|
||||
stdio_traced = log_working_directory (NULL, 1);
|
||||
}
|
||||
/* If we're not syncing this output per-line or per-target, make sure we emit
|
||||
the "Entering..." message where appropriate. */
|
||||
if (output_sync == OUTPUT_SYNC_NONE || output_sync == OUTPUT_SYNC_RECURSE)
|
||||
if (! stdio_traced && print_directory_flag)
|
||||
stdio_traced = log_working_directory (1);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -602,141 +586,120 @@ outputs (int is_err, const char *msg)
|
||||
}
|
||||
|
||||
|
||||
/* Return formatted string buffers.
|
||||
If we move to gnulib we can use vasnprintf() etc. to make this simpler.
|
||||
Note these functions use a static buffer, so each call overwrites the
|
||||
results of the previous call. */
|
||||
|
||||
static struct fmtstring
|
||||
{
|
||||
char *buffer;
|
||||
unsigned int size;
|
||||
unsigned int len;
|
||||
} fmtbuf = { NULL, 0, 0 };
|
||||
size_t size;
|
||||
} fmtbuf = { NULL, 0 };
|
||||
|
||||
/* Concatenate a formatted string onto the format buffer. */
|
||||
static const char *
|
||||
vfmtconcat (const char *fmt, va_list args)
|
||||
static char *
|
||||
get_buffer (size_t need)
|
||||
{
|
||||
va_list vcopy;
|
||||
int tot;
|
||||
int unused = fmtbuf.size - fmtbuf.len;
|
||||
|
||||
va_copy (vcopy, args);
|
||||
|
||||
tot = vsnprintf (&fmtbuf.buffer[fmtbuf.len], unused, fmt, args);
|
||||
assert (tot >= 0);
|
||||
|
||||
if (tot >= unused)
|
||||
/* Make sure we have room. NEED includes space for \0. */
|
||||
if (need > fmtbuf.size)
|
||||
{
|
||||
fmtbuf.size += tot * 2;
|
||||
fmtbuf.size += need * 2;
|
||||
fmtbuf.buffer = xrealloc (fmtbuf.buffer, fmtbuf.size);
|
||||
|
||||
unused = fmtbuf.size - fmtbuf.len;
|
||||
tot = vsnprintf (&fmtbuf.buffer[fmtbuf.len], unused, fmt, vcopy);
|
||||
}
|
||||
|
||||
va_end (vcopy);
|
||||
|
||||
fmtbuf.len += tot;
|
||||
fmtbuf.buffer[need-1] = '\0';
|
||||
|
||||
return fmtbuf.buffer;
|
||||
}
|
||||
|
||||
static const char *
|
||||
fmtconcat (const char *fmt, ...)
|
||||
{
|
||||
const char *p;
|
||||
va_list args;
|
||||
|
||||
va_start (args, fmt);
|
||||
p = vfmtconcat (fmt, args);
|
||||
va_end (args);
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
/* Print a message on stdout. */
|
||||
|
||||
void
|
||||
message (int prefix, const char *fmt, ...)
|
||||
message (int prefix, size_t len, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char *p;
|
||||
|
||||
assert (fmt != NULL);
|
||||
|
||||
fmtbuf.len = 0;
|
||||
len += strlen (fmt) + strlen (program) + INTSTR_LENGTH + 4 + 1 + 1;
|
||||
p = get_buffer (len);
|
||||
|
||||
if (prefix)
|
||||
{
|
||||
if (makelevel == 0)
|
||||
fmtconcat ("%s: ", program);
|
||||
sprintf (p, "%s: ", program);
|
||||
else
|
||||
fmtconcat ("%s[%u]: ", program, makelevel);
|
||||
sprintf (p, "%s[%u]: ", program, makelevel);
|
||||
p += strlen (p);
|
||||
}
|
||||
|
||||
va_start (args, fmt);
|
||||
vfmtconcat (fmt, args);
|
||||
vsprintf (p, fmt, args);
|
||||
va_end (args);
|
||||
|
||||
fmtconcat ("\n");
|
||||
strcat (p, "\n");
|
||||
|
||||
assert (fmtbuf.buffer[len-1] == '\0');
|
||||
outputs (0, fmtbuf.buffer);
|
||||
}
|
||||
|
||||
/* Print an error message. */
|
||||
|
||||
void
|
||||
error (const gmk_floc *flocp, const char *fmt, ...)
|
||||
error (const gmk_floc *flocp, size_t len, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char *p;
|
||||
|
||||
assert (fmt != NULL);
|
||||
|
||||
fmtbuf.len = 0;
|
||||
len += (strlen (fmt) + strlen (program)
|
||||
+ (flocp && flocp->filenm ? strlen (flocp->filenm) : 0)
|
||||
+ INTSTR_LENGTH + 4 + 1 + 1);
|
||||
p = get_buffer (len);
|
||||
|
||||
if (flocp && flocp->filenm)
|
||||
fmtconcat ("%s:%lu: ", flocp->filenm, flocp->lineno);
|
||||
sprintf (p, "%s:%lu: ", flocp->filenm, flocp->lineno);
|
||||
else if (makelevel == 0)
|
||||
fmtconcat ("%s: ", program);
|
||||
sprintf (p, "%s: ", program);
|
||||
else
|
||||
fmtconcat ("%s[%u]: ", program, makelevel);
|
||||
sprintf (p, "%s[%u]: ", program, makelevel);
|
||||
p += strlen (p);
|
||||
|
||||
va_start (args, fmt);
|
||||
vfmtconcat (fmt, args);
|
||||
vsprintf (p, fmt, args);
|
||||
va_end (args);
|
||||
|
||||
fmtconcat ("\n");
|
||||
strcat (p, "\n");
|
||||
|
||||
assert (fmtbuf.buffer[len-1] == '\0');
|
||||
outputs (1, fmtbuf.buffer);
|
||||
}
|
||||
|
||||
/* Print an error message and exit. */
|
||||
|
||||
void
|
||||
fatal (const gmk_floc *flocp, const char *fmt, ...)
|
||||
fatal (const gmk_floc *flocp, size_t len, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
const char *stop = _(". Stop.\n");
|
||||
char *p;
|
||||
|
||||
assert (fmt != NULL);
|
||||
|
||||
fmtbuf.len = 0;
|
||||
len += (strlen (fmt) + strlen (program)
|
||||
+ (flocp && flocp->filenm ? strlen (flocp->filenm) : 0)
|
||||
+ INTSTR_LENGTH + 8 + strlen (stop) + 1);
|
||||
p = get_buffer (len);
|
||||
|
||||
if (flocp && flocp->filenm)
|
||||
fmtconcat ("%s:%lu: *** ", flocp->filenm, flocp->lineno);
|
||||
sprintf (p, "%s:%lu: *** ", flocp->filenm, flocp->lineno);
|
||||
else if (makelevel == 0)
|
||||
fmtconcat ("%s: *** ", program);
|
||||
sprintf (p, "%s: *** ", program);
|
||||
else
|
||||
fmtconcat ("%s[%u]: *** ", program, makelevel);
|
||||
sprintf (p, "%s[%u]: *** ", program, makelevel);
|
||||
p += strlen (p);
|
||||
|
||||
va_start (args, fmt);
|
||||
vfmtconcat (fmt, args);
|
||||
vsprintf (p, fmt, args);
|
||||
va_end (args);
|
||||
|
||||
fmtconcat (_(". Stop.\n"));
|
||||
strcat (p, stop);
|
||||
|
||||
assert (fmtbuf.buffer[len-1] == '\0');
|
||||
outputs (1, fmtbuf.buffer);
|
||||
|
||||
die (2);
|
||||
die (MAKE_FAILURE);
|
||||
}
|
||||
|
||||
/* Print an error message from errno. */
|
||||
@@ -744,7 +707,8 @@ fatal (const gmk_floc *flocp, const char *fmt, ...)
|
||||
void
|
||||
perror_with_name (const char *str, const char *name)
|
||||
{
|
||||
error (NILF, _("%s%s: %s"), str, name, strerror (errno));
|
||||
const char *err = strerror (errno);
|
||||
OSSS (error, NILF, _("%s%s: %s"), str, name, err);
|
||||
}
|
||||
|
||||
/* Print an error message from errno and exit. */
|
||||
@@ -752,7 +716,8 @@ perror_with_name (const char *str, const char *name)
|
||||
void
|
||||
pfatal_with_name (const char *name)
|
||||
{
|
||||
fatal (NILF, _("%s: %s"), name, strerror (errno));
|
||||
const char *err = strerror (errno);
|
||||
OSS (fatal, NILF, _("%s: %s"), name, err);
|
||||
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
2
output.h
2
output.h
@@ -1,5 +1,5 @@
|
||||
/* Output to stdout / stderr for GNU make
|
||||
Copyright (C) 2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2013-2014 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
|
||||
|
||||
93
po/ChangeLog
93
po/ChangeLog
@@ -1,93 +0,0 @@
|
||||
2013-01-06 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* POTFILES.in: Add new load.c file.
|
||||
|
||||
2012-01-12 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* POTFILES.in: Add new guile.c file.
|
||||
|
||||
2011-09-26 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* LINGUAS: Added new translation file for Czech (cs).
|
||||
|
||||
2009-09-16 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* LINGUAS: Added new translation for Italian (it).
|
||||
|
||||
2008-05-17 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* LINGUAS: Added new translation for Lithuanian (lt).
|
||||
|
||||
2007-08-15 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* LINGUAS: The Kinyarwanda (rw) translation has disappeared from
|
||||
the translation site, so remove it.
|
||||
|
||||
2006-01-28 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* LINGUAS: Added new translation for Vietnamese (vi).
|
||||
|
||||
2005-07-14 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* LINGUAS: Added new translation for Indonesian (id).
|
||||
|
||||
2005-05-09 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* POTFILES.in: Add new file vmsjobs.c.
|
||||
|
||||
2005-04-06 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* LINGUAS: Added a new translation for Kinywarwanda (rw).
|
||||
|
||||
2005-02-09 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* LINGUAS: Added a new translation for Irish (ga).
|
||||
|
||||
2005-02-01 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* LINGUAS: Added a new translation for Finnish (fi).
|
||||
|
||||
2003-10-18 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* LINGUAS: Added a new translation for Belarusian (be).
|
||||
|
||||
2002-12-19 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* LINGUAS: Added a new translation for Ukrainian (uk).
|
||||
|
||||
2002-10-05 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* POTFILES.in: Add variable.h as it has a translatable string.
|
||||
|
||||
2002-08-08 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* LINGUAS: Add a new translation for Chinese (simplified) (zh_CN).
|
||||
|
||||
2002-08-02 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* LINGUAS: Add a new translation for Swedish (sv).
|
||||
|
||||
2002-04-21 Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
* LINGUAS, hr.po: Added new translation: Croatian.
|
||||
|
||||
* da.po, de.po, es.po, fr.po, gl.po, he.po, ja.po, ko.po, nl.po,
|
||||
pl.po, pt_BR.po, ru.po, tr.po: Moved from i18n to here.
|
||||
* .cvsignore: Moved from i18n to here.
|
||||
|
||||
* POTFILES.in, LINGUAS, Makevars: Created.
|
||||
|
||||
Copyright (C) 2002-2013 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 <http://www.gnu.org/licenses/>.
|
||||
@@ -1,5 +1,5 @@
|
||||
# This is a -*-Makefile-*-
|
||||
# Copyright (C) 2002-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2014 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# List of source files containing translatable strings.
|
||||
# Copyright (C) 2000-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2000-2014 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
|
||||
|
||||
59
prepare_vms.com
Normal file
59
prepare_vms.com
Normal file
@@ -0,0 +1,59 @@
|
||||
$!
|
||||
$! prepare_vms.com - Build config.h-vms from master on VMS.
|
||||
$!
|
||||
$! This is used for building off the master instead of a release tarball.
|
||||
$!
|
||||
$!
|
||||
$!
|
||||
$! First try ODS-5, Pathworks V6 or UNZIP name.
|
||||
$!
|
||||
$ config_template = f$search("sys$disk:[]config*h-vms.template")
|
||||
$ if config_template .eqs. ""
|
||||
$ then
|
||||
$!
|
||||
$! Try NFS, VMStar, or Pathworks V5 ODS-2 encoded name.
|
||||
$!
|
||||
$ config_template = f$search("sys$disk:[]config.h-vms*template")
|
||||
$ if config_template .eqs. ""
|
||||
$ then
|
||||
$ write sys$output "Could not find config.h-vms*template!"
|
||||
$ exit 44
|
||||
$ endif
|
||||
$ endif
|
||||
$ config_template_file = f$parse(config_template,,,"name")
|
||||
$ config_template_type = f$parse(config_template,,,"type")
|
||||
$ config_template = "sys$disk:[]" + config_template_file + config_template_type
|
||||
$!
|
||||
$!
|
||||
$! Pull the package and version from configure.ac
|
||||
$!
|
||||
$ open/read ac_file sys$disk:[]configure.ac
|
||||
$ac_read_loop:
|
||||
$ read ac_file/end=ac_read_loop_end line_in
|
||||
$ key = f$extract(0, 7, line_in)
|
||||
$ if key .nes. "AC_INIT" then goto ac_read_loop
|
||||
$ package = f$element (1,"[",line_in)
|
||||
$ package = f$element (0,"]",package)
|
||||
$ version = f$element (2,"[",line_in)
|
||||
$ version = f$element (0,"]",version)
|
||||
$ac_read_loop_end:
|
||||
$ close ac_file
|
||||
$!
|
||||
$ if (package .eqs. "") .or. (version .eqs. "")
|
||||
$ then
|
||||
$ write sys$output "Unable to determine package and/or version!"
|
||||
$ exit 44
|
||||
$ endif
|
||||
$!
|
||||
$!
|
||||
$ outfile = "sys$disk:[]config.h-vms"
|
||||
$!
|
||||
$! Note the pipe command is close to the length of 255, which is the
|
||||
$! maximum token length prior to VMS V8.2:
|
||||
$! %DCL-W-TKNOVF, command element is too long - shorten
|
||||
$ pipe (write sys$output "sub/%PACKAGE%/''package'/WHOLE/NOTYPE" ;-
|
||||
write sys$output "sub/%VERSION%/''version'/WHOLE/NOTYPE" ;-
|
||||
write sys$output "exit") |-
|
||||
edit/edt 'config_template'/out='outfile'/command=sys$pipe >nla0:
|
||||
$!
|
||||
$ write sys$output package, ", version: ", version, " prepared for VMS"
|
||||
156
read.c
156
read.c
@@ -1,5 +1,5 @@
|
||||
/* Reading and parsing of makefiles for GNU Make.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2014 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
|
||||
@@ -238,7 +238,7 @@ read_all_makefiles (const char **makefiles)
|
||||
|
||||
if (num_makefiles == 0)
|
||||
{
|
||||
static char *default_makefiles[] =
|
||||
static const char *default_makefiles[] =
|
||||
#ifdef VMS
|
||||
/* all lower case since readdir() (the vms version) 'lowercasifies' */
|
||||
{ "makefile.vms", "gnumakefile.", "makefile.", 0 };
|
||||
@@ -246,10 +246,14 @@ read_all_makefiles (const char **makefiles)
|
||||
#ifdef _AMIGA
|
||||
{ "GNUmakefile", "Makefile", "SMakefile", 0 };
|
||||
#else /* !Amiga && !VMS */
|
||||
#ifdef WINDOWS32
|
||||
{ "GNUmakefile", "makefile", "Makefile", "makefile.mak", 0 };
|
||||
#else /* !Amiga && !VMS && !WINDOWS32 */
|
||||
{ "GNUmakefile", "makefile", "Makefile", 0 };
|
||||
#endif /* !Amiga && !VMS && !WINDOWS32 */
|
||||
#endif /* AMIGA */
|
||||
#endif /* VMS */
|
||||
register char **p = default_makefiles;
|
||||
const char **p = default_makefiles;
|
||||
while (*p != 0 && !file_exists_p (*p))
|
||||
++p;
|
||||
|
||||
@@ -307,10 +311,8 @@ static void
|
||||
restore_conditionals (struct conditionals *saved)
|
||||
{
|
||||
/* Free any space allocated by conditional_line. */
|
||||
if (conditionals->ignoring)
|
||||
free (conditionals->ignoring);
|
||||
if (conditionals->seen_else)
|
||||
free (conditionals->seen_else);
|
||||
free (conditionals->ignoring);
|
||||
free (conditionals->seen_else);
|
||||
|
||||
/* Restore state. */
|
||||
conditionals = saved;
|
||||
@@ -368,7 +370,10 @@ eval_makefile (const char *filename, int flags)
|
||||
case ENFILE:
|
||||
#endif
|
||||
case ENOMEM:
|
||||
fatal (reading_file, "%s", strerror (makefile_errno));
|
||||
{
|
||||
const char *err = strerror (makefile_errno);
|
||||
OS (fatal, reading_file, "%s", err);
|
||||
}
|
||||
}
|
||||
|
||||
/* If the makefile wasn't found and it's either a makefile from
|
||||
@@ -406,8 +411,7 @@ eval_makefile (const char *filename, int flags)
|
||||
if (flags & RM_DONTCARE)
|
||||
deps->dontcare = 1;
|
||||
|
||||
if (expanded)
|
||||
free (expanded);
|
||||
free (expanded);
|
||||
|
||||
/* If the makefile can't be found at all, give up entirely. */
|
||||
|
||||
@@ -704,8 +708,7 @@ eval (struct ebuffer *ebuf, int set_default)
|
||||
if (collapsed_length < linelen+1)
|
||||
{
|
||||
collapsed_length = linelen+1;
|
||||
if (collapsed)
|
||||
free (collapsed);
|
||||
free (collapsed);
|
||||
/* Don't need xrealloc: we don't need to preserve the content. */
|
||||
collapsed = xmalloc (collapsed_length);
|
||||
}
|
||||
@@ -783,7 +786,7 @@ eval (struct ebuffer *ebuf, int set_default)
|
||||
if (i != -2)
|
||||
{
|
||||
if (i == -1)
|
||||
fatal (fstart, _("invalid syntax in conditional"));
|
||||
O (fatal, fstart, _("invalid syntax in conditional"));
|
||||
|
||||
ignoring = i;
|
||||
continue;
|
||||
@@ -853,8 +856,7 @@ eval (struct ebuffer *ebuf, int set_default)
|
||||
/* No pattern means remove all previous selective VPATH's. */
|
||||
vpat = 0;
|
||||
construct_vpath_list (vpat, p);
|
||||
if (vpat != 0)
|
||||
free (vpat);
|
||||
free (vpat);
|
||||
|
||||
continue;
|
||||
}
|
||||
@@ -912,7 +914,10 @@ eval (struct ebuffer *ebuf, int set_default)
|
||||
| (noerror ? RM_DONTCARE : 0)
|
||||
| (set_default ? 0 : RM_NO_DEFAULT_GOAL)));
|
||||
if (!r && !noerror)
|
||||
error (fstart, "%s: %s", name, strerror (errno));
|
||||
{
|
||||
const char *err = strerror (errno);
|
||||
OSS (error, fstart, "%s: %s", name, err);
|
||||
}
|
||||
}
|
||||
|
||||
/* Restore conditional state. */
|
||||
@@ -958,7 +963,7 @@ eval (struct ebuffer *ebuf, int set_default)
|
||||
/* Load the file. 0 means failure. */
|
||||
r = load_file (&ebuf->floc, &name, noerror);
|
||||
if (! r && ! noerror)
|
||||
fatal (&ebuf->floc, _("%s: failed to load"), name);
|
||||
OS (fatal, &ebuf->floc, _("%s: failed to load"), name);
|
||||
|
||||
free_ns (files);
|
||||
files = next;
|
||||
@@ -984,7 +989,7 @@ eval (struct ebuffer *ebuf, int set_default)
|
||||
was no preceding target, and the line might have been usable as a
|
||||
variable definition. But now we know it is definitely lossage. */
|
||||
if (line[0] == cmd_prefix)
|
||||
fatal (fstart, _("recipe commences before first target"));
|
||||
O (fatal, fstart, _("recipe commences before first target"));
|
||||
|
||||
/* This line describes some target files. This is complicated by
|
||||
the existence of target-specific variables, because we can't
|
||||
@@ -1033,7 +1038,7 @@ eval (struct ebuffer *ebuf, int set_default)
|
||||
{
|
||||
case w_eol:
|
||||
if (cmdleft != 0)
|
||||
fatal (fstart, _("missing rule before recipe"));
|
||||
O (fatal, fstart, _("missing rule before recipe"));
|
||||
/* This line contained something but turned out to be nothing
|
||||
but whitespace (a comment?). */
|
||||
continue;
|
||||
@@ -1073,7 +1078,7 @@ eval (struct ebuffer *ebuf, int set_default)
|
||||
here, but merely copy, since now you're beyond a ";"
|
||||
and into a command script. However, the old parser
|
||||
expanded the whole line, so we continue that for
|
||||
backwards-compatiblity. Also, it wouldn't be
|
||||
backwards-compatibility. Also, it wouldn't be
|
||||
entirely consistent, since we do an unconditional
|
||||
expand below once we know we don't have a
|
||||
target-specific variable. */
|
||||
@@ -1117,13 +1122,15 @@ eval (struct ebuffer *ebuf, int set_default)
|
||||
it. If so, we can't parse this line so punt. */
|
||||
if (wtype == w_eol)
|
||||
{
|
||||
if (*p2 != '\0')
|
||||
/* There's no need to be ivory-tower about this: check for
|
||||
one of the most common bugs found in makefiles... */
|
||||
fatal (fstart, _("missing separator%s"),
|
||||
(cmd_prefix == '\t' && !strneq (line, " ", 8))
|
||||
? "" : _(" (did you mean TAB instead of 8 spaces?)"));
|
||||
continue;
|
||||
if (*p2 == '\0')
|
||||
continue;
|
||||
|
||||
/* There's no need to be ivory-tower about this: check for
|
||||
one of the most common bugs found in makefiles... */
|
||||
if (cmd_prefix == '\t' && strneq (line, " ", 8))
|
||||
O (fatal, fstart, _("missing separator (did you mean TAB instead of 8 spaces?)"));
|
||||
else
|
||||
O (fatal, fstart, _("missing separator"));
|
||||
}
|
||||
|
||||
/* Make the colon the end-of-string so we know where to stop
|
||||
@@ -1260,13 +1267,13 @@ eval (struct ebuffer *ebuf, int set_default)
|
||||
PARSEFS_NOGLOB);
|
||||
++p2;
|
||||
if (target == 0)
|
||||
fatal (fstart, _("missing target pattern"));
|
||||
O (fatal, fstart, _("missing target pattern"));
|
||||
else if (target->next != 0)
|
||||
fatal (fstart, _("multiple target patterns"));
|
||||
O (fatal, fstart, _("multiple target patterns"));
|
||||
pattern_percent = find_percent_cached (&target->name);
|
||||
pattern = target->name;
|
||||
if (pattern_percent == 0)
|
||||
fatal (fstart, _("target pattern contains no '%%'"));
|
||||
O (fatal, fstart, _("target pattern contains no '%%'"));
|
||||
free_ns (target);
|
||||
}
|
||||
else
|
||||
@@ -1388,13 +1395,12 @@ eval (struct ebuffer *ebuf, int set_default)
|
||||
#undef word1eq
|
||||
|
||||
if (conditionals->if_cmds)
|
||||
fatal (fstart, _("missing 'endif'"));
|
||||
O (fatal, fstart, _("missing 'endif'"));
|
||||
|
||||
/* At eof, record the last rule. */
|
||||
record_waiting_files ();
|
||||
|
||||
if (collapsed)
|
||||
free (collapsed);
|
||||
free (collapsed);
|
||||
free (commands);
|
||||
}
|
||||
|
||||
@@ -1427,7 +1433,7 @@ do_undefine (char *name, enum variable_origin origin, struct ebuffer *ebuf)
|
||||
var = allocated_variable_expand (name);
|
||||
name = next_token (var);
|
||||
if (*name == '\0')
|
||||
fatal (&ebuf->floc, _("empty variable name"));
|
||||
O (fatal, &ebuf->floc, _("empty variable name"));
|
||||
p = name + strlen (name) - 1;
|
||||
while (p > name && isblank ((unsigned char)*p))
|
||||
--p;
|
||||
@@ -1462,7 +1468,7 @@ do_define (char *name, enum variable_origin origin, struct ebuffer *ebuf)
|
||||
else
|
||||
{
|
||||
if (var.value[0] != '\0')
|
||||
error (&defstart, _("extraneous text after 'define' directive"));
|
||||
O (error, &defstart, _("extraneous text after 'define' directive"));
|
||||
|
||||
/* Chop the string before the assignment token to get the name. */
|
||||
var.name[var.length] = '\0';
|
||||
@@ -1472,7 +1478,7 @@ do_define (char *name, enum variable_origin origin, struct ebuffer *ebuf)
|
||||
n = allocated_variable_expand (name);
|
||||
name = next_token (n);
|
||||
if (name[0] == '\0')
|
||||
fatal (&defstart, _("empty variable name"));
|
||||
O (fatal, &defstart, _("empty variable name"));
|
||||
p = name + strlen (name) - 1;
|
||||
while (p > name && isblank ((unsigned char)*p))
|
||||
--p;
|
||||
@@ -1487,7 +1493,7 @@ do_define (char *name, enum variable_origin origin, struct ebuffer *ebuf)
|
||||
|
||||
/* If there is nothing left to be eval'd, there's no 'endef'!! */
|
||||
if (nlines < 0)
|
||||
fatal (&defstart, _("missing 'endef', unterminated 'define'"));
|
||||
O (fatal, &defstart, _("missing 'endef', unterminated 'define'"));
|
||||
|
||||
ebuf->floc.lineno += nlines;
|
||||
line = ebuf->buffer;
|
||||
@@ -1514,8 +1520,8 @@ do_define (char *name, enum variable_origin origin, struct ebuffer *ebuf)
|
||||
p += 5;
|
||||
remove_comments (p);
|
||||
if (*(next_token (p)) != '\0')
|
||||
error (&ebuf->floc,
|
||||
_("extraneous text after 'endef' directive"));
|
||||
O (error, &ebuf->floc,
|
||||
_("extraneous text after 'endef' directive"));
|
||||
|
||||
if (--nlevels == 0)
|
||||
break;
|
||||
@@ -1564,7 +1570,7 @@ do_define (char *name, enum variable_origin origin, struct ebuffer *ebuf)
|
||||
static int
|
||||
conditional_line (char *line, int len, const gmk_floc *flocp)
|
||||
{
|
||||
char *cmdname;
|
||||
const char *cmdname;
|
||||
enum { c_ifdef, c_ifndef, c_ifeq, c_ifneq, c_else, c_endif } cmdtype;
|
||||
unsigned int i;
|
||||
unsigned int o;
|
||||
@@ -1586,16 +1592,17 @@ conditional_line (char *line, int len, const gmk_floc *flocp)
|
||||
/* Found one: skip past it and any whitespace after it. */
|
||||
line = next_token (line + len);
|
||||
|
||||
#define EXTRANEOUS() error (flocp, _("extraneous text after '%s' directive"), cmdname)
|
||||
#define EXTRATEXT() OS (error, flocp, _("extraneous text after '%s' directive"), cmdname)
|
||||
#define EXTRACMD() OS (fatal, flocp, _("extraneous '%s'"), cmdname)
|
||||
|
||||
/* An 'endif' cannot contain extra text, and reduces the if-depth by 1 */
|
||||
if (cmdtype == c_endif)
|
||||
{
|
||||
if (*line != '\0')
|
||||
EXTRANEOUS ();
|
||||
EXTRATEXT ();
|
||||
|
||||
if (!conditionals->if_cmds)
|
||||
fatal (flocp, _("extraneous '%s'"), cmdname);
|
||||
EXTRACMD ();
|
||||
|
||||
--conditionals->if_cmds;
|
||||
|
||||
@@ -1609,12 +1616,12 @@ conditional_line (char *line, int len, const gmk_floc *flocp)
|
||||
const char *p;
|
||||
|
||||
if (!conditionals->if_cmds)
|
||||
fatal (flocp, _("extraneous '%s'"), cmdname);
|
||||
EXTRACMD ();
|
||||
|
||||
o = conditionals->if_cmds - 1;
|
||||
|
||||
if (conditionals->seen_else[o])
|
||||
fatal (flocp, _("only one 'else' per conditional"));
|
||||
O (fatal, flocp, _("only one 'else' per conditional"));
|
||||
|
||||
/* Change the state of ignorance. */
|
||||
switch (conditionals->ignoring[o])
|
||||
@@ -1647,7 +1654,7 @@ conditional_line (char *line, int len, const gmk_floc *flocp)
|
||||
/* If it's 'else' or 'endif' or an illegal conditional, fail. */
|
||||
if (word1eq ("else") || word1eq ("endif")
|
||||
|| conditional_line (line, len, flocp) < 0)
|
||||
EXTRANEOUS ();
|
||||
EXTRATEXT ();
|
||||
else
|
||||
{
|
||||
/* conditional_line() created a new level of conditional.
|
||||
@@ -1804,7 +1811,7 @@ conditional_line (char *line, int len, const gmk_floc *flocp)
|
||||
*line = '\0';
|
||||
line = next_token (++line);
|
||||
if (*line != '\0')
|
||||
EXTRANEOUS ();
|
||||
EXTRATEXT ();
|
||||
|
||||
s2 = variable_expand (s2);
|
||||
conditionals->ignoring[o] = (streq (s1, s2) == (cmdtype == c_ifneq));
|
||||
@@ -1889,7 +1896,7 @@ record_target_var (struct nameseq *filenames, char *defn,
|
||||
current_variable_set_list = f->variables;
|
||||
v = try_variable_definition (flocp, defn, origin, 1);
|
||||
if (!v)
|
||||
fatal (flocp, _("Malformed target-specific variable definition"));
|
||||
O (fatal, flocp, _("Malformed target-specific variable definition"));
|
||||
current_variable_set_list = global;
|
||||
}
|
||||
|
||||
@@ -1909,8 +1916,7 @@ record_target_var (struct nameseq *filenames, char *defn,
|
||||
if (gv && v != gv
|
||||
&& (gv->origin == o_env_override || gv->origin == o_command))
|
||||
{
|
||||
if (v->value != 0)
|
||||
free (v->value);
|
||||
free (v->value);
|
||||
v->value = xstrdup (gv->value);
|
||||
v->origin = gv->origin;
|
||||
v->recursive = gv->recursive;
|
||||
@@ -1948,7 +1954,7 @@ record_files (struct nameseq *filenames, const char *pattern,
|
||||
at this time, since they won't get snapped and we'll get core dumps.
|
||||
See Savannah bug # 12124. */
|
||||
if (snapped_deps)
|
||||
fatal (flocp, _("prerequisites cannot be defined in recipes"));
|
||||
O (fatal, flocp, _("prerequisites cannot be defined in recipes"));
|
||||
|
||||
/* Determine if this is a pattern rule or not. */
|
||||
name = filenames->name;
|
||||
@@ -2006,7 +2012,7 @@ record_files (struct nameseq *filenames, const char *pattern,
|
||||
unsigned int c;
|
||||
|
||||
if (pattern != 0)
|
||||
fatal (flocp, _("mixed implicit and static pattern rules"));
|
||||
O (fatal, flocp, _("mixed implicit and static pattern rules"));
|
||||
|
||||
/* Count the targets to create an array of target names.
|
||||
We already have the first one. */
|
||||
@@ -2029,7 +2035,7 @@ record_files (struct nameseq *filenames, const char *pattern,
|
||||
implicit_percent = find_percent_cached (&name);
|
||||
|
||||
if (implicit_percent == 0)
|
||||
fatal (flocp, _("mixed implicit and normal rules"));
|
||||
O (fatal, flocp, _("mixed implicit and normal rules"));
|
||||
|
||||
targets[c] = name;
|
||||
target_pats[c] = implicit_percent;
|
||||
@@ -2081,7 +2087,8 @@ record_files (struct nameseq *filenames, const char *pattern,
|
||||
'targets: target%pattern: prereq%pattern; recipe',
|
||||
make sure the pattern matches this target name. */
|
||||
if (pattern && !pattern_matches (pattern, pattern_percent, name))
|
||||
error (flocp, _("target '%s' doesn't match the target pattern"), name);
|
||||
OS (error, flocp,
|
||||
_("target '%s' doesn't match the target pattern"), name);
|
||||
else if (deps)
|
||||
/* If there are multiple targets, copy the chain DEPS for all but the
|
||||
last one. It is not safe for the same deps to go in more than one
|
||||
@@ -2095,25 +2102,26 @@ record_files (struct nameseq *filenames, const char *pattern,
|
||||
if any. */
|
||||
f = enter_file (strcache_add (name));
|
||||
if (f->double_colon)
|
||||
fatal (flocp,
|
||||
_("target file '%s' has both : and :: entries"), f->name);
|
||||
OS (fatal, flocp,
|
||||
_("target file '%s' has both : and :: entries"), f->name);
|
||||
|
||||
/* If CMDS == F->CMDS, this target was listed in this rule
|
||||
more than once. Just give a warning since this is harmless. */
|
||||
if (cmds != 0 && cmds == f->cmds)
|
||||
error (flocp,
|
||||
_("target '%s' given more than once in the same rule"),
|
||||
f->name);
|
||||
OS (error, flocp,
|
||||
_("target '%s' given more than once in the same rule"),
|
||||
f->name);
|
||||
|
||||
/* Check for two single-colon entries both with commands.
|
||||
Check is_target so that we don't lose on files such as .c.o
|
||||
whose commands were preinitialized. */
|
||||
else if (cmds != 0 && f->cmds != 0 && f->is_target)
|
||||
{
|
||||
error (&cmds->fileinfo,
|
||||
size_t l = strlen (f->name);
|
||||
error (&cmds->fileinfo, l,
|
||||
_("warning: overriding recipe for target '%s'"),
|
||||
f->name);
|
||||
error (&f->cmds->fileinfo,
|
||||
error (&f->cmds->fileinfo, l,
|
||||
_("warning: ignoring old recipe for target '%s'"),
|
||||
f->name);
|
||||
}
|
||||
@@ -2140,8 +2148,8 @@ record_files (struct nameseq *filenames, const char *pattern,
|
||||
/* Check for both : and :: rules. Check is_target so we don't lose
|
||||
on default suffix rules or makefiles. */
|
||||
if (f != 0 && f->is_target && !f->double_colon)
|
||||
fatal (flocp,
|
||||
_("target file '%s' has both : and :: entries"), f->name);
|
||||
OS (fatal, flocp,
|
||||
_("target file '%s' has both : and :: entries"), f->name);
|
||||
|
||||
f = enter_file (strcache_add (name));
|
||||
/* If there was an existing entry and it was a double-colon entry,
|
||||
@@ -2217,7 +2225,8 @@ record_files (struct nameseq *filenames, const char *pattern,
|
||||
/* Reduce escaped percents. If there are any unescaped it's an error */
|
||||
name = filenames->name;
|
||||
if (find_percent_cached (&name))
|
||||
fatal (flocp, _("mixed implicit and normal rules"));
|
||||
O (error, flocp,
|
||||
_("*** mixed implicit and normal rules: deprecated syntax"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2331,14 +2340,14 @@ unescape_char (char *string, int c)
|
||||
if (*e != c || l%2 == 0)
|
||||
{
|
||||
/* It's not; just take it all without unescaping. */
|
||||
memcpy (p, s, l);
|
||||
memmove (p, s, l);
|
||||
p += l;
|
||||
}
|
||||
else if (l > 1)
|
||||
{
|
||||
/* It is, and there's >1 backslash. Take half of them. */
|
||||
l /= 2;
|
||||
memcpy (p, s, l);
|
||||
memmove (p, s, l);
|
||||
p += l;
|
||||
}
|
||||
s = e;
|
||||
@@ -2526,8 +2535,8 @@ readline (struct ebuffer *ebuf)
|
||||
lossage strikes again! (xmkmf puts NULs in its makefiles.)
|
||||
There is nothing really to be done; we synthesize a newline so
|
||||
the following line doesn't appear to be part of this line. */
|
||||
error (&ebuf->floc,
|
||||
_("warning: NUL character seen; rest of line ignored"));
|
||||
O (error, &ebuf->floc,
|
||||
_("warning: NUL character seen; rest of line ignored"));
|
||||
p[0] = '\n';
|
||||
len = 1;
|
||||
}
|
||||
@@ -2842,8 +2851,7 @@ construct_include_path (const char **arg_dirs)
|
||||
dirs[idx++] = strcache_add_len (dir, len);
|
||||
}
|
||||
|
||||
if (expanded)
|
||||
free (expanded);
|
||||
free (expanded);
|
||||
}
|
||||
|
||||
/* Now add the standard default dirs at the end. */
|
||||
@@ -3269,7 +3277,7 @@ parse_file_seq (char **stringp, unsigned int size, int stopmap,
|
||||
switch (glob (name, GLOB_NOSORT|GLOB_ALTDIRFUNC, NULL, &gl))
|
||||
{
|
||||
case GLOB_NOSPACE:
|
||||
fatal (NILF, _("virtual memory exhausted"));
|
||||
OUT_OF_MEM();
|
||||
|
||||
case 0:
|
||||
/* Success. */
|
||||
@@ -3335,12 +3343,10 @@ parse_file_seq (char **stringp, unsigned int size, int stopmap,
|
||||
globfree (&gl);
|
||||
|
||||
#ifndef NO_ARCHIVES
|
||||
if (arname)
|
||||
free (arname);
|
||||
free (arname);
|
||||
#endif
|
||||
|
||||
if (tildep)
|
||||
free (tildep);
|
||||
free (tildep);
|
||||
}
|
||||
|
||||
*stringp = p;
|
||||
|
||||
153
remake.c
153
remake.c
@@ -1,5 +1,5 @@
|
||||
/* Basic dependency engine for GNU Make.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2014 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
|
||||
@@ -58,10 +58,10 @@ unsigned int commands_started = 0;
|
||||
/* Current value for pruning the scan of the goal chain (toggle 0/1). */
|
||||
static unsigned int considered;
|
||||
|
||||
static int update_file (struct file *file, unsigned int depth);
|
||||
static int update_file_1 (struct file *file, unsigned int depth);
|
||||
static int check_dep (struct file *file, unsigned int depth,
|
||||
FILE_TIMESTAMP this_mtime, int *must_make_ptr);
|
||||
static enum update_status update_file (struct file *file, unsigned int depth);
|
||||
static enum update_status update_file_1 (struct file *file, unsigned int depth);
|
||||
static enum update_status check_dep (struct file *file, unsigned int depth,
|
||||
FILE_TIMESTAMP this_mtime, int *must_make);
|
||||
static enum update_status touch_file (struct file *file);
|
||||
static void remake_file (struct file *file);
|
||||
static FILE_TIMESTAMP name_mtime (const char *name);
|
||||
@@ -130,7 +130,7 @@ update_goal_chain (struct dep *goals)
|
||||
file = file->prev)
|
||||
{
|
||||
unsigned int ocommands_started;
|
||||
int fail;
|
||||
enum update_status fail;
|
||||
|
||||
file->dontcare = g->dontcare;
|
||||
|
||||
@@ -161,14 +161,12 @@ update_goal_chain (struct dep *goals)
|
||||
if (commands_started > ocommands_started)
|
||||
g->changed = 1;
|
||||
|
||||
/* If we updated a file and STATUS was not already 1, set it to
|
||||
1 if updating failed, or to 0 if updating succeeded. Leave
|
||||
STATUS as it is if no updating was done. */
|
||||
|
||||
stop = 0;
|
||||
if ((fail || file->updated) && status < us_question)
|
||||
{
|
||||
if (file->update_status != us_success)
|
||||
/* We updated this goal. Update STATUS and decide whether
|
||||
to stop. */
|
||||
if (file->update_status)
|
||||
{
|
||||
/* Updating failed, or -q triggered. The STATUS value
|
||||
tells our caller which. */
|
||||
@@ -228,10 +226,10 @@ update_goal_chain (struct dep *goals)
|
||||
&& file->update_status == us_success && !g->changed
|
||||
/* Never give a message under -s or -q. */
|
||||
&& !silent_flag && !question_flag)
|
||||
message (1, ((file->phony || file->cmds == 0)
|
||||
? _("Nothing to be done for '%s'.")
|
||||
: _("'%s' is up to date.")),
|
||||
file->name);
|
||||
OS (message, 1, ((file->phony || file->cmds == 0)
|
||||
? _("Nothing to be done for '%s'.")
|
||||
: _("'%s' is up to date.")),
|
||||
file->name);
|
||||
|
||||
/* This goal is finished. Remove it from the chain. */
|
||||
if (lastgoal == 0)
|
||||
@@ -282,11 +280,11 @@ update_goal_chain (struct dep *goals)
|
||||
If there are multiple double-colon entries for FILE,
|
||||
each is considered in turn. */
|
||||
|
||||
static int
|
||||
static enum update_status
|
||||
update_file (struct file *file, unsigned int depth)
|
||||
{
|
||||
int status = 0;
|
||||
register struct file *f;
|
||||
enum update_status status = us_success;
|
||||
struct file *f;
|
||||
|
||||
f = file->double_colon ? file->double_colon : file;
|
||||
|
||||
@@ -311,26 +309,31 @@ update_file (struct file *file, unsigned int depth)
|
||||
the chain is exhausted. */
|
||||
for (; f != 0; f = f->prev)
|
||||
{
|
||||
enum update_status new;
|
||||
|
||||
f->considered = considered;
|
||||
|
||||
status |= update_file_1 (f, depth);
|
||||
new = update_file_1 (f, depth);
|
||||
check_renamed (f);
|
||||
|
||||
/* Clean up any alloca() used during the update. */
|
||||
alloca (0);
|
||||
|
||||
/* If we got an error, don't bother with double_colon etc. */
|
||||
if (status != 0 && !keep_going_flag)
|
||||
return status;
|
||||
if (new && !keep_going_flag)
|
||||
return new;
|
||||
|
||||
if (f->command_state == cs_running
|
||||
|| f->command_state == cs_deps_running)
|
||||
{
|
||||
/* Don't run the other :: rules for this
|
||||
file until this rule is finished. */
|
||||
status = 0;
|
||||
status = us_success;
|
||||
break;
|
||||
}
|
||||
|
||||
if (new > status)
|
||||
status = new;
|
||||
}
|
||||
|
||||
/* Process the remaining rules in the double colon chain so they're marked
|
||||
@@ -343,7 +346,11 @@ update_file (struct file *file, unsigned int depth)
|
||||
f->considered = considered;
|
||||
|
||||
for (d = f->deps; d != 0; d = d->next)
|
||||
status |= update_file (d->file, depth + 1);
|
||||
{
|
||||
enum update_status new = update_file (d->file, depth + 1);
|
||||
if (new > status)
|
||||
new = status;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
@@ -373,24 +380,30 @@ complain (struct file *file)
|
||||
|
||||
if (d == 0)
|
||||
{
|
||||
const char *msg_noparent
|
||||
= _("%sNo rule to make target '%s'%s");
|
||||
const char *msg_parent
|
||||
= _("%sNo rule to make target '%s', needed by '%s'%s");
|
||||
|
||||
/* Didn't find any dependencies to complain about. */
|
||||
if (!keep_going_flag)
|
||||
if (file->parent)
|
||||
{
|
||||
if (file->parent == 0)
|
||||
fatal (NILF, msg_noparent, "", file->name, "");
|
||||
size_t l = strlen (file->name) + strlen (file->parent->name) + 4;
|
||||
|
||||
fatal (NILF, msg_parent, "", file->name, file->parent->name, "");
|
||||
if (!keep_going_flag)
|
||||
fatal (NILF, l,
|
||||
_("%sNo rule to make target '%s', needed by '%s'%s"),
|
||||
"", file->name, file->parent->name, "");
|
||||
|
||||
error (NILF, l, _("%sNo rule to make target '%s', needed by '%s'%s"),
|
||||
"*** ", file->name, file->parent->name, ".");
|
||||
}
|
||||
|
||||
if (file->parent == 0)
|
||||
error (NILF, msg_noparent, "*** ", file->name, ".");
|
||||
else
|
||||
error (NILF, msg_parent, "*** ", file->name, file->parent->name, ".");
|
||||
{
|
||||
size_t l = strlen (file->name) + 4;
|
||||
|
||||
if (!keep_going_flag)
|
||||
fatal (NILF, l,
|
||||
_("%sNo rule to make target '%s'%s"), "", file->name, "");
|
||||
|
||||
error (NILF, l,
|
||||
_("%sNo rule to make target '%s'%s"), "*** ", file->name, ".");
|
||||
}
|
||||
|
||||
file->no_diag = 0;
|
||||
}
|
||||
@@ -399,12 +412,12 @@ complain (struct file *file)
|
||||
/* Consider a single 'struct file' and update it as appropriate.
|
||||
Return 0 on success, or non-0 on failure. */
|
||||
|
||||
static int
|
||||
static enum update_status
|
||||
update_file_1 (struct file *file, unsigned int depth)
|
||||
{
|
||||
enum update_status dep_status = us_success;
|
||||
FILE_TIMESTAMP this_mtime;
|
||||
int noexist, must_make, deps_changed;
|
||||
int dep_status = 0;
|
||||
struct file *ofile;
|
||||
struct dep *d, *ad;
|
||||
struct dep amake;
|
||||
@@ -478,8 +491,9 @@ update_file_1 (struct file *file, unsigned int depth)
|
||||
/* Avoid spurious rebuilds due to low resolution time stamps. */
|
||||
int ns = FILE_TIMESTAMP_NS (this_mtime);
|
||||
if (ns != 0)
|
||||
error (NILF, _("*** Warning: .LOW_RESOLUTION_TIME file '%s' has a high resolution time stamp"),
|
||||
file->name);
|
||||
OS (error, NILF,
|
||||
_("*** Warning: .LOW_RESOLUTION_TIME file '%s' has a high resolution time stamp"),
|
||||
file->name);
|
||||
this_mtime += FILE_TIMESTAMPS_PER_S - 1 - ns;
|
||||
}
|
||||
|
||||
@@ -521,6 +535,7 @@ update_file_1 (struct file *file, unsigned int depth)
|
||||
|
||||
while (d)
|
||||
{
|
||||
enum update_status new;
|
||||
FILE_TIMESTAMP mtime;
|
||||
int maybe_make;
|
||||
int dontcare = 0;
|
||||
@@ -532,8 +547,8 @@ update_file_1 (struct file *file, unsigned int depth)
|
||||
|
||||
if (is_updating (d->file))
|
||||
{
|
||||
error (NILF, _("Circular %s <- %s dependency dropped."),
|
||||
file->name, d->file->name);
|
||||
OSS (error, NILF, _("Circular %s <- %s dependency dropped."),
|
||||
file->name, d->file->name);
|
||||
/* We cannot free D here because our the caller will still have
|
||||
a reference to it when we were called recursively via
|
||||
check_dep below. */
|
||||
@@ -555,7 +570,9 @@ update_file_1 (struct file *file, unsigned int depth)
|
||||
d->file->dontcare = file->dontcare;
|
||||
}
|
||||
|
||||
dep_status |= check_dep (d->file, depth, this_mtime, &maybe_make);
|
||||
new = check_dep (d->file, depth, this_mtime, &maybe_make);
|
||||
if (new > dep_status)
|
||||
dep_status = new;
|
||||
|
||||
/* Restore original dontcare flag. */
|
||||
if (rebuilding_makefiles)
|
||||
@@ -601,6 +618,7 @@ update_file_1 (struct file *file, unsigned int depth)
|
||||
for (d = file->deps; d != 0; d = d->next)
|
||||
if (d->file->intermediate)
|
||||
{
|
||||
enum update_status new;
|
||||
int dontcare = 0;
|
||||
|
||||
FILE_TIMESTAMP mtime = file_mtime (d->file);
|
||||
@@ -619,7 +637,9 @@ update_file_1 (struct file *file, unsigned int depth)
|
||||
not prune it. */
|
||||
d->file->considered = !considered;
|
||||
|
||||
dep_status |= update_file (d->file, depth);
|
||||
new = update_file (d->file, depth);
|
||||
if (new > dep_status)
|
||||
dep_status = new;
|
||||
|
||||
/* Restore original dontcare flag. */
|
||||
if (rebuilding_makefiles)
|
||||
@@ -664,9 +684,10 @@ update_file_1 (struct file *file, unsigned int depth)
|
||||
|
||||
/* If any dependency failed, give up now. */
|
||||
|
||||
if (dep_status != 0)
|
||||
if (dep_status)
|
||||
{
|
||||
file->update_status = us_failed;
|
||||
/* I'm not sure if we can't just assign dep_status... */
|
||||
file->update_status = dep_status == us_none ? us_failed : dep_status;
|
||||
notice_finished_file (file);
|
||||
|
||||
--depth;
|
||||
@@ -675,8 +696,8 @@ update_file_1 (struct file *file, unsigned int depth)
|
||||
|
||||
if (depth == 0 && keep_going_flag
|
||||
&& !just_print_flag && !question_flag)
|
||||
error (NILF,
|
||||
_("Target '%s' not remade because of errors."), file->name);
|
||||
OS (error, NILF,
|
||||
_("Target '%s' not remade because of errors."), file->name);
|
||||
|
||||
return dep_status;
|
||||
}
|
||||
@@ -981,13 +1002,13 @@ notice_finished_file (struct file *file)
|
||||
FILE depends on (including FILE itself). Return nonzero if any updating
|
||||
failed. */
|
||||
|
||||
static int
|
||||
static enum update_status
|
||||
check_dep (struct file *file, unsigned int depth,
|
||||
FILE_TIMESTAMP this_mtime, int *must_make_ptr)
|
||||
{
|
||||
struct file *ofile;
|
||||
struct dep *d;
|
||||
int dep_status = 0;
|
||||
enum update_status dep_status = us_success;
|
||||
|
||||
++depth;
|
||||
start_updating (file);
|
||||
@@ -1060,12 +1081,13 @@ check_dep (struct file *file, unsigned int depth,
|
||||
d = file->deps;
|
||||
while (d != 0)
|
||||
{
|
||||
enum update_status new;
|
||||
int maybe_make;
|
||||
|
||||
if (is_updating (d->file))
|
||||
{
|
||||
error (NILF, _("Circular %s <- %s dependency dropped."),
|
||||
file->name, d->file->name);
|
||||
OSS (error, NILF, _("Circular %s <- %s dependency dropped."),
|
||||
file->name, d->file->name);
|
||||
if (ld == 0)
|
||||
{
|
||||
file->deps = d->next;
|
||||
@@ -1083,12 +1105,14 @@ check_dep (struct file *file, unsigned int depth,
|
||||
|
||||
d->file->parent = file;
|
||||
maybe_make = *must_make_ptr;
|
||||
dep_status |= check_dep (d->file, depth, this_mtime,
|
||||
&maybe_make);
|
||||
new = check_dep (d->file, depth, this_mtime, &maybe_make);
|
||||
if (new > dep_status)
|
||||
dep_status = new;
|
||||
|
||||
if (! d->ignore_mtime)
|
||||
*must_make_ptr = maybe_make;
|
||||
check_renamed (d->file);
|
||||
if (dep_status != 0 && !keep_going_flag)
|
||||
if (dep_status && !keep_going_flag)
|
||||
break;
|
||||
|
||||
if (d->file->command_state == cs_running
|
||||
@@ -1122,7 +1146,7 @@ static enum update_status
|
||||
touch_file (struct file *file)
|
||||
{
|
||||
if (!silent_flag)
|
||||
message (0, "touch %s", file->name);
|
||||
OS (message, 0, "touch %s", file->name);
|
||||
|
||||
/* Print-only (-n) takes precedence over touch (-t). */
|
||||
if (just_print_flag)
|
||||
@@ -1369,8 +1393,9 @@ f_mtime (struct file *file, int search)
|
||||
if (adjusted_now < adjusted_mtime)
|
||||
{
|
||||
#ifdef NO_FLOAT
|
||||
error (NILF, _("Warning: File '%s' has modification time in the future"),
|
||||
file->name);
|
||||
OS (error, NILF,
|
||||
_("Warning: File '%s' has modification time in the future"),
|
||||
file->name);
|
||||
#else
|
||||
double from_now =
|
||||
(FILE_TIMESTAMP_S (mtime) - FILE_TIMESTAMP_S (now)
|
||||
@@ -1382,8 +1407,9 @@ f_mtime (struct file *file, int search)
|
||||
sprintf (from_now_string, "%lu", (unsigned long) from_now);
|
||||
else
|
||||
sprintf (from_now_string, "%.2g", from_now);
|
||||
error (NILF, _("Warning: File '%s' has modification time %s s in the future"),
|
||||
file->name, from_now_string);
|
||||
OSS (error, NILF,
|
||||
_("Warning: File '%s' has modification time %s s in the future"),
|
||||
file->name, from_now_string);
|
||||
#endif
|
||||
clock_skew_detected = 1;
|
||||
}
|
||||
@@ -1520,7 +1546,7 @@ name_mtime (const char *name)
|
||||
static const char *
|
||||
library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr)
|
||||
{
|
||||
static char *dirs[] =
|
||||
static const char *dirs[] =
|
||||
{
|
||||
#ifndef _AMIGA
|
||||
"/lib",
|
||||
@@ -1550,7 +1576,7 @@ library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr)
|
||||
/* Information about the earliest (in the vpath sequence) match. */
|
||||
unsigned int best_vpath = 0, best_path = 0;
|
||||
|
||||
char **dp;
|
||||
const char **dp;
|
||||
|
||||
libpatterns = xstrdup (variable_expand ("$(.LIBPATTERNS)"));
|
||||
|
||||
@@ -1580,7 +1606,8 @@ library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr)
|
||||
if (!p3)
|
||||
{
|
||||
/* Give a warning if there is no pattern. */
|
||||
error (NILF, _(".LIBPATTERNS element '%s' is not a pattern"), p);
|
||||
OS (error, NILF,
|
||||
_(".LIBPATTERNS element '%s' is not a pattern"), p);
|
||||
p[len] = c;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
Please do not send bug reports or questions about it to
|
||||
the Make maintainers.
|
||||
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2014 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
|
||||
@@ -151,7 +151,7 @@ start_remote_job (char **argv, char **envp, int stdin_fd,
|
||||
retsock = Rpc_UdpCreate (True, 0);
|
||||
if (retsock < 0)
|
||||
{
|
||||
error (NILF, "exporting: Couldn't create return socket.");
|
||||
O (error, NILF, "exporting: Couldn't create return socket.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -192,33 +192,35 @@ start_remote_job (char **argv, char **envp, int stdin_fd,
|
||||
|
||||
host = gethostbyaddr ((char *)&permit.addr, sizeof(permit.addr), AF_INET);
|
||||
|
||||
if (status != RPC_SUCCESS)
|
||||
{
|
||||
(void) close (retsock);
|
||||
(void) close (sock);
|
||||
error (NILF, "exporting to %s: %s",
|
||||
host ? host->h_name : inet_ntoa (permit.addr),
|
||||
Rpc_ErrorMessage (status));
|
||||
return 1;
|
||||
}
|
||||
else if (msg[0] != 'O' || msg[1] != 'k' || msg[2] != '\0')
|
||||
{
|
||||
(void) close (retsock);
|
||||
(void) close (sock);
|
||||
error (NILF, "exporting to %s: %s",
|
||||
host ? host->h_name : inet_ntoa (permit.addr),
|
||||
msg);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
error (NILF, "*** exported to %s (id %u)",
|
||||
host ? host->h_name : inet_ntoa (permit.addr),
|
||||
permit.id);
|
||||
}
|
||||
{
|
||||
const char *hnm = host ? host->h_name : inet_ntoa (permit.addr);
|
||||
size_t hlen = strlen (hnm);
|
||||
|
||||
fflush (stdout);
|
||||
fflush (stderr);
|
||||
if (status != RPC_SUCCESS)
|
||||
{
|
||||
const char *err = Rpc_ErrorMessage (status);
|
||||
(void) close (retsock);
|
||||
(void) close (sock);
|
||||
error (NILF, hlen + strlen (err),
|
||||
"exporting to %s: %s", hnm, err);
|
||||
return 1;
|
||||
}
|
||||
else if (msg[0] != 'O' || msg[1] != 'k' || msg[2] != '\0')
|
||||
{
|
||||
(void) close (retsock);
|
||||
(void) close (sock);
|
||||
error (NILF, hlen + strlen (msg), "exporting to %s: %s", hnm, msg);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
error (NILF, hlen + INTSTR_LENGTH,
|
||||
"*** exported to %s (id %u)", hnm, permit.id);
|
||||
}
|
||||
|
||||
fflush (stdout);
|
||||
fflush (stderr);
|
||||
}
|
||||
|
||||
pid = fork ();
|
||||
if (pid < 0)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Template for the remote job exportation interface to GNU Make.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2014 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
|
||||
|
||||
13
rule.c
13
rule.c
@@ -1,5 +1,5 @@
|
||||
/* Pattern and suffix rule internals for GNU Make.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2014 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
|
||||
@@ -140,8 +140,7 @@ count_implicit_rule_limits (void)
|
||||
rule = next;
|
||||
}
|
||||
|
||||
if (name != 0)
|
||||
free (name);
|
||||
free (name);
|
||||
}
|
||||
|
||||
/* Create a pattern rule from a suffix rule.
|
||||
@@ -357,7 +356,7 @@ void
|
||||
install_pattern_rule (struct pspec *p, int terminal)
|
||||
{
|
||||
struct rule *r;
|
||||
char *ptr;
|
||||
const char *ptr;
|
||||
|
||||
r = xmalloc (sizeof (struct rule));
|
||||
|
||||
@@ -373,7 +372,7 @@ install_pattern_rule (struct pspec *p, int terminal)
|
||||
++r->suffixes[0];
|
||||
|
||||
ptr = p->dep;
|
||||
r->deps = PARSE_SIMPLE_SEQ (&ptr, struct dep);
|
||||
r->deps = PARSE_SIMPLE_SEQ ((char **)&ptr, struct dep);
|
||||
|
||||
if (new_pattern_rule (r, 0))
|
||||
{
|
||||
@@ -528,7 +527,7 @@ print_rule_data_base (void)
|
||||
/* This can happen if a fatal error was detected while reading the
|
||||
makefiles and thus count_implicit_rule_limits wasn't called yet. */
|
||||
if (num_pattern_rules != 0)
|
||||
fatal (NILF, _("BUG: num_pattern_rules is wrong! %u != %u"),
|
||||
num_pattern_rules, rules);
|
||||
ONN (fatal, NILF, _("BUG: num_pattern_rules is wrong! %u != %u"),
|
||||
num_pattern_rules, rules);
|
||||
}
|
||||
}
|
||||
|
||||
4
rule.h
4
rule.h
@@ -1,5 +1,5 @@
|
||||
/* Definitions for using pattern rules in GNU Make.
|
||||
Copyright (C) 1988-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988-2014 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
|
||||
@@ -33,7 +33,7 @@ struct rule
|
||||
/* For calling install_pattern_rule. */
|
||||
struct pspec
|
||||
{
|
||||
char *target, *dep, *commands;
|
||||
const char *target, *dep, *commands;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Convert between signal names and numbers.
|
||||
Copyright (C) 1990-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990-2014 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Constant string caching for GNU Make.
|
||||
Copyright (C) 2006-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006-2014 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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
rem Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
rem Copyright (C) 1996-2014 Free Software Foundation, Inc.
|
||||
rem This file is part of GNU Make.
|
||||
rem
|
||||
rem GNU Make is free software; you can redistribute it and/or modify it under
|
||||
|
||||
1
tests/.gitignore
vendored
1
tests/.gitignore
vendored
@@ -1 +1,2 @@
|
||||
config-flags.pm
|
||||
work
|
||||
|
||||
@@ -1,3 +1,33 @@
|
||||
2013-10-09 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/patspecific_vars: Typo fixes.
|
||||
|
||||
2013-10-05 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* test_driver.pl (run_all_tests): Rewrite to be more clear.
|
||||
* scripts/features/jobserver: Avoid using $ENV{HOME} as it doesn't
|
||||
exist everywhere.
|
||||
* scripts/features/default_names: End with 1;
|
||||
|
||||
* scripts/features/loadapi: Use new calling signatures. Verify
|
||||
the NOEXPAND flag works. Test with all valid function name
|
||||
characters.
|
||||
|
||||
2013-09-29 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/variables/SHELL: Solaris /bin/sh can't handle options in
|
||||
multiple words; skip that test.
|
||||
* scripts/targets/ONESHELL: Ditto.
|
||||
|
||||
* scripts/variables/GNUMAKEFLAGS: Verify that GNUMAKEFLAGS is
|
||||
cleared and options are not duplicated.
|
||||
|
||||
2013-09-23 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/options/print-directory: Rename dash-w to
|
||||
print-directory to avoid conflicts with dash-W on case-insensitive
|
||||
filesystems.
|
||||
|
||||
2013-09-22 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/features/se_implicit: Verify that order-only tokens
|
||||
@@ -1383,7 +1413,7 @@
|
||||
ChangeLog file for the test suite created.
|
||||
|
||||
|
||||
Copyright (C) 1992-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992-2014 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
|
||||
@@ -162,7 +162,7 @@ Changes from 0.1 to 0.2 (5-4-92):
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1992-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992-2014 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
|
||||
|
||||
@@ -7,7 +7,7 @@ This entire test suite, including all test files, are copyright and
|
||||
distributed under the following terms:
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
Copyright (C) 1992-2013 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992-2014 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
|
||||
|
||||
19
tests/config-flags.pm.in
Normal file
19
tests/config-flags.pm.in
Normal file
@@ -0,0 +1,19 @@
|
||||
# This is a -*-perl-*- script
|
||||
#
|
||||
# Set variables that were defined by configure, in case we need them
|
||||
# during the tests.
|
||||
|
||||
%CONFIG_FLAGS = (
|
||||
AM_LDFLAGS => '@AM_LDFLAGS@',
|
||||
AR => '@AR@',
|
||||
CC => '@CC@',
|
||||
CFLAGS => '@CFLAGS@',
|
||||
CPP => '@CPP@',
|
||||
CPPFLAGS => '@CPPFLAGS@',
|
||||
GUILE_CFLAGS => '@GUILE_CFLAGS@',
|
||||
GUILE_LIBS => '@GUILE_LIBS@',
|
||||
LDFLAGS => '@LDFLAGS@',
|
||||
LIBS => '@LIBS@'
|
||||
);
|
||||
|
||||
1;
|
||||
53
tests/config_flags_pm.com
Executable file
53
tests/config_flags_pm.com
Executable file
@@ -0,0 +1,53 @@
|
||||
$!
|
||||
$! config_flags_pm.com - Build config-flags.pm on VMS.
|
||||
$!
|
||||
$! Just good enough to run the self tests for now.
|
||||
$!
|
||||
$! Copyright (C) 2014 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 <http://www.gnu.org/licenses/>.
|
||||
$!
|
||||
$!
|
||||
$ open/read cfpm_in config-flags.pm.in
|
||||
$!
|
||||
$ outfile = "sys$disk:[]config-flags.pm"
|
||||
$!
|
||||
$ cflags = "/include=([],[.glob]"
|
||||
$!
|
||||
$ create 'outfile'
|
||||
$ open/append cfpm 'outfile'
|
||||
$!
|
||||
$cfpm_read_loop:
|
||||
$ read cfpm_in/end=cfpm_read_loop_end line_in
|
||||
$ line_in_len = f$length(line_in)
|
||||
$ if f$locate("@", line_in) .lt. line_in_len
|
||||
$ then
|
||||
$ part1 = f$element(0, "@", line_in)
|
||||
$ key = f$element(1, "@", line_in)
|
||||
$ part2 = f$element(2, "@", line_in)
|
||||
$ value = ""
|
||||
$ if key .eqs. "CC" then value = "CC"
|
||||
$ if key .eqs. "CPP" then value = "CPP"
|
||||
$ if key .eqs. "CFLAGS" then value = cflags
|
||||
$ if key .eqs. "GUILE_CFLAGS" then value = cflags
|
||||
$ write cfpm part1, value, part2
|
||||
$ goto cfpm_read_loop
|
||||
$ endif
|
||||
$ write cfpm line_in
|
||||
$ goto cfpm_read_loop
|
||||
$cfpm_read_loop_end:
|
||||
$ close cfpm_in
|
||||
$ close cfpm
|
||||
$!
|
||||
@@ -3,7 +3,7 @@
|
||||
# Simple script to make a "shadow" test directory, using symbolic links.
|
||||
# Typically you'd put the shadow in /tmp or another local disk
|
||||
#
|
||||
# Copyright (C) 1992-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1992-2014 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
|
||||
|
||||
272
tests/run_make_tests.com
Executable file
272
tests/run_make_tests.com
Executable file
@@ -0,0 +1,272 @@
|
||||
$! Test_make.com
|
||||
$!
|
||||
$! This is a wrapper for the GNU make perl test programs on VMS.
|
||||
$!
|
||||
$! Parameter "-help" for description on how to use described below.
|
||||
$!
|
||||
$! Copyright (C) 2014 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 <http://www.gnu.org/licenses/>.
|
||||
$!
|
||||
$!
|
||||
$! Allow more than 8 paramters with using commas as a delimiter.
|
||||
$!
|
||||
$ params = "''p1',''p2',''p3',''p4',''p5',''p6',''p7',''p8'"
|
||||
$!
|
||||
$ test_flags = ",verbose,detail,keep,usage,help,debug,"
|
||||
$ test_flags_len = f$length(test_flags)
|
||||
$ verbose_flag = ""
|
||||
$ detail_flag = ""
|
||||
$ keep_flag = ""
|
||||
$ usage_flag = ""
|
||||
$ help_flag = ""
|
||||
$ debug_flag = ""
|
||||
$!
|
||||
$ ignored_options = "profile,make,srcdir,valgrind,memcheck,massif,"
|
||||
$ ignored_option_len = f$length(ignored_options)
|
||||
$!
|
||||
$ testname = ""
|
||||
$ make :== $bin:make.exe"
|
||||
$!
|
||||
$ i = 0
|
||||
$param_loop:
|
||||
$ param = f$element(i, ",", params)
|
||||
$ i = i + 1
|
||||
$ if param .eqs. "" then goto param_loop
|
||||
$ if param .eqs. "," then goto param_loop_end
|
||||
$ param_len = f$length(param)
|
||||
$ if f$locate("/", param) .lt. param_len
|
||||
$ then
|
||||
$ if testname .nes. ""
|
||||
$ then
|
||||
$ write sys$output "Only the last test name specified will be run!"
|
||||
$ endif
|
||||
$ testname = param
|
||||
$ goto param_loop
|
||||
$ endif
|
||||
$ lc_param = f$edit(param,"LOWERCASE") - "-"
|
||||
$ if f$locate(",''lc_param',", ignored_options) .lt. ignored_option_len
|
||||
$ then
|
||||
$ write sys$output "parameter ''param' is ignored on VMS for now."
|
||||
$ goto param_loop
|
||||
$ endif
|
||||
$ if f$locate(",''lc_param',", test_flags) .lt. test_flags_len
|
||||
$ then
|
||||
$ 'lc_param'_flag = "-" + lc_param
|
||||
$ goto param_loop
|
||||
$ endif
|
||||
$ write sys$output "parameter ''param' is not known to VMS."
|
||||
$ goto param_loop
|
||||
$!
|
||||
$param_loop_end:
|
||||
$!
|
||||
$no_gnv = 1
|
||||
$no_perl = 1
|
||||
$!
|
||||
$! Find GNV 2.1.3 + manditory updates
|
||||
$! If properly updated, the GNV$GNU logical name is present.
|
||||
$! Updated GNV utilities have a gnv$ prefix on them.
|
||||
$ gnv_root = f$trnlnm("GNV$GNU", "LNM$SYSTEM_TABLE")
|
||||
$ if gnv_root .nes. ""
|
||||
$ then
|
||||
$ no_gnv = 0
|
||||
$ ! Check for update ar utility.
|
||||
$ new_ar = "gnv$gnu:[usr.bin]gnv$ar.exe"
|
||||
$ if f$search(new_ar) .nes. ""
|
||||
$ then
|
||||
$ ! See if a new port of ar exists.
|
||||
$ ar :== $'new_ar'
|
||||
$ else
|
||||
$ ! Fall back to legacy GNV AR wrapper.
|
||||
$ old_ar = "gnv$gnu:[bin]ar.exe"
|
||||
$ if f$search(old_ar) .nes. ""
|
||||
$ then
|
||||
$ ar :== $'old_ar'
|
||||
$ else
|
||||
$ no_gnv = 1
|
||||
$ endif
|
||||
$ endif
|
||||
$ ! Check for updated bash
|
||||
$ if no_gnv .eq. 0
|
||||
$ then
|
||||
$ new_bash = "gnv$gnu:[bin]gnv$bash.exe"
|
||||
$ if f$search(new_bash) .nes. ""
|
||||
$ then
|
||||
$ bash :== $'new_bash'
|
||||
$ sh :== $'new_bash'
|
||||
$ else
|
||||
$ no_gnv = 1
|
||||
$ endif
|
||||
$ endif
|
||||
$ ! Check for updated coreutils
|
||||
$ if no_gnv .eq. 0
|
||||
$ then
|
||||
$ new_cat = "gnv$gnu:[bin]gnv$cat.exe"
|
||||
$ if f$search(new_cat) .nes. ""
|
||||
$ then
|
||||
$ cat :== $'new_cat'
|
||||
$ cp :== $gnv$gnu:[bin]gnv$cp.exe
|
||||
$ echo :== $gnv$gnu:[bin]gnv$echo.exe
|
||||
$ false :== $gnv$gnu:[bin]gnv$false.exe
|
||||
$ true :== $gnv$gnu:[bin]gnv$true.exe
|
||||
$ touch :== $gnv$gnu:[bin]gnv$touch.exe
|
||||
$ mkdir :== $gnv$gnu:[bin]gnv$mkdir.exe
|
||||
$ rm :== $gnv$gnu:[bin]gnv$rm.exe
|
||||
$ sleep :== $gnv$gnu:[bin]gnv$sleep.exe
|
||||
$ else
|
||||
$ no_gnv = 1
|
||||
$ endif
|
||||
$ endif
|
||||
$ ! Check for updated diff utility.
|
||||
$ if no_gnv .eq. 0
|
||||
$ then
|
||||
$ new_diff = "gnv$gnu:[usr.bin]gnv$diff.exe"
|
||||
$ if f$search(new_diff) .nes. ""
|
||||
$ then
|
||||
$ ! See if a new port of diff exists.
|
||||
$ diff :== $'new_diff'
|
||||
$ else
|
||||
$ ! Fall back to legacy GNV diff
|
||||
$ old_diff = "gnv$gnu:[bin]diff.exe"
|
||||
$ if f$search(old_diff) .nes. ""
|
||||
$ then
|
||||
$ diff :== $'old_diff'
|
||||
$ else
|
||||
$ no_gnv = 1
|
||||
$ endif
|
||||
$ endif
|
||||
$ endif
|
||||
$ endif
|
||||
$!
|
||||
$if no_gnv
|
||||
$then
|
||||
$ write sys$output "Could not find an up to date GNV installed!"
|
||||
$ help_flag = 1
|
||||
$endif
|
||||
$!
|
||||
$! Find perl 5.18.1 or later.
|
||||
$!
|
||||
$! look in perl_root:[000000]perl_setup.com
|
||||
$ perl_root = f$trnlnm("perl_root")
|
||||
$ ! This works with known perl installed from PCSI kits.
|
||||
$ if perl_root .nes. ""
|
||||
$ then
|
||||
$ perl_ver = f$element(1, ".", perl_root)
|
||||
$ if f$locate("-", perl_ver) .lt. f$length(perl_ver)
|
||||
$ then
|
||||
$ no_perl = 0
|
||||
$ endif
|
||||
$ endif
|
||||
$ if no_perl
|
||||
$ then
|
||||
$! look for sys$common:[perl-*]perl_setup.com
|
||||
$ perl_setup = f$search("sys$common:[perl-*]perl_setup.com")
|
||||
$ if perl_setup .eqs. ""
|
||||
$ then
|
||||
$ if gnv_root .nes. ""
|
||||
$ then
|
||||
$ gnv_device = f$parse(gnv_root,,,"DEVICE")
|
||||
$ perl_templ = "[vms$common.perl-*]perl_setup.com"
|
||||
$ perl_search = f$parse(perl_templ, gnv_device)
|
||||
$ perl_setup = f$search(perl_search)
|
||||
$ endif
|
||||
$ endif
|
||||
$ if perl_setup .nes. ""
|
||||
$ then
|
||||
$ @'perl_setup'
|
||||
$ no_perl = 0
|
||||
$ endif
|
||||
$ endif
|
||||
$!
|
||||
$ if no_perl
|
||||
$ then
|
||||
$ write sys$output "Could not find an up to date Perl installed!"
|
||||
$ help_flag = "-help"
|
||||
$ endif
|
||||
$!
|
||||
$!
|
||||
$ if help_flag .nes. ""
|
||||
$ then
|
||||
$ type sys$input
|
||||
$DECK
|
||||
This is a test script wrapper for the run_make_tests.pl script.
|
||||
|
||||
This wrapper makes sure that the DCL symbols and logical names needed to
|
||||
run the perl script are in place.
|
||||
|
||||
The test wrapper currently requires that the DCL symbols be global symbols.
|
||||
Those symbols will be left behind after the procedure is run.
|
||||
|
||||
The PERL_ROOT will be set to a compatible perl if such a perl is found and
|
||||
is not the default PERL_ROOT:. This setting will persist after the test.
|
||||
|
||||
This wrapper should be run with the default set to the base directory
|
||||
of the make source.
|
||||
|
||||
The HELP parameter will bring up this text and then run the help script
|
||||
for the Perl wrapper. Not all options for the perl script have been
|
||||
implemented, such as valgrind or specifying the make path or source path.
|
||||
|
||||
Running the wrapper script requires:
|
||||
Perl 5.18 or later.
|
||||
PCSI kits available from http://sourceforge.net/projects/vmsperlkit/files/
|
||||
|
||||
GNV 2.1.3 or later. GNV 3.0.1 has not tested with this script.
|
||||
Bash 4.2.47 or later.
|
||||
Coreutils 8.21 or later.
|
||||
http://sourceforge.net/projects/gnv/files/
|
||||
Read before installing:
|
||||
http://sourceforge.net/p/gnv/wiki/InstallingGNVPackages/
|
||||
As updates for other GNV components get posted, those updates should
|
||||
be used.
|
||||
|
||||
$EOD
|
||||
$ endif
|
||||
$!
|
||||
$ if no_gnv .or. no_perl then exit 44
|
||||
$!
|
||||
$!
|
||||
$ make := $bin:make.exe
|
||||
$ default = f$environment("DEFAULT")
|
||||
$ this = f$environment("PROCEDURE")
|
||||
$ on error then goto all_error
|
||||
$ set default 'f$parse(this,,,"DEVICE")''f$parse(this,,,"DIRECTORY")'
|
||||
$!
|
||||
$! Need to make sure that the config-flags.pm exists.
|
||||
$ if f$search("config-flags.pm") .eqs. ""
|
||||
$ then
|
||||
$ @config_flags_pm.com
|
||||
$ endif
|
||||
$ define/user bin 'default',gnv$gnu:[bin]
|
||||
$ define/user decc$filename_unix_noversion enable
|
||||
$ define/user decc$filename_unix_report enable
|
||||
$ define/user decc$readdir_dropdotnotype enable
|
||||
$ flags = ""
|
||||
$ if verbose_flag .nes. "" then flags = verbose_flag
|
||||
$ if detail_flag .nes. "" then flags = flags + " " + detail_flag
|
||||
$ if keep_flag .nes. "" then flags = flags + " " + keep_flag
|
||||
$ if usage_flag .nes. "" then flags = flags + " " + usage_flag
|
||||
$ if help_flag .nes. "" then flags = flags + " " + help_flag
|
||||
$ if debug_flag .nes. "" then flags = flags + " " + debug_flag
|
||||
$ flags = f$edit(flags, "TRIM, COMPRESS")
|
||||
$ if testname .nes. ""
|
||||
$ then
|
||||
$ perl run_make_tests.pl "''testname'" 'flags'
|
||||
$ else
|
||||
$ perl run_make_tests.pl 'flags'
|
||||
$ endif
|
||||
$all_error:
|
||||
$ set default 'default'
|
||||
$!
|
||||
@@ -11,7 +11,7 @@
|
||||
# [-make <make prog>]
|
||||
# (and others)
|
||||
|
||||
# Copyright (C) 1992-2013 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1992-2014 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
|
||||
@@ -42,7 +42,24 @@ $command_string = '';
|
||||
|
||||
$all_tests = 0;
|
||||
|
||||
# rmdir broken in some Perls on VMS.
|
||||
if ($^O eq 'VMS')
|
||||
{
|
||||
require VMS::Filespec;
|
||||
VMS::Filespec->import();
|
||||
|
||||
sub vms_rmdir {
|
||||
my $vms_file = vmspath($_[0]);
|
||||
$vms_file = fileify($vms_file);
|
||||
my $ret = unlink(vmsify($vms_file));
|
||||
return $ret
|
||||
};
|
||||
|
||||
*CORE::GLOBAL::rmdir = \&vms_rmdir;
|
||||
}
|
||||
|
||||
require "test_driver.pl";
|
||||
require "config-flags.pm";
|
||||
|
||||
# Some target systems might not have the POSIX module...
|
||||
$has_POSIX = eval { require "POSIX.pm" };
|
||||
@@ -177,6 +194,40 @@ sub run_make_with_options {
|
||||
}
|
||||
|
||||
if ($options) {
|
||||
if ($^O eq 'VMS') {
|
||||
# Try to make sure arguments are properly quoted.
|
||||
# This does not handle all cases.
|
||||
|
||||
# VMS uses double quotes instead of single quotes.
|
||||
$options =~ s/\'/\"/g;
|
||||
|
||||
# If the leading quote is inside non-whitespace, then the
|
||||
# quote must be doubled, because it will be enclosed in another
|
||||
# set of quotes.
|
||||
$options =~ s/(\S)(\".*\")/$1\"$2\"/g;
|
||||
|
||||
# Options must be quoted to preserve case if not already quoted.
|
||||
$options =~ s/(\S+)/\"$1\"/g;
|
||||
|
||||
# Special fixup for embedded quotes.
|
||||
$options =~ s/(\"\".+)\"(\s+)\"(.+\"\")/$1$2$3/g;
|
||||
|
||||
$options =~ s/(\A)(?:\"\")(.+)(?:\"\")/$1\"$2\"/g;
|
||||
|
||||
# Special fixup for misc/general4 test.
|
||||
$options =~ s/""\@echo" "cc""/\@echo cc"/;
|
||||
$options =~ s/"\@echo link"""/\@echo link"/;
|
||||
|
||||
# Remove shell escapes expected to be removed by bash
|
||||
if ($options !~ /path=pre/) {
|
||||
$options =~ s/\\//g;
|
||||
}
|
||||
|
||||
# special fixup for options/eval
|
||||
$options =~ s/"--eval=\$\(info" "eval/"--eval=\$\(info eval/;
|
||||
|
||||
print ("Options fixup = -$options-\n") if $debug;
|
||||
}
|
||||
$command .= " $options";
|
||||
}
|
||||
|
||||
@@ -195,7 +246,6 @@ sub run_make_with_options {
|
||||
$valgrind and $test_timeout = 0;
|
||||
|
||||
$code = &run_command_with_output($logname,$command);
|
||||
|
||||
$test_timeout = $old_timeout;
|
||||
}
|
||||
|
||||
@@ -326,19 +376,28 @@ sub set_more_defaults
|
||||
|
||||
# Find the full pathname of Make. For DOS systems this is more
|
||||
# complicated, so we ask make itself.
|
||||
my $mk = `sh -c 'echo "all:;\@echo \\\$(MAKE)" | $make_path -f-'`;
|
||||
chop $mk;
|
||||
$mk or die "FATAL ERROR: Cannot determine the value of \$(MAKE):\n
|
||||
if ($osname eq 'VMS') {
|
||||
# On VMS pre-setup make to be found with simply 'make'.
|
||||
$make_path = 'make';
|
||||
} else {
|
||||
my $mk = `sh -c 'echo "all:;\@echo \\\$(MAKE)" | $make_path -f-'`;
|
||||
chop $mk;
|
||||
$mk or die "FATAL ERROR: Cannot determine the value of \$(MAKE):\n
|
||||
'echo \"all:;\@echo \\\$(MAKE)\" | $make_path -f-' failed!\n";
|
||||
$make_path = $mk;
|
||||
$make_path = $mk;
|
||||
}
|
||||
print "Make\t= '$make_path'\n" if $debug;
|
||||
|
||||
$string = `$make_path -v -f /dev/null 2> /dev/null`;
|
||||
my $redir2 = '2> /dev/null';
|
||||
$redir2 = '' if os_name eq 'VMS';
|
||||
$string = `$make_path -v -f /dev/null $redir2`;
|
||||
|
||||
$string =~ /^(GNU Make [^,\n]*)/;
|
||||
$testee_version = "$1\n";
|
||||
|
||||
$string = `sh -c "$make_path -f /dev/null 2>&1"`;
|
||||
my $redir = '2>&1';
|
||||
$redir = '' if os_name eq 'VMS';
|
||||
$string = `sh -c "$make_path -f /dev/null $redir"`;
|
||||
if ($string =~ /(.*): \*\*\* No targets\. Stop\./) {
|
||||
$make_name = $1;
|
||||
}
|
||||
@@ -387,7 +446,7 @@ sub set_more_defaults
|
||||
$purify_errors = 0;
|
||||
}
|
||||
|
||||
$string = `sh -c "$make_path -j 2 -f /dev/null 2>&1"`;
|
||||
$string = `sh -c "$make_path -j 2 -f /dev/null $redir"`;
|
||||
if ($string =~ /not supported/) {
|
||||
$parallel_jobs = 0;
|
||||
}
|
||||
|
||||
@@ -11,32 +11,34 @@ exists $FEATURES{archives} or return -1;
|
||||
# Create some .o files to work with
|
||||
utouch(-60, qw(a1.o a2.o a3.o));
|
||||
|
||||
my $ar = $CONFIG_FLAGS{AR};
|
||||
|
||||
# Some versions of ar print different things on creation. Find out.
|
||||
my $created = `ar rv libxx.a a1.o 2>&1`;
|
||||
my $created = `$ar rv libxx.a a1.o 2>&1`;
|
||||
|
||||
# Some versions of ar print different things on add. Find out.
|
||||
my $add = `ar rv libxx.a a2.o 2>&1`;
|
||||
my $add = `$ar rv libxx.a a2.o 2>&1`;
|
||||
$add =~ s/a2\.o/#OBJECT#/g;
|
||||
|
||||
# Some versions of ar print different things on replacement. Find out.
|
||||
my $repl = `ar rv libxx.a a2.o 2>&1`;
|
||||
my $repl = `$ar rv libxx.a a2.o 2>&1`;
|
||||
$repl =~ s/a2\.o/#OBJECT#/g;
|
||||
|
||||
unlink('libxx.a');
|
||||
|
||||
# Very simple
|
||||
run_make_test('all: libxx.a(a1.o)',
|
||||
'', "ar rv libxx.a a1.o\n$created");
|
||||
'', "$ar rv libxx.a a1.o\n$created");
|
||||
|
||||
# Multiple .o's. Add a new one to the existing library
|
||||
($_ = $add) =~ s/#OBJECT#/a2.o/g;
|
||||
run_make_test('all: libxx.a(a1.o a2.o)',
|
||||
'', "ar rv libxx.a a2.o\n$_");
|
||||
'', "$ar rv libxx.a a2.o\n$_");
|
||||
|
||||
# Touch one of the .o's so it's rebuilt
|
||||
utouch(-40, 'a1.o');
|
||||
($_ = $repl) =~ s/#OBJECT#/a1.o/g;
|
||||
run_make_test(undef, '', "ar rv libxx.a a1.o\n$_");
|
||||
run_make_test(undef, '', "$ar rv libxx.a a1.o\n$_");
|
||||
|
||||
# Use wildcards
|
||||
run_make_test('all: libxx.a(*.o)',
|
||||
@@ -45,21 +47,21 @@ run_make_test('all: libxx.a(*.o)',
|
||||
# Touch one of the .o's so it's rebuilt
|
||||
utouch(-30, 'a1.o');
|
||||
($_ = $repl) =~ s/#OBJECT#/a1.o/g;
|
||||
run_make_test(undef, '', "ar rv libxx.a a1.o\n$_");
|
||||
run_make_test(undef, '', "$ar rv libxx.a a1.o\n$_");
|
||||
|
||||
# Use both wildcards and simple names
|
||||
utouch(-50, 'a2.o');
|
||||
($_ = $add) =~ s/#OBJECT#/a3.o/g;
|
||||
$_ .= "ar rv libxx.a a2.o\n";
|
||||
$_ .= "$ar rv libxx.a a2.o\n";
|
||||
($_ .= $repl) =~ s/#OBJECT#/a2.o/g;
|
||||
run_make_test('all: libxx.a(a3.o *.o)', '',
|
||||
"ar rv libxx.a a3.o\n$_");
|
||||
"$ar rv libxx.a a3.o\n$_");
|
||||
|
||||
# Check whitespace handling
|
||||
utouch(-40, 'a2.o');
|
||||
($_ = $repl) =~ s/#OBJECT#/a2.o/g;
|
||||
run_make_test('all: libxx.a( a3.o *.o )', '',
|
||||
"ar rv libxx.a a2.o\n$_");
|
||||
"$ar rv libxx.a a2.o\n$_");
|
||||
|
||||
rmfiles(qw(a1.o a2.o a3.o libxx.a));
|
||||
|
||||
|
||||
@@ -40,3 +40,5 @@ if ($case_sensitive) {
|
||||
compare_output("It chose Makefile\n",&get_logfile(1));
|
||||
unlink("Makefile");
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user