mirror of
https://github.com/mirror/make.git
synced 2026-08-20 17:03:27 +08:00
Compare commits
60 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4b3bf7f97 | ||
|
|
d18a87d0a4 | ||
|
|
41c35f2ffe | ||
|
|
deb4a42c3e | ||
|
|
252c26bd20 | ||
|
|
6f8da5f4b8 | ||
|
|
c46b5a9e0e | ||
|
|
b4157d2ff4 | ||
|
|
f364e0d8d6 | ||
|
|
bb0c05a7f0 | ||
|
|
f987d181c4 | ||
|
|
cad3ddd165 | ||
|
|
54214176b1 | ||
|
|
c2f92c980f | ||
|
|
5b1ca277ca | ||
|
|
7c71df5695 | ||
|
|
a0956c1803 | ||
|
|
4ec74e568d | ||
|
|
d9fc1ac5d2 | ||
|
|
9f55e9fd13 | ||
|
|
7bb7bb4ba4 | ||
|
|
b79791533b | ||
|
|
9d24d41801 | ||
|
|
2d943d3d2e | ||
|
|
b16913a67e | ||
|
|
72ee43c473 | ||
|
|
e5e538fb7a | ||
|
|
c453f898a0 | ||
|
|
18c4b508ef | ||
|
|
383eb3a923 | ||
|
|
01b1d4f401 | ||
|
|
bf2d71498c | ||
|
|
3e20e376b7 | ||
|
|
7ddfc42ee3 | ||
|
|
ca92d83cde | ||
|
|
ae80eefe65 | ||
|
|
01142a53c9 | ||
|
|
dee6af912a | ||
|
|
7296991d6c | ||
|
|
d51ac70122 | ||
|
|
3cb84fe933 | ||
|
|
ad84ec2fdc | ||
|
|
26b9f30714 | ||
|
|
5ac80176a3 | ||
|
|
c801a7fb67 | ||
|
|
c2eddf9be2 | ||
|
|
f8852311cc | ||
|
|
a99378ebe4 | ||
|
|
6c87f3fb85 | ||
|
|
38116baee9 | ||
|
|
614033f8c6 | ||
|
|
f3640ecf4f | ||
|
|
c4e232e44f | ||
|
|
aa99e810a9 | ||
|
|
8f49029561 | ||
|
|
f7ed583675 | ||
|
|
cf7f7de7ae | ||
|
|
d4cb7ae6d4 | ||
|
|
387d349dc8 | ||
|
|
caad0e2181 |
14
.gitignore
vendored
14
.gitignore
vendored
@@ -34,7 +34,7 @@ config.log
|
||||
config.status
|
||||
configure
|
||||
/mk/Posix.mk
|
||||
stamp-h1
|
||||
stamp-*
|
||||
.dirstamp
|
||||
gnulib
|
||||
convert.sed
|
||||
@@ -60,19 +60,17 @@ WinRel/
|
||||
GccDebug/
|
||||
GccRel/
|
||||
|
||||
# Test artifacts
|
||||
makeerror-*.tar.gz
|
||||
test-suite.log
|
||||
|
||||
# Distribution artifacts
|
||||
.dep_segment
|
||||
.check-git-HEAD
|
||||
ChangeLog
|
||||
README
|
||||
README.DOS
|
||||
README.OS2
|
||||
README.W32
|
||||
build.cfg
|
||||
config.ami
|
||||
config.h-vms
|
||||
config.h.W32
|
||||
configh.dos
|
||||
mkconfig.h
|
||||
make-[0-9]*/
|
||||
make-[0-9]*.tar.*
|
||||
checkcfg.*.log
|
||||
|
||||
23
AUTHORS
23
AUTHORS
@@ -1,15 +1,17 @@
|
||||
-----------------------------------
|
||||
|
||||
GNU make development up to version 3.75 by:
|
||||
Roland McGrath <roland@gnu.org>
|
||||
|
||||
|
||||
Development starting with GNU make 3.76 by:
|
||||
GNU Make development starting with GNU Make 3.76 by:
|
||||
Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
Additional development starting with GNU make 3.81 by:
|
||||
Additional development starting with GNU Make 4.3 by:
|
||||
Dmitry Goncharov <dgoncharov@users.sf.net>
|
||||
|
||||
Additional development starting with GNU Make 3.81 by:
|
||||
Boris Kolpackov <boris@kolpackov.net>
|
||||
|
||||
GNU Make development up to version 3.75 by:
|
||||
Roland McGrath <roland@gnu.org>
|
||||
|
||||
GNU Make User's Manual
|
||||
Written by:
|
||||
Richard M. Stallman <rms@gnu.org>
|
||||
@@ -21,7 +23,7 @@ GNU Make User's Manual
|
||||
Paul D. Smith <psmith@gnu.org>
|
||||
|
||||
-----------------------------------
|
||||
GNU make porting efforts:
|
||||
GNU Make porting efforts:
|
||||
|
||||
Port to VMS by:
|
||||
Klaus Kaempf <kkaempf@progis.de>
|
||||
@@ -44,6 +46,7 @@ GNU make porting efforts:
|
||||
Andreas Beuning <andreas.buening@nexgo.de>
|
||||
Earnie Boyd <earnie@uses.sf.net>
|
||||
Troy Runkel <Troy.Runkel@mathworks.com>
|
||||
Juan M. Guerrero <juan.guerrero@gmx.de>
|
||||
|
||||
-----------------------------------
|
||||
Other contributors:
|
||||
@@ -63,7 +66,7 @@ Other contributors:
|
||||
Paul Eggert <eggert@twinsun.com>
|
||||
Mike Frysinger <vapier@gentoo.org>
|
||||
Ramon Garcia Fernandez <ramon.garcia.f@gmail.com>
|
||||
Dmitry Goncharov <dgoncharov@users.sf.net>
|
||||
Noah Goldstein <goldstein.w.n@gmail.com>
|
||||
Mike Haboustak <haboustak@gmail.com>
|
||||
Frank Heckenbach <f.heckenbach@fh-soft.de>
|
||||
Klaus Heinz <kamar@ease.rhein-main.de>
|
||||
@@ -85,7 +88,7 @@ Other contributors:
|
||||
Thomas Riedl <thomas.riedl@siemens.com>
|
||||
Jaak Ristioja <jaak@ristioja.ee>
|
||||
Christoph Schulz <develop@kristov.de>
|
||||
Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
|
||||
Andreas Schwab <schwab@suse.de>
|
||||
spagoveanu <spagoveanu@gmail.com>
|
||||
Carl Staelin (Princeton University)
|
||||
Ian Stewartson (Data Logic Limited)
|
||||
@@ -116,4 +119,4 @@ 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/>.
|
||||
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
# 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/>.
|
||||
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
all:
|
||||
|
||||
@@ -39,7 +39,6 @@ w32_SOURCES = %w32_SOURCES%
|
||||
vms_SOURCES = %vms_SOURCES%
|
||||
amiga_SOURCES = %amiga_SOURCES%
|
||||
|
||||
posix_SOURCES = $(src)posixos.c
|
||||
remote_SOURCES = $(src)remote-stub.c
|
||||
|
||||
OUTDIR =
|
||||
@@ -104,9 +103,7 @@ CP.cmd = cp $1 $2
|
||||
CLEANSPACE = $(call RM.cmd,$(OBJECTS) $(PROG) $(BUILT_SOURCES))
|
||||
|
||||
# Load overrides for the above variables.
|
||||
include $(firstword $(wildcard $(SRCDIR)/mk/$(lastword $(subst -, ,$(MAKE_HOST)).mk) $(OUTDIR)mk/Posix.mk $(SRCDIR)/mk/Posix.mk))
|
||||
|
||||
VERSION = %VERSION%
|
||||
include $(firstword $(wildcard $(SRCDIR)/mk/$(lastword $(subst -, ,$(MAKE_HOST)).mk)))
|
||||
|
||||
VPATH = $(SRCDIR)
|
||||
|
||||
|
||||
@@ -4994,4 +4994,4 @@ 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/>.
|
||||
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
@@ -1322,7 +1322,7 @@
|
||||
non-standard versions of free() don't like it.
|
||||
|
||||
* configure.in (--enable-dmalloc): Install some support for using
|
||||
dmalloc (http://www.dmalloc.com/) with make. Use --enable-dmalloc
|
||||
dmalloc (https://www.dmalloc.com/) with make. Use --enable-dmalloc
|
||||
with configure to enable it.
|
||||
|
||||
* function.c (function_table_entry): Whoops! The function.c
|
||||
@@ -6632,7 +6632,7 @@ Fri Nov 1 19:34:28 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
|
||||
|
||||
See ChangeLog.1, available in the Git repository at:
|
||||
|
||||
http://git.savannah.gnu.org/cgit/make.git/tree/
|
||||
https://git.savannah.gnu.org/cgit/make.git/tree/
|
||||
|
||||
for earlier changes.
|
||||
|
||||
@@ -6650,4 +6650,4 @@ 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/>.
|
||||
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
10
ChangeLog.3
10
ChangeLog.3
@@ -664,7 +664,7 @@
|
||||
characters in its name, pass NULL as the first argument to
|
||||
CreateProcess. This avoids weird failures due to buggy quoting by
|
||||
CreateProcess. For the details, see the discussion starting at
|
||||
http://lists.gnu.org/archive/html/make-w32/2013-04/msg00008.html.
|
||||
https://lists.gnu.org/archive/html/make-w32/2013-04/msg00008.html.
|
||||
|
||||
* load.c (load_object, load_file): Accept an additional argument
|
||||
DLP and return in it a pointer that can be used to unload the
|
||||
@@ -706,7 +706,7 @@
|
||||
(construct_command_argv_internal): Don't treat a backslash as an
|
||||
escape character before whitespace, if the shell is not a Posix
|
||||
shell. For the description of the problem, see
|
||||
http://lists.gnu.org/archive/html/make-w32/2013-04/msg00014.html.
|
||||
https://lists.gnu.org/archive/html/make-w32/2013-04/msg00014.html.
|
||||
|
||||
2013-05-01 Paul Smith <psmith@gnu.org>
|
||||
|
||||
@@ -1392,7 +1392,7 @@
|
||||
2011-09-16 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* maintMakefile (do-po-update): Apparently we have to avoid
|
||||
certificate checks on the http://translationproject.org site now.
|
||||
certificate checks on the https://translationproject.org site now.
|
||||
|
||||
2011-09-12 Paul Smith <psmith@gnu.org>
|
||||
|
||||
@@ -5612,7 +5612,7 @@
|
||||
|
||||
See ChangeLog.2, available in the Git repository at:
|
||||
|
||||
http://git.savannah.gnu.org/cgit/make.git/tree/
|
||||
https://git.savannah.gnu.org/cgit/make.git/tree/
|
||||
|
||||
for earlier changes.
|
||||
|
||||
@@ -5630,4 +5630,4 @@ 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/>.
|
||||
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
32
Makefile.am
32
Makefile.am
@@ -14,7 +14,7 @@
|
||||
# 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/>.
|
||||
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
AUTOMAKE_OPTIONS = dist-lzip silent-rules std-options subdir-objects nostdinc
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
@@ -112,7 +112,7 @@ test_FILES = tests/run_make_tests tests/run_make_tests.bat \
|
||||
# test/scripts are added via dist-hook below.
|
||||
|
||||
EXTRA_DIST = ChangeLog INSTALL README build.sh build.cfg.in $(man_MANS) \
|
||||
README.customs README.OS2 \
|
||||
src/mkconfig.h README.customs README.OS2 \
|
||||
README.Amiga SCOPTIONS src/config.ami \
|
||||
README.DOS builddos.bat src/configh.dos \
|
||||
README.W32 build_w32.bat src/config.h.W32 \
|
||||
@@ -137,14 +137,14 @@ src/gmk-default.h: $(top_srcdir)/src/gmk-default.scm
|
||||
dist-hook:
|
||||
(cd $(top_srcdir); \
|
||||
sub=`find tests/scripts -follow \( -name .git -o -name .deps -o -name work -o -name .gitignore -o -name \*.orig -o -name \*.rej -o -name \*~ -o -name \*.out -o -name Makefile \) -prune -o -type f -print`; \
|
||||
tar chf - $$sub) \
|
||||
| (cd $(distdir); tar xfBp -)
|
||||
$(AMTAR) chf - $$sub) \
|
||||
| (cd $(distdir); $(AMTAR) xfBp -)
|
||||
|
||||
|
||||
# --------------- Local CHECK Section
|
||||
|
||||
check-local: check-regression
|
||||
@banner=" Regression PASSED: GNU Make $(VERSION) ($(MAKE_HOST)) built with $(CC) "; \
|
||||
@banner=" Regression PASSED: $(PACKAGE_STRING) ($(MAKE_HOST)) built with $(CC) "; \
|
||||
dashes=`echo "$$banner" | sed s/./=/g`; \
|
||||
echo; \
|
||||
echo "$$dashes"; \
|
||||
@@ -162,9 +162,19 @@ MAKETESTFLAGS =
|
||||
|
||||
.PHONY: check-regression
|
||||
|
||||
GMK_OUTDIR=..
|
||||
GMK_OUTDIR = ..
|
||||
|
||||
testlog = test-suite.log
|
||||
testresult = tests/.test-result
|
||||
errorfile = makeerror-$(host_triplet).tar.gz
|
||||
|
||||
testfiles = $(testlog) $(testresult) $(errorfile)
|
||||
MOSTLYCLEANFILES = $(testfiles)
|
||||
|
||||
errordetails = config.status config.log src/config.h $(testlog) tests/work
|
||||
|
||||
check-regression: tests/config-flags.pm
|
||||
@rm -f $(testfiles)
|
||||
@if test -f '$(top_srcdir)/tests/run_make_tests'; then \
|
||||
ulimit -n 128; \
|
||||
if $(PERL) -v >/dev/null 2>&1; then \
|
||||
@@ -177,12 +187,18 @@ check-regression: tests/config-flags.pm
|
||||
done; fi ;; \
|
||||
esac; \
|
||||
echo "cd tests && $(PERL) $(PERLFLAGS) ./run_make_tests.pl -srcdir $(abs_top_srcdir) -make $(GMK_OUTDIR)/make$(EXEEXT) $(MAKETESTFLAGS)"; \
|
||||
cd tests && $(PERL) $(PERLFLAGS) ./run_make_tests.pl -srcdir '$(abs_top_srcdir)' -make '$(GMK_OUTDIR)/make$(EXEEXT)' $(MAKETESTFLAGS); \
|
||||
(cd tests && $(PERL) $(PERLFLAGS) ./run_make_tests.pl -srcdir '$(abs_top_srcdir)' -make '$(GMK_OUTDIR)/make$(EXEEXT)' $(MAKETESTFLAGS); echo $$? >.test-result) 2>&1 | tee $(testlog); \
|
||||
er=$$(cat $(testresult)); if test "$$er" -ne 0; then \
|
||||
$(AMTAR) chf - $(errordetails) | eval GZIP= gzip $(GZIP_ENV) -c >$(errorfile); \
|
||||
echo '*** Testing failed! Details saved in: $(errorfile)'; \
|
||||
echo '*** Please report to <$(PACKAGE_BUGREPORT)>'; echo; \
|
||||
exit $$er; \
|
||||
fi; \
|
||||
else \
|
||||
echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
|
||||
fi; \
|
||||
else \
|
||||
echo "Can't find the GNU Make test suite ($(top_srcdir)/tests)."; \
|
||||
echo "Can't find the $(PACKAGE_NAME) test suite ($(top_srcdir)/tests)."; \
|
||||
fi
|
||||
|
||||
|
||||
|
||||
96
NEWS
96
NEWS
@@ -1,20 +1,56 @@
|
||||
GNU make NEWS -*-indented-text-*-
|
||||
GNU Make NEWS -*-indented-text-*-
|
||||
History of user-visible changes.
|
||||
20 September 2022
|
||||
24 October 2022
|
||||
|
||||
See the end of this file for copyrights and conditions.
|
||||
|
||||
All user-visible changes are more fully described in the GNU make manual,
|
||||
All user-visible changes are more fully described in the GNU Make 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
|
||||
See the README file and the GNU Make manual for instructions for
|
||||
reporting bugs.
|
||||
|
||||
Version 4.3.90 (20 Sep 2022)
|
||||
Version 4.3.92 (24 Oct 2022)
|
||||
|
||||
A complete list of bugs fixed in this version is available here:
|
||||
|
||||
https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=109&set=custom
|
||||
|
||||
* WARNING: Deprecation!
|
||||
The following systems are deprecated in this release:
|
||||
- OS/2 (EMX)
|
||||
- AmigaOS
|
||||
- Xenix
|
||||
- Cray
|
||||
In the NEXT release of GNU Make, support for these systems will be removed.
|
||||
If you want to see them continue to be supported, contact <bug-make@gnu.org>.
|
||||
|
||||
* WARNING: Future backward-incompatibility!
|
||||
In the NEXT release of GNU Make, pattern rules will implement the same
|
||||
behavior change for multiple targets as explicit grouped targets, below: if
|
||||
any target of the rule is needed by the build, the recipe will be invoked if
|
||||
any target of the rule is missing or out of date. During testing some
|
||||
makefiles were found to contain pattern rules that do not build all targets;
|
||||
this can cause issues so we are delaying this change for one release cycle
|
||||
to allow these makefiles to be updated. GNU Make shows a warning if it
|
||||
detects this situation: "pattern recipe did not update peer target".
|
||||
|
||||
* WARNING: Backward-incompatibility!
|
||||
GNU Make now uses temporary files in more situations than previous releases.
|
||||
If your build system sets TMPDIR (or TMP or TEMP on Windows) and deletes the
|
||||
contents during the build, or uses restrictive permissions, this may cause
|
||||
problems. You can choose an alternative temporary directory only for use by
|
||||
GNU Make by setting the new MAKE_TMPDIR environment variable before invoking
|
||||
make. Note that this value CANNOT be set inside the makefile, since make
|
||||
needs to find its temporary directory before the makefiles are parsed.
|
||||
|
||||
* WARNING: Backward-incompatibility!
|
||||
Previously each target in a explicit grouped target rule was considered
|
||||
individually: if the targets needed by the build were not out of date the
|
||||
recipe was not run even if other targets in the group were out of date. Now
|
||||
if any of the grouped targets are needed by the build, then if any of the
|
||||
grouped targets are out of date the recipe is run and all targets in the
|
||||
group are considered updated.
|
||||
|
||||
* WARNING: Backward-incompatibility!
|
||||
Previously if --no-print-directory was seen anywhere in the environment or
|
||||
command line it would take precedence over any --print-directory. Now, the
|
||||
@@ -26,7 +62,7 @@ https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=109&se
|
||||
stated, but it was (roughly) the inverse of the order in which they were
|
||||
processed by make. In this release, the order in which makefiles are
|
||||
rebuilt is the same order in which make processed them, and this is defined
|
||||
to be true in the GNU make manual.
|
||||
to be true in the GNU Make manual.
|
||||
|
||||
* WARNING: Backward-incompatibility!
|
||||
Previously only simple (one-letter) options were added to the MAKEFLAGS
|
||||
@@ -43,14 +79,14 @@ https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=109&se
|
||||
To detect this change search for 'shell-export' in the .FEATURES variable.
|
||||
|
||||
* WARNING: New build requirement
|
||||
GNU make utilizes facilities from GNU Gnulib: Gnulib requires certain C99
|
||||
features in the C compiler and so these features are required by GNU make:
|
||||
GNU Make utilizes facilities from GNU Gnulib: Gnulib requires certain C99
|
||||
features in the C compiler and so these features are required by GNU Make:
|
||||
https://www.gnu.org/software/gnulib/manual/html_node/C99-features-assumed.html
|
||||
The configure script should verify the compiler has these features.
|
||||
|
||||
* New feature: The .WAIT special target
|
||||
If the .WAIT target appears between two prerequisites of a target, then
|
||||
GNU make will wait for all of the targets to the left of .WAIT in the list
|
||||
GNU Make will wait for all of the targets to the left of .WAIT in the list
|
||||
to complete before starting any of the targets to the right of .WAIT.
|
||||
This feature is available in some other versions of make, and it will be
|
||||
required by an upcoming version of the POSIX standard for make.
|
||||
@@ -64,7 +100,7 @@ https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=109&se
|
||||
each prerequisite).
|
||||
|
||||
* New feature: The .NOTINTERMEDIATE special target
|
||||
.NOTINTERMEDIATE Disables intermediate behavior for specific files, for all
|
||||
.NOTINTERMEDIATE disables intermediate behavior for specific files, for all
|
||||
files built using a pattern, or for the entire makefile.
|
||||
Implementation provided by Dmitry Goncharov <dgoncharov@users.sf.net>
|
||||
|
||||
@@ -80,7 +116,7 @@ https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=109&se
|
||||
Implementation provided by Jouke Witteveen <j.witteveen@gmail.com>
|
||||
|
||||
* New feature: Improved support for -l / --load-average
|
||||
On systems that provide /proc/loadavg (Linux), GNU make will use it to
|
||||
On systems that provide /proc/loadavg (Linux), GNU Make will use it to
|
||||
determine the number of runnable jobs and use this as the current load,
|
||||
avoiding the need for heuristics.
|
||||
Implementation provided by Sven C. Dack <sdack@gmx.com>
|
||||
@@ -95,24 +131,16 @@ https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=109&se
|
||||
* New feature: The --jobserver-style command line option and named pipes
|
||||
A new jobserver method is used on systems where mkfifo(3) is supported.
|
||||
This solves a number of obscure issues related to using the jobserver
|
||||
and recursive invocations of GNU make. This change means that sub-makes
|
||||
and recursive invocations of GNU Make. This change means that sub-makes
|
||||
will connect to the jobserver even if they are not marked as recursive.
|
||||
It also means that other tools that want to participate in the jobserver
|
||||
will need to be enhanced as described in the GNU make manual.
|
||||
You can force GNU make to use the simple pipe-based jobserver (perhaps if
|
||||
you are integrating with other tools or older versions of GNU make) by
|
||||
will need to be enhanced as described in the GNU Make manual.
|
||||
You can force GNU Make to use the simple pipe-based jobserver (perhaps if
|
||||
you are integrating with other tools or older versions of GNU Make) by
|
||||
adding the '--jobserver-style=pipe' option to the command line of the
|
||||
top-level invocation of GNU make, or via MAKEFLAGS or GNUMAKEFLAGS.
|
||||
top-level invocation of GNU Make, or via MAKEFLAGS or GNUMAKEFLAGS.
|
||||
To detect this change search for 'jobserver-fifo' in the .FEATURES variable.
|
||||
|
||||
* New feature: The MAKE_TMPDIR environment variable
|
||||
If you prefer that GNU make place temporary files in a different directory
|
||||
than the standard TMPDIR (or TMP or TEMP on Windows), set the MAKE_TMPDIR
|
||||
environment variable before starting make (this value CANNOT be set inside
|
||||
the makefile, since make needs to find its temporary directory before the
|
||||
makefiles are parsed). This is useful for build systems which reset TMPDIR
|
||||
and clean it out during the build process.
|
||||
|
||||
* Some POSIX systems (*BSD) do not allow locks to be taken on pipes, which
|
||||
caused the output sync feature to not work properly there. Also multiple
|
||||
invocations of make redirecting to the same output file (e.g., /dev/null)
|
||||
@@ -120,16 +148,16 @@ https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=109&se
|
||||
performance characteristics, but is not portable) create a temporary file
|
||||
and lock that. Windows continues to use a mutex as before.
|
||||
|
||||
* GNU make has sometimes chosen unexpected, and sub-optimal, chains of
|
||||
* GNU Make has sometimes chosen unexpected, and sub-optimal, chains of
|
||||
implicit rules due to the definition of "ought to exist" in the implicit
|
||||
rule search algorithm, which considered any prerequisite mentioned in the
|
||||
makefile as "ought to exist". This algorithm has been modified to prefer
|
||||
prerequisites mentioned explicitly in the target being built and only if
|
||||
that results in no matching rule, will GNU make consider prerequisites
|
||||
that results in no matching rule, will GNU Make consider prerequisites
|
||||
mentioned in other targets as "ought to exist".
|
||||
Implementation provided by Dmitry Goncharov <dgoncharov@users.sf.net>
|
||||
|
||||
* GNU make was performing secondary expansion of all targets, even targets
|
||||
* GNU Make was performing secondary expansion of all targets, even targets
|
||||
which didn't need to be considered during the build. In this release
|
||||
only targets which are considered will be secondarily expanded.
|
||||
Implementation provided by Dmitry Goncharov <dgoncharov@users.sf.net>
|
||||
@@ -141,7 +169,7 @@ https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=109&se
|
||||
|
||||
* The -I option accepts an argument "-" (e.g., "-I-") which means "reset the
|
||||
list of search directories to empty". Among other things this can be used
|
||||
to prevent GNU make from searching in its default list of directories.
|
||||
to prevent GNU Make from searching in its default list of directories.
|
||||
|
||||
* New debug option "print" will show the recipe to be run, even when silent
|
||||
mode is set, and new debug option "why" will show why a target is rebuilt
|
||||
@@ -158,9 +186,9 @@ https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=109&se
|
||||
* Special targets like .POSIX are detected upon definition, ensuring that any
|
||||
change in behavior takes effect immediately, before the next line is parsed.
|
||||
|
||||
* When the jobserver is enabled and GNU make decides it is invoking a non-make
|
||||
sub-process and closes the jobserver pipes, it will now add a new option to
|
||||
the MAKEFLAGS environment variable that disables the jobserver.
|
||||
* When the pipe-based jobserver is enabled and GNU Make decides it is invoking
|
||||
a non-make sub-process and closes the jobserver pipes, it will now add a new
|
||||
option to the MAKEFLAGS environment variable that disables the jobserver.
|
||||
This prevents sub-processes that invoke make from accidentally using other
|
||||
open file descriptors as jobserver pipes. For more information see
|
||||
https://savannah.gnu.org/bugs/?57242 and https://savannah.gnu.org/bugs/?62397
|
||||
@@ -427,7 +455,7 @@ https://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101&se
|
||||
* New feature: "::=" simple assignment operator as defined by POSIX in 2012.
|
||||
This operator has identical functionality to ":=" in GNU make, but will be
|
||||
portable to any implementation of make conforming to a sufficiently new
|
||||
version of POSIX (see http://austingroupbugs.net/view.php?id=330). It is
|
||||
version of POSIX (see https://austingroupbugs.net/view.php?id=330). It is
|
||||
not necessary to define the .POSIX target to access this operator.
|
||||
|
||||
* New feature: Loadable objects
|
||||
@@ -1100,7 +1128,7 @@ Version 3.77 (28 Jul 1998)
|
||||
This port was done by Klaus Kämpf <kkaempf@rmi.de>
|
||||
|
||||
* There is first-level support available from proGIS Software, Germany.
|
||||
Visit their web-site at http://www.progis.de to get information
|
||||
Visit their web-site at https://www.progis.de to get information
|
||||
about other vms software and forthcoming updates to gnu make.
|
||||
|
||||
* /bin/sh style I/O redirection is supported. You can now write lines like
|
||||
@@ -1803,4 +1831,4 @@ 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/>.
|
||||
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
12
README.Amiga
12
README.Amiga
@@ -1,11 +1,11 @@
|
||||
Short: Port of GNU make with SAS/C (no ixemul.library required)
|
||||
Short: Port of GNU Make with SAS/C (no ixemul.library required)
|
||||
Author: GNU, Amiga port by Aaron "Optimizer" Digulla
|
||||
Uploader: Aaron "Optimizer" Digulla (digulla@fh-konstanz.de)
|
||||
Type: dev/c
|
||||
|
||||
This is a pure Amiga port of GNU make. It needs no extra libraries or
|
||||
This is a pure Amiga port of GNU Make. It needs no extra libraries or
|
||||
anything. It has the following features (in addition to any features of
|
||||
GNU make):
|
||||
GNU Make):
|
||||
|
||||
- Runs Amiga-Commands with SystemTags() (Execute)
|
||||
- Can run multi-line statements
|
||||
@@ -44,9 +44,9 @@ COMPILING FROM SCRATCH
|
||||
|
||||
To recompile, you need SAS/C 6.51.
|
||||
|
||||
As of GNU make 4.3, the build environment has been cleaned up and alternate
|
||||
As of GNU Make 4.3, the build environment has been cleaned up and alternate
|
||||
make files (including smakefiles) have been removed. If you have an existing
|
||||
version of GNU make available you _should_ be able to run:
|
||||
version of GNU Make available you _should_ be able to run:
|
||||
|
||||
make -f Basic.mk
|
||||
|
||||
@@ -77,4 +77,4 @@ 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/>.
|
||||
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
@@ -79,7 +79,7 @@ To build from sources:
|
||||
|
||||
6. To install copy make.exe to the preferred location.
|
||||
|
||||
Since GNU make 4.3, support for customized platform installations
|
||||
Since GNU Make 4.3, support for customized platform installations
|
||||
has been removed. If you'd like to collaborate on reinstating
|
||||
these capabilities, contact bug-make@gnu.org.
|
||||
|
||||
@@ -293,4 +293,4 @@ 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/>.
|
||||
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
@@ -1,6 +1,6 @@
|
||||
Port of GNU make to OS/2.
|
||||
Port of GNU Make to OS/2.
|
||||
|
||||
Features of GNU make that do not work under OS/2:
|
||||
Features of GNU Make that do not work under OS/2:
|
||||
- remote job execution
|
||||
- dynamic load balancing
|
||||
|
||||
@@ -9,7 +9,7 @@ Special features of the OS/2 version:
|
||||
|
||||
Due to the fact that some people might want to use sh syntax in
|
||||
Makefiles while others might want to use OS/2's native shell cmd.exe,
|
||||
GNU make supports both shell types. The following list defines the order
|
||||
GNU Make supports both shell types. The following list defines the order
|
||||
that is used to determine the shell:
|
||||
|
||||
1. The shell specified by the environment variable MAKESHELL.
|
||||
@@ -37,7 +37,7 @@ I. ***** SPECIAL OPTIONS *****
|
||||
cmd or by specifying SHELL=cmd in your Makefile.
|
||||
|
||||
- At compile time you can set CPPFLAGS="-DNO_CHDIR2" to turn off that
|
||||
GNU make prints drive letters. This is necessary if you want to run
|
||||
GNU Make prints drive letters. This is necessary if you want to run
|
||||
the testsuite.
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ A standard Unix like build environment:
|
||||
release 2)
|
||||
If you use pdksh it is recommended to update to 5.2.14 release 2. Older
|
||||
versions may not work! You can get this version at
|
||||
http://www.math.ohio-state.edu/~ilya/software/os2/pdksh-5.2.14-bin-2.zip
|
||||
https://www.math.ohio-state.edu/~ilya/software/os2/pdksh-5.2.14-bin-2.zip
|
||||
- GNU file utilities (make sure that install.exe from the file utilities
|
||||
is in front of your PATH before X:\OS2\INSTALL\INSTALL.EXE. I recommend
|
||||
also to change the filename to ginstall.exe instead of install.exe
|
||||
@@ -59,7 +59,7 @@ A standard Unix like build environment:
|
||||
- gawk
|
||||
- grep
|
||||
- sed
|
||||
- GNU make 3.79.1 (special OS/2 patched version) or higher
|
||||
- GNU Make 3.79.1 (special OS/2 patched version) or higher
|
||||
- perl 5.005 or higher
|
||||
- GNU texinfo (you can use 3.1 (gnuinfo.zip), but I recommend 4.0)
|
||||
|
||||
@@ -105,15 +105,15 @@ Note: You can add -DNO_CMD_DEFAULT and -DNO_CHDIR2 to CPPFLAGS.
|
||||
|
||||
IV. ***** NLS support *****
|
||||
|
||||
GNU make has NLS (National Language Support), with the following
|
||||
GNU Make has NLS (National Language Support), with the following
|
||||
caveats:
|
||||
|
||||
a) It will only work with GNU gettext, and
|
||||
b) GNU gettext support is not included in the GNU make package.
|
||||
b) GNU gettext support is not included in the GNU Make package.
|
||||
|
||||
Therefore, if you wish to enable the internationalization features of
|
||||
GNU make you must install GNU gettext on your system before configuring
|
||||
GNU make.
|
||||
GNU Make you must install GNU gettext on your system before configuring
|
||||
GNU Make.
|
||||
|
||||
You can choose the languages to be installed. To install support for
|
||||
English, German and French only enter:
|
||||
@@ -173,4 +173,4 @@ 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/>.
|
||||
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
20
README.VMS
20
README.VMS
@@ -1,7 +1,7 @@
|
||||
Overview: -*-text-mode-*-
|
||||
---------
|
||||
|
||||
This version of GNU make has been tested on:
|
||||
This version of GNU Make has been tested on:
|
||||
OpenVMS V8.3/V8.4 (Alpha) and V8.4 (Integrity) AND V7.3 (VAX)
|
||||
|
||||
This version of GNU Make is intended to be run from DCL to run
|
||||
@@ -14,7 +14,7 @@ Overview: -*-text-mode-*-
|
||||
detect that it is running under a POSIX shell and then operate as close to
|
||||
GNU Make on Unix as possible.
|
||||
|
||||
The descriptions below are for running GNU make from DCL or equivalent.
|
||||
The descriptions below are for running GNU Make from DCL or equivalent.
|
||||
|
||||
Recipe differences:
|
||||
-------------------
|
||||
@@ -84,7 +84,7 @@ Recipe differences:
|
||||
|
||||
The format for recipes are a combination of Unix macros, a subset of
|
||||
simulated UNIX commands, some shell emulation, and OpenVMS commands.
|
||||
This makes the resulting makefiles unique to the OpenVMS port of GNU make.
|
||||
This makes the resulting makefiles unique to the OpenVMS port of GNU Make.
|
||||
|
||||
If you are creating a OpenVMS specific makefile from scratch, you should also
|
||||
look at MMK (Madgoat Make) available at https://github.com/endlesssoftware/mmk
|
||||
@@ -177,7 +177,7 @@ Recipe differences:
|
||||
Since the OpenVMS utilities generally expect OpenVMS format paths, you will
|
||||
usually have to use OpenVMS format paths for rules and targets.
|
||||
BUG: Relative OpenVMS paths may not work in targets, especially combined
|
||||
with vpaths. This is because GNU make will just concatenate the directories
|
||||
with vpaths. This is because GNU Make will just concatenate the directories
|
||||
as it does on Unix.
|
||||
|
||||
The variables $^ and $@ separate files with commas instead of spaces.
|
||||
@@ -211,9 +211,9 @@ foo: $(addsuffix .3,$(subs $(comma),$(space),$^)
|
||||
shows them as "environment override". On POSIX the test scripts indicate
|
||||
that they should show up just as "environment".
|
||||
|
||||
When GNU make reads in a symbol or logical name into the environment, it
|
||||
When GNU Make reads in a symbol or logical name into the environment, it
|
||||
converts any dollar signs found to double dollar signs for convenience in
|
||||
using DCL symbols and logical names in recipes. When GNU make exports a
|
||||
using DCL symbols and logical names in recipes. When GNU Make exports a
|
||||
DCL symbol for a child process, if the first dollar sign found is followed
|
||||
by second dollar sign, then all double dollar signs will be converted to
|
||||
single dollar signs.
|
||||
@@ -284,7 +284,7 @@ Runtime issues:
|
||||
|
||||
MAKE_FAILURE has a POSIX value of 2 and an OpenVMS status of %x1035a012.
|
||||
|
||||
Output from GNU make may have single quotes around some values where on
|
||||
Output from GNU Make may have single quotes around some values where on
|
||||
other platforms it does not. Also output that would be in double quotes
|
||||
on some platforms may show up as single quotes on VMS.
|
||||
|
||||
@@ -353,7 +353,7 @@ Unix compatibility features:
|
||||
A note on appending the redirected output. A simple mechanism is
|
||||
implemented to make ">>" work in action lines. In OpenVMS there is no simple
|
||||
feature like ">>" to have DCL command or program output redirected and
|
||||
appended to a file. GNU make for OpenVMS implements the redirection
|
||||
appended to a file. GNU Make for OpenVMS implements the redirection
|
||||
of ">>" by using a command procedure.
|
||||
|
||||
The current algorithm creates the output file if it does not exist and
|
||||
@@ -409,7 +409,7 @@ Unimplemented functionality:
|
||||
The new feature "Loadable objects" is not yet supported. If you need it,
|
||||
please send a change request or submit a bug report.
|
||||
|
||||
The new option --output-sync (-O) is accepted but has no effect: GNU make
|
||||
The new option --output-sync (-O) is accepted but has no effect: GNU Make
|
||||
for OpenVMS does not support running multiple commands simultaneously.
|
||||
|
||||
|
||||
@@ -421,7 +421,7 @@ Self test failures and todos:
|
||||
Need to find a way to set the VMS features before running make as a
|
||||
child.
|
||||
|
||||
GNU make was not currently translating the OpenVMS encoded POSIX values
|
||||
GNU Make was not currently translating the OpenVMS encoded POSIX values
|
||||
returned to it back to the POSIX values. I have temporarily modified the
|
||||
Perl test script to compensate for it. This should be being handled
|
||||
internally to Make.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
This version of GNU make has been tested on:
|
||||
This version of GNU Make has been tested on:
|
||||
Microsoft Windows 2000/XP/2003/Vista/7/8/10
|
||||
It has also been used on Windows 95/98/NT, and on OS/2.
|
||||
|
||||
@@ -15,7 +15,7 @@ which compilation and link switches and libraries need to be mentioned
|
||||
on the compiler command lines to correctly link with Guile. A Windows
|
||||
port of pkg-config can be found on ezwinports site:
|
||||
|
||||
http://sourceforge.net/projects/ezwinports/
|
||||
https://sourceforge.net/projects/ezwinports/
|
||||
|
||||
The libraries on which Guile depends can vary depending on your
|
||||
version and build of Guile. At the very least, the Boehm's GC library
|
||||
@@ -25,7 +25,7 @@ also provide you with these dependencies or a URL where to download
|
||||
them. A precompiled 32-bit Windows build of Guile is available from
|
||||
the ezwinports site mentioned above.
|
||||
|
||||
The Windows port of GNU make is maintained jointly by various people.
|
||||
The Windows port of GNU Make is maintained jointly by various people.
|
||||
It was originally made by Rob Tulloh.
|
||||
It is currently maintained by Eli Zaretskii.
|
||||
|
||||
@@ -33,12 +33,14 @@ It is currently maintained by Eli Zaretskii.
|
||||
Do this first, regardless of the build method you choose:
|
||||
---------------------------------------------------------
|
||||
|
||||
1. Edit config.h.W32 to your liking (especially the few shell-related
|
||||
defines near the end, or HAVE_CASE_INSENSITIVE_FS which corresponds
|
||||
to './configure --enable-case-insensitive-file-system'). (We don't
|
||||
recommend to define HAVE_CASE_INSENSITIVE_FS, but you may wish to
|
||||
consider that if you have a lot of files whose names are in upper
|
||||
case, while Makefile rules are written for lower-case versions.)
|
||||
1. If you have special requirements, edit config.h.W32 to your liking
|
||||
(especially the shell-related defines, or HAVE_CASE_INSENSITIVE_FS which
|
||||
corresponds to './configure --enable-case-insensitive-file-system'). We
|
||||
don't recommend to define HAVE_CASE_INSENSITIVE_FS, but you may wish to
|
||||
consider that if you have a lot of files whose names are in upper case,
|
||||
while Makefile rules are written for lower-case versions.
|
||||
|
||||
If you don't have special requirements no changes are needed.
|
||||
|
||||
|
||||
Building with (MinGW-)GCC using build_w32.bat
|
||||
@@ -51,7 +53,7 @@ Building with (MinGW-)GCC using build_w32.bat
|
||||
|
||||
This produces gnumake.exe in the GccRel directory.
|
||||
|
||||
If you want a version of GNU make built with debugging enabled,
|
||||
If you want a version of GNU Make built with debugging enabled,
|
||||
add the --debug option. Output goes into the GccDebug directory.
|
||||
|
||||
The batch file will probe for Guile installation, and will build
|
||||
@@ -73,21 +75,21 @@ Building with (MSVC++-)cl using build_w32.bat
|
||||
file will probe your system and choose the newest MSVC version it can
|
||||
find.
|
||||
|
||||
If you want a 32bit version of GNU make, add the --x86 option.
|
||||
If you want a 32bit version of GNU Make, add the --x86 option.
|
||||
|
||||
If you want a Debug build of GNU make, add the --debug option. Output
|
||||
If you want a Debug build of GNU Make, add the --debug option. Output
|
||||
will go into the .\WinDebug directory.
|
||||
|
||||
The batch file will probe for Guile installation, and will build
|
||||
gnumake.exe with Guile if it finds it. If Guile is installed,
|
||||
but you prefer to build GNU make without Guile support, add the
|
||||
but you prefer to build GNU Make without Guile support, add the
|
||||
--without-guile option.
|
||||
|
||||
|
||||
Building with (MinGW-)GCC using GNU make
|
||||
Building with (MinGW-)GCC using GNU Make
|
||||
----------------------------------------
|
||||
|
||||
2. If you already have a version of GNU make available you can use it
|
||||
2. If you already have a version of GNU Make available you can use it
|
||||
to build this version. Open a W32 command prompt for your installed
|
||||
(MinGW-)GCC, setup a correct PATH and other environment variables
|
||||
for it, then execute ...
|
||||
@@ -95,7 +97,7 @@ Building with (MinGW-)GCC using GNU make
|
||||
make -f Basic.mk TOOLCHAIN=gcc
|
||||
|
||||
This produces GccRel\gnumake.exe.
|
||||
If you want a version of GNU make built with debugging enabled,
|
||||
If you want a version of GNU Make built with debugging enabled,
|
||||
add the TARGET_TYPE=debug option:
|
||||
|
||||
make -f Basic.mk TOOLCHAIN=gcc TARGET_TYPE=debug
|
||||
@@ -104,10 +106,10 @@ Building with (MinGW-)GCC using GNU make
|
||||
if you want to build with Guile support.
|
||||
|
||||
|
||||
Building with (MSVC++-)cl using GNU make
|
||||
Building with (MSVC++-)cl using GNU Make
|
||||
----------------------------------------
|
||||
|
||||
2. If you already have a version of GNU make available you can use it
|
||||
2. If you already have a version of GNU Make available you can use it
|
||||
to build this version. Open a W32 command prompt for your installed
|
||||
(MSVC++-)cl, setup a correct PATH and other environment variables
|
||||
for it (usually via executing vcvars32.bat or vsvars32.bat from the
|
||||
@@ -117,7 +119,7 @@ Building with (MSVC++-)cl using GNU make
|
||||
make -f Basic.mk
|
||||
|
||||
This produces an optimized WinRel/gnumake.exe.
|
||||
If you want a version of GNU make built with debugging enabled,
|
||||
If you want a version of GNU Make built with debugging enabled,
|
||||
add the TARGET_TYPE=debug option:
|
||||
|
||||
make -f Basic.mk TARGET_TYPE=debug
|
||||
@@ -132,7 +134,7 @@ Running the test suite
|
||||
3. You will need an installation of Perl. Be sure to use a relatively
|
||||
modern version: older versions will sometimes throw spurious errors.
|
||||
|
||||
To run the suite after building using GNU make, use:
|
||||
To run the suite after building using GNU Make, use:
|
||||
|
||||
make -f Basic.mk check
|
||||
|
||||
@@ -156,7 +158,7 @@ Running the test suite
|
||||
-- Notes/Caveats --
|
||||
-------------------
|
||||
|
||||
GNU make on Windows 32-bit platforms:
|
||||
GNU Make on Windows 32-bit platforms:
|
||||
|
||||
This version of make is ported natively to Windows32 platforms
|
||||
(Windows NT 3.51, Windows NT 4.0, Windows 2000, Windows XP,
|
||||
@@ -166,11 +168,11 @@ GNU make on Windows 32-bit platforms:
|
||||
officially are the MinGW port of GNU GCC, and the various
|
||||
versions of the Microsoft C compiler.
|
||||
|
||||
Do not confuse this port of GNU make with other Windows32 projects
|
||||
which provide a GNU make binary. These are separate projects
|
||||
Do not confuse this port of GNU Make with other Windows32 projects
|
||||
which provide a GNU Make binary. These are separate projects
|
||||
and are not connected to this port effort.
|
||||
|
||||
GNU make and sh.exe:
|
||||
GNU Make and sh.exe:
|
||||
|
||||
This port prefers if you have a working sh.exe somewhere on
|
||||
your system. If you don't have sh.exe, the port falls back to
|
||||
@@ -180,12 +182,12 @@ GNU make and sh.exe:
|
||||
|
||||
There are very few true ports of Bourne shell for NT right now.
|
||||
There is a version of GNU bash available from Cygnus "Cygwin"
|
||||
porting effort (http://www.cygwin.com/).
|
||||
porting effort (https://www.cygwin.com/).
|
||||
Other possibilities are the MKS version of sh.exe, or building
|
||||
your own with a package like NutCracker (DataFocus) or Portage
|
||||
(Consensys). Also MinGW includes sh (http://mingw.org/).
|
||||
(Consensys). Also MinGW includes sh.
|
||||
|
||||
GNU make and brain-dead shells (BATCH_MODE_ONLY_SHELL):
|
||||
GNU Make and brain-dead shells (BATCH_MODE_ONLY_SHELL):
|
||||
|
||||
Some versions of Bourne shell do not behave well when invoked
|
||||
as 'sh -c' from CreateProcess(). The main problem is they seem
|
||||
@@ -211,21 +213,21 @@ Support for parallel builds
|
||||
Parallel builds (-jN) are supported in this port. The number of
|
||||
concurrent processes has a hard limit of 4095.
|
||||
|
||||
GNU make and Cygnus GNU Windows32 tools:
|
||||
GNU Make and Cygnus GNU Windows32 tools:
|
||||
|
||||
Good news! Make now has native support for Cygwin sh. To enable,
|
||||
define the HAVE_CYGWIN_SHELL in config.h and rebuild make
|
||||
from scratch. This version of make tested with B20.1 of Cygwin.
|
||||
Do not define BATCH_MODE_ONLY_SHELL if you use HAVE_CYGWIN_SHELL.
|
||||
|
||||
GNU make and the MKS shell:
|
||||
GNU Make and the MKS shell:
|
||||
|
||||
There is now semi-official support for the MKS shell. To turn this
|
||||
support on, define HAVE_MKS_SHELL in the config.h.W32 before you
|
||||
build make. Do not define BATCH_MODE_ONLY_SHELL if you turn
|
||||
on HAVE_MKS_SHELL.
|
||||
|
||||
GNU make handling of drive letters in pathnames (PATH, vpath, VPATH):
|
||||
GNU Make handling of drive letters in pathnames (PATH, vpath, VPATH):
|
||||
|
||||
There is a caveat that should be noted with respect to handling
|
||||
single character pathnames on Windows systems. When colon is
|
||||
@@ -291,7 +293,7 @@ Pathnames and Case insensitivity:
|
||||
the file with other case permutations will succeed (i.e. opening a
|
||||
file named "target" or "TARGET" will open the file "Target").
|
||||
|
||||
By default, GNU make retains its case sensitivity when comparing
|
||||
By default, GNU Make retains its case sensitivity when comparing
|
||||
target names and existing files or directories. It can be
|
||||
configured, however, into a case preserving and case insensitive
|
||||
mode by adding a define for HAVE_CASE_INSENSITIVE_FS to
|
||||
@@ -309,10 +311,10 @@ Pathnames and Case insensitivity:
|
||||
SUBDIR/DepTarget: SubDir/TARGET
|
||||
cp $^ $@
|
||||
|
||||
Reliance on this behavior also eliminates the ability of GNU make
|
||||
Reliance on this behavior also eliminates the ability of GNU Make
|
||||
to use case in comparison of matching rules. For example, it is
|
||||
not possible to set up a C++ rule using %.C that is different
|
||||
than a C rule using %.c. GNU make will consider these to be the
|
||||
than a C rule using %.c. GNU Make will consider these to be the
|
||||
same rule and will issue a warning.
|
||||
|
||||
SAMBA/NTFS/VFAT:
|
||||
@@ -342,7 +344,7 @@ FAT:
|
||||
Bug reports:
|
||||
|
||||
Please submit bugs via the normal bug reporting mechanism which
|
||||
is described in the GNU make manual and the base README.
|
||||
is described in the GNU Make manual and the base README.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 1996-2022 Free Software Foundation, Inc.
|
||||
@@ -358,4 +360,4 @@ 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/>.
|
||||
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
@@ -1,6 +1,6 @@
|
||||
-*-indented-text-*-
|
||||
|
||||
GNU make can utilize the Customs library, distributed with Pmake, to
|
||||
GNU Make can utilize the Customs library, distributed with Pmake, to
|
||||
provide builds distributed across multiple hosts.
|
||||
|
||||
In order to utilize this capability, you must first download and build
|
||||
@@ -21,11 +21,11 @@ please see the pmake and Customs documentation for details. The best
|
||||
place to look for instructions is in the pmake-2.1.33/INSTALL file.
|
||||
|
||||
Note that the 2.1.33 Pmake distribution comes with a set of patches to
|
||||
GNU make, distributed in the pmake-2.1.33/etc/gnumake/ directory. These
|
||||
patches are based on GNU make 3.75 (there are patches for earlier
|
||||
versions of GNU make, also). The parts of this patchfile which relate
|
||||
GNU Make, distributed in the pmake-2.1.33/etc/gnumake/ directory. These
|
||||
patches are based on GNU Make 3.75 (there are patches for earlier
|
||||
versions of GNU Make, also). The parts of this patchfile which relate
|
||||
directly to Customs support have already been incorporated into this
|
||||
version of GNU make, so you should _NOT_ apply the patch file.
|
||||
version of GNU Make, so you should _NOT_ apply the patch file.
|
||||
|
||||
However, there are a few non-Customs specific (as far as I could tell)
|
||||
changes here which are not incorporated (for example, the modification
|
||||
@@ -42,14 +42,14 @@ install' there directly).
|
||||
BUILDING GNU MAKE
|
||||
-----------------
|
||||
|
||||
Once you've installed Customs, you can build GNU make to use it. When
|
||||
configuring GNU make, merely use the '--with-customs=DIR' option.
|
||||
Once you've installed Customs, you can build GNU Make to use it. When
|
||||
configuring GNU Make, merely use the '--with-customs=DIR' option.
|
||||
Provide the directory containing the 'lib' and 'include/customs'
|
||||
subdirectories as DIR. For example, if you installed the customs
|
||||
library in /usr/local/lib and the headers in /usr/local/include/customs,
|
||||
then you'd pass '--with-customs=/usr/local' as an option to configure.
|
||||
|
||||
Run make (or use build.sh) normally to build GNU make as described in
|
||||
Run make (or use build.sh) normally to build GNU Make as described in
|
||||
the INSTALL file.
|
||||
|
||||
See the documentation for Customs for information on starting and
|
||||
@@ -83,7 +83,7 @@ PROBLEMS
|
||||
|
||||
SunOS 4.1.x:
|
||||
The customs/sprite.h header file #includes the <malloc.h> header
|
||||
files; this conflicts with GNU make's configuration so you'll get a
|
||||
files; this conflicts with GNU Make's configuration so you'll get a
|
||||
compile error if you use GCC (or any other ANSI-capable C compiler).
|
||||
|
||||
I commented out the #include in sprite.h:107:
|
||||
@@ -109,4 +109,4 @@ 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/>.
|
||||
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
49
README.git
49
README.git
@@ -31,13 +31,13 @@ make source code via Git from the FSF's Savannah project
|
||||
Changes using Git
|
||||
-----------------
|
||||
|
||||
If you do not have push privileges to the GNU make Git repository, see the
|
||||
If you do not have push privileges to the GNU Make Git repository, see the
|
||||
README file section "Submitting Patches" for information.
|
||||
|
||||
If you have push privileges to the GNU make Git repository keep this
|
||||
If you have push privileges to the GNU Make Git repository keep this
|
||||
information in mind:
|
||||
|
||||
Starting with GNU make 4.0 we no longer keep a separate ChangeLog file in
|
||||
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
|
||||
@@ -70,12 +70,12 @@ available which helps a lot.
|
||||
Coding Standards
|
||||
----------------
|
||||
|
||||
GNU make code adheres to the GNU Coding Standards. Please use only spaces and
|
||||
GNU Make code adheres to the GNU Coding Standards. Please use only spaces and
|
||||
no TAB characters in source code.
|
||||
|
||||
Additionally, GNU make is a foundational bootstrap package for the GNU
|
||||
Additionally, GNU Make is a foundational bootstrap package for the GNU
|
||||
project; as such it is conservative about language features it expects.
|
||||
However, GNU make does rely on the Gnulib portability library, and Gnulib
|
||||
However, GNU Make does rely on the Gnulib portability library, and Gnulib
|
||||
currently requires a ISO C99 compiler. So features in ISO C99 can be
|
||||
assumed.
|
||||
|
||||
@@ -83,7 +83,7 @@ assumed.
|
||||
Building From Git for POSIX
|
||||
---------------------------
|
||||
|
||||
To build GNU make from Git on POSIX systems such as GNU/Linux, you will
|
||||
To build GNU Make from Git on POSIX systems such as GNU/Linux, you will
|
||||
need to install the following extra software:
|
||||
|
||||
* autoconf >= 2.69
|
||||
@@ -93,7 +93,7 @@ need to install the following extra software:
|
||||
* pkg-config
|
||||
* texinfo (for makeinfo)
|
||||
* GCC
|
||||
* GNU make (POSIX make is not sufficient)
|
||||
* GNU Make (POSIX make is not sufficient)
|
||||
|
||||
And any tools that those utilities require (GNU m4, etc.)
|
||||
|
||||
@@ -101,7 +101,7 @@ To run the tests you must install Perl.
|
||||
|
||||
To build a release you'll need to install lzip.
|
||||
|
||||
GNU make requires Gnulib to provide some facilities. If you want to maintain
|
||||
GNU Make requires Gnulib to provide some facilities. If you want to maintain
|
||||
a local installation of gnulib you can set GNULIB_SRCDIR to point to it.
|
||||
Otherwise, ./bootstrap will obtain a clone for you.
|
||||
|
||||
@@ -141,9 +141,9 @@ That is, you can just run:
|
||||
$ ./configure
|
||||
$ make check
|
||||
|
||||
to build and test GNU make.
|
||||
to build and test GNU Make.
|
||||
|
||||
NOTE! This method builds GNU make in "maintainer mode". Make programs built
|
||||
NOTE! This method builds GNU Make in "maintainer mode". Make programs built
|
||||
in this mode it will be slower, possibly MUCH slower: there are various
|
||||
sanity checks enabled. Further this mode assumes a modern GCC, GNU
|
||||
libc, and well-formed system headers and enables a high level of
|
||||
@@ -163,19 +163,18 @@ NOTE! This method builds GNU make in "maintainer mode". Make programs built
|
||||
Building From Git for Windows
|
||||
-----------------------------
|
||||
|
||||
If you have a UNIX emulation like CYGWIN you can opt to run the general
|
||||
build procedure above; it will work. Consult README.W32.template for
|
||||
information on options you might want to use when running ./configure.
|
||||
If you have a UNIX emulation like CYGWIN you can opt to run the general build
|
||||
procedure above; it will work. Consult README.W32 for information on options
|
||||
you might want to use when running ./configure.
|
||||
|
||||
If you can't or don't want to do that, then first run the .\bootstrap.bat
|
||||
script to prime your Git workspace:
|
||||
script to "prime" your Git workspace:
|
||||
|
||||
> .\bootstrap.bat
|
||||
|
||||
Next, rename the file README.W32.template to README.W32 and follow those
|
||||
instructions.
|
||||
Next, follow the instructions in the README.W32 file.
|
||||
|
||||
Note, neither of these methods are tested regularly by the GNU make
|
||||
Note, neither of these methods are tested regularly by the GNU Make
|
||||
maintainers. Building for Windows from a distribution tarball IS tested
|
||||
regularly.
|
||||
|
||||
@@ -214,7 +213,7 @@ Creating a Package
|
||||
------------------
|
||||
|
||||
Once you have performed the above steps (including the configuration and
|
||||
build) you can create a GNU make package. This is very simple, just
|
||||
build) you can create a GNU Make package. This is very simple, just
|
||||
run:
|
||||
|
||||
$ make dist-gzip
|
||||
@@ -251,19 +250,19 @@ consistent (that's why we don't finalize the Git tag, etc. until the end).
|
||||
"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-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.
|
||||
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:
|
||||
Manage the Savannah project for GNU Make:
|
||||
|
||||
>>> This is only for real releases, not release candidate builds <<<
|
||||
|
||||
@@ -277,7 +276,7 @@ Manage the Savannah project for GNU make:
|
||||
- Rank: 20
|
||||
- Descr: Issues found in code retrieved from Source Code Management (Git), rather than a distributed version. Please include the SHA you are working with.
|
||||
|
||||
- Descr: Fixed in Source Code Management (Git). The fix will be included in the next release of GNU make.
|
||||
- Descr: Fixed in Source Code Management (Git). The fix will be included in the next release of GNU Make.
|
||||
|
||||
Start the next release:
|
||||
|
||||
@@ -334,7 +333,7 @@ Announce the release:
|
||||
|
||||
* For release candidate builds:
|
||||
To: bug-make@gnu.org
|
||||
CC: coordinator@translationproject.org
|
||||
CC: coordinator@translationproject.org, platform-testers@gnu.org
|
||||
BCC: help-make@gnu.org, make-w32@gnu.org, make-alpha@gnu.org
|
||||
|
||||
* For release builds
|
||||
@@ -350,7 +349,7 @@ Appendix A - For The Brave
|
||||
--------------------------
|
||||
|
||||
For those of you who trust me implicitly, or are just brave (or
|
||||
foolhardy), here is a canned sequence of commands to build a GNU make
|
||||
foolhardy), here is a canned sequence of commands to build a GNU Make
|
||||
distribution package from a virgin Git source checkout (assuming all the
|
||||
prerequisites are available of course).
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
This directory contains the %VERSION% release of GNU Make.
|
||||
This directory contains the @PACKAGE_VERSION@ release of @PACKAGE_NAME@.
|
||||
|
||||
See the file NEWS for the user-visible changes from previous releases.
|
||||
In addition, there have been bugs fixed.
|
||||
@@ -6,7 +6,7 @@ In addition, there have been bugs fixed.
|
||||
Please check the system-specific notes below for any caveats related to your
|
||||
operating system.
|
||||
|
||||
If you are trying to build GNU make from a Git clone rather than a downloaded
|
||||
If you are trying to build GNU Make from a Git clone rather than a downloaded
|
||||
source distribution, see the README.git file for instructions.
|
||||
|
||||
For source distribution building and installation instructions, see the file
|
||||
@@ -15,12 +15,12 @@ INSTALL.
|
||||
If you need to build GNU Make and have no other 'make' program to use, you can
|
||||
use the shell script 'build.sh' instead. To do this, first run 'configure' as
|
||||
described in INSTALL. Then, instead of typing 'make' to build the program,
|
||||
type 'sh build.sh'. This should compile the program in the current directory.
|
||||
Then you will have a Make program that you can use for './make install', or
|
||||
type 'sh build.sh'. This will compile the program in the current directory.
|
||||
Then you will have a 'make' program that you can use for './make install', or
|
||||
whatever else.
|
||||
|
||||
Some systems' Make programs cannot process the Makefile for GNU Make. If you
|
||||
get errors from your system's Make when building GNU Make, try using
|
||||
Some systems' 'make' programs cannot process the Makefile for GNU Make.
|
||||
If you get errors from your system's 'make' when building GNU Make, try using
|
||||
'build.sh' instead.
|
||||
|
||||
|
||||
@@ -40,10 +40,10 @@ GNU Make can be obtained in many different ways. See a description here:
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
GNU make is fully documented in the GNU Make manual, which is contained
|
||||
in this distribution as the file make.texinfo. You can also find
|
||||
on-line and preformatted (PostScript and DVI) versions at the FSF's web
|
||||
site. There is information there about ordering hardcopy documentation.
|
||||
GNU Make is fully documented in the GNU Make manual, which is contained in
|
||||
this distribution as the file make.texi. You can also find on-line and
|
||||
preformatted (PostScript and DVI) versions at the FSF's web site. There is
|
||||
information there about ordering hardcopy documentation.
|
||||
|
||||
https://www.gnu.org/
|
||||
https://www.gnu.org/doc/doc.html
|
||||
@@ -66,30 +66,43 @@ You can find most information concerning the development of GNU Make at
|
||||
this site.
|
||||
|
||||
|
||||
Regression Tests
|
||||
----------------
|
||||
|
||||
GNU Make contains a suite of regression tests. To run them use "make check"
|
||||
after building GNU Make. If they fail a tar package will be created
|
||||
containing useful information, which can be emailed (as an attachment) to
|
||||
the <bug-make@gnu.org> mailing list.
|
||||
|
||||
Please note that since these tests rely on known-good-output comparisons,
|
||||
they can show spurious failures on some systems (particularly non-POSIX systems
|
||||
such as Windows).
|
||||
|
||||
|
||||
Bug Reporting
|
||||
-------------
|
||||
|
||||
You can send GNU make bug reports to <bug-make@gnu.org>. Please see the
|
||||
section of the GNU make manual entitled 'Problems and Bugs' for
|
||||
information on submitting useful and complete bug reports.
|
||||
If you need help using GNU Make, try asking on <help-make@gnu.org>.
|
||||
|
||||
If you found a bug, you can send a bug reports to <bug-make@gnu.org>.
|
||||
Please see the section of the GNU Make manual entitled 'Problems and Bugs'
|
||||
for information on submitting useful and complete bug reports.
|
||||
|
||||
You do not need to subscribe to these lists first.
|
||||
|
||||
You can also use the online bug tracking system in the Savannah GNU Make
|
||||
project to submit new problem reports or search for existing ones:
|
||||
|
||||
https://savannah.gnu.org/bugs/?group=make
|
||||
|
||||
If you need help using GNU make, try these forums:
|
||||
|
||||
help-make@gnu.org
|
||||
help-utils@gnu.org
|
||||
news:gnu.utils.help
|
||||
news:gnu.utils.bug
|
||||
We prefer to use the bug tracking system ONLY for bugs or enhancements,
|
||||
not for help requests: please use the mailing lists to get help.
|
||||
|
||||
|
||||
Submitting Patches
|
||||
------------------
|
||||
|
||||
If you'd like to propose a change to GNU make, you can provide a patch with
|
||||
If you'd like to propose a change to GNU Make, you can provide a patch with
|
||||
your changes. If you are making your changes in a Git workspace you can run
|
||||
"git format-patch" to create a patch file. If not, you can use the diff(1)
|
||||
utility to create a patch file; please use "diff -u".
|
||||
@@ -102,24 +115,23 @@ Once you have a patch you can submit it in any of these ways:
|
||||
* Send the patch via email to <bug-make@gnu.org>: be sure to add it as an
|
||||
attachment to avoid interference by email processors.
|
||||
|
||||
Be aware that all non-trivial changes proposed for GNU make require FSF
|
||||
copyright paperwork to be completed before they can be accepted. Contact
|
||||
<bug-make@gnu.org> for help.
|
||||
All non-trivial changes require FSF copyright paperwork to be completed
|
||||
before they can be accepted. Contact <bug-make@gnu.org> for help.
|
||||
|
||||
|
||||
Git Access
|
||||
----------
|
||||
|
||||
The GNU make source repository is available via Git from the GNU Savannah Git
|
||||
The GNU Make source repository is available via Git from the GNU Savannah Git
|
||||
server; look here for details:
|
||||
|
||||
https://savannah.gnu.org/git/?group=make
|
||||
|
||||
Please note: you won't be able to build GNU make from Git without installing
|
||||
Please note: you won't be able to build GNU Make from Git without installing
|
||||
appropriate maintainer's tools, such as GNU m4, automake, autoconf, Perl, GNU
|
||||
make, and GCC.
|
||||
|
||||
See the README.git file for instructions on how to build GNU make once these
|
||||
See the README.git file for instructions on how to build GNU Make once these
|
||||
tools are available. We make no guarantees about the contents or quality of
|
||||
the latest code in the Git repository: it is not unheard of for code that is
|
||||
known to be broken to be checked in. Use at your own risk.
|
||||
@@ -133,7 +145,7 @@ that if you compile make with 'cc -O' on AIX 3.2, it will not work
|
||||
correctly. It is said that using 'cc' without '-O' does work.
|
||||
|
||||
The standard /bin/sh on SunOS 4.1.3_U1 and 4.1.4 is broken and cannot be
|
||||
used to configure GNU make. Please install a different shell such as
|
||||
used to configure GNU Make. Please install a different shell such as
|
||||
bash or pdksh in order to run "configure". See this message for more
|
||||
information:
|
||||
https://mail.gnu.org/archive/html/bug-autoconf/2003-10/msg00190.html
|
||||
@@ -142,7 +154,7 @@ One area that is often a problem in configuration and porting is the code
|
||||
to check the system's current load average. To make it easier to test and
|
||||
debug this code, you can do 'make check-loadavg' to see if it works
|
||||
properly on your system. (You must run 'configure' beforehand, but you
|
||||
need not build Make itself to run this test.)
|
||||
need not build 'make' itself to run this test.)
|
||||
|
||||
Another potential source of porting problems is the support for large
|
||||
files (LFS) in configure for those operating systems that provide it.
|
||||
@@ -151,7 +163,7 @@ difficulties, then as a workaround you should be able to disable LFS by
|
||||
adding the '--disable-largefile' option to the 'configure' script.
|
||||
|
||||
On systems that support micro- and nano-second timestamp values and
|
||||
where stat(2) provides this information, GNU make will use it when
|
||||
where stat(2) provides this information, GNU Make will use it when
|
||||
comparing timestamps to get the most accurate possible result. However,
|
||||
note that many current implementations of tools that *set* timestamps do
|
||||
not preserve micro- or nano-second granularity. This means that "cp -p"
|
||||
@@ -165,7 +177,7 @@ force make to treat them properly. See the manual for details.
|
||||
Ports
|
||||
-----
|
||||
|
||||
- See README.customs for details on integrating GNU make with the
|
||||
- See README.customs for details on integrating GNU Make with the
|
||||
Customs distributed build environment from the Pmake distribution.
|
||||
|
||||
- See README.VMS for details about GNU Make on OpenVMS.
|
||||
@@ -181,12 +193,12 @@ Ports
|
||||
of DJGPP; see the WWW page https://www.delorie.com/djgpp/ for more
|
||||
information.
|
||||
|
||||
The Cygwin project maintains its own port of GNU make. That port may have
|
||||
The Cygwin project maintains its own port of GNU Make. That port may have
|
||||
patches which are not present in this version. If you are using Cygwin
|
||||
you should use their version of GNU make, and if you have questions about
|
||||
you should use their version of GNU Make, and if you have questions about
|
||||
it you should start by asking on those mailing lists and forums.
|
||||
|
||||
Please note there are two _separate_ ports of GNU make for Microsoft
|
||||
Please note there are two _separate_ ports of GNU Make for Microsoft
|
||||
systems: a native Windows tool built with (for example) MSVC or Cygwin,
|
||||
and a DOS-based tool built with DJGPP. Please be sure you are looking
|
||||
at the right README!
|
||||
@@ -114,4 +114,4 @@ 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/>.
|
||||
this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
:: 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/>.
|
||||
:: with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
setlocal
|
||||
set "svurl=https://git.savannah.gnu.org/cgit"
|
||||
@@ -47,23 +47,30 @@ copy /Y gl\lib\*.* lib > nul
|
||||
|
||||
:: Create a sed script to convert templates
|
||||
if exist convert.sed del /Q convert.sed
|
||||
echo s,%%PACKAGE%%,make,g > convert.sed
|
||||
echo s,@PACKAGE@,make,g > convert.sed
|
||||
if ERRORLEVEL 1 goto Failed
|
||||
sed -n "s/^AC_INIT(\[GNU.make\],\[\([0-9.]*\)\].*/s,%%VERSION%%,\1,g/p" configure.ac >> convert.sed
|
||||
echo s,@PACKAGE_BUGREPORT@,bug-make@gnu.org,g >> convert.sed
|
||||
if ERRORLEVEL 1 goto Failed
|
||||
echo s,@PACKAGE_NAME@,GNU Make,g >> convert.sed
|
||||
if ERRORLEVEL 1 goto Failed
|
||||
echo s,@PACKAGE_TARNAME@,make,g >> convert.sed
|
||||
if ERRORLEVEL 1 goto Failed
|
||||
echo s,@PACKAGE_URL@,https://www.gnu.org/software/make/,g >> convert.sed
|
||||
sed -n "s/^AC_INIT(\[GNU.Make\],\[\([0-9.]*\)\].*/s,@PACKAGE_VERSION@,\1,g/p" configure.ac >> convert.sed
|
||||
if ERRORLEVEL 1 goto Failed
|
||||
sed -z -e s/\\\n//g -e "s/[ \t][ \t]*/ /g" -e "s, [^ ]*\.h,,g" -e "s,src/,$(src),g" -e "s,lib/,$(lib),g" Makefile.am | sed -n "s/^\([A-Za-z0-9]*\)_SRCS *= *\(.*\)/s,%%\1_SOURCES%%,\2,/p" >> convert.sed
|
||||
if ERRORLEVEL 1 goto Failed
|
||||
|
||||
echo - Creating Basic.mk
|
||||
call sed -f convert.sed Basic.mk.template > Basic.mk
|
||||
sed -f convert.sed Basic.mk.template > Basic.mk
|
||||
if ERRORLEVEL 1 goto Failed
|
||||
echo - Creating src\config.h.W32
|
||||
call sed -f convert.sed src\config.h.W32.template > src\config.h.W32
|
||||
echo - Creating src\mkconfig.h
|
||||
sed -f convert.sed src\mkconfig.h.in > src\mkconfig.h
|
||||
if ERRORLEVEL 1 goto Failed
|
||||
|
||||
echo - Creating src\gmk-default.h
|
||||
echo static const char *const GUILE_module_defn = ^" \ > src\gmk-default.h
|
||||
call sed -e "s/;.*//" -e "/^[ \t]*$/d" -e "s/\"/\\\\\"/g" -e "s/$/ \\\/" src\gmk-default.scm >> src\gmk-default.h
|
||||
sed -e "s/;.*//" -e "/^[ \t]*$/d" -e "s/\"/\\\\\"/g" -e "s/$/ \\\/" src\gmk-default.scm >> src\gmk-default.h
|
||||
if ERRORLEVEL 1 goto Failed
|
||||
echo ^";>> src\gmk-default.h
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ automake 1.16.1
|
||||
"
|
||||
|
||||
gnulib_name=libgnu
|
||||
gnulib_files=doc/make-stds.texi
|
||||
gnulib_files="doc/make-stds.texi m4/sig_atomic_t.m4"
|
||||
|
||||
# Using the full strtoll module pulls in a lot of stuff. But, it's pretty
|
||||
# simple to use just the base source file, so pull that. We'll use it in
|
||||
@@ -60,5 +60,6 @@ fdl
|
||||
findprog-in
|
||||
getloadavg
|
||||
host-cpu-c-abi
|
||||
largefile
|
||||
make-glob
|
||||
make-macros"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
# 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/>.
|
||||
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# See Makefile.in for comments describing these variables.
|
||||
|
||||
|
||||
2
build.sh
2
build.sh
@@ -15,7 +15,7 @@
|
||||
# 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/>.
|
||||
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# Get configure-generated values
|
||||
. ./build.cfg
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
:: 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/>.
|
||||
:: with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
setlocal
|
||||
if not "%RECURSEME%"=="%~0" (
|
||||
@@ -313,21 +313,21 @@ if "%COMPILER%" == "tcc" goto TccCompile
|
||||
|
||||
:: MSVC Compile
|
||||
if "%VERBOSE%" == "Y" echo on
|
||||
call %COMPILER% /nologo /MT /W4 /EHsc %OPTS% /I %OUTDIR%/src /I src /I %OUTDIR%/lib /I lib /I src/w32/include /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR%OUTDIR% /Fp%OUTDIR%\%MAKE%.pch /Fo%OUTDIR%\%1.%O% /Fd%OUTDIR%\%MAKE%.pdb %EXTRAS% /c %1.c
|
||||
call %COMPILER% /nologo /MT /W4 /EHsc %OPTS% /I %OUTDIR%/src /I src /I %OUTDIR%/lib /I lib /I src/w32/include /D _CONSOLE /D HAVE_CONFIG_H /FR%OUTDIR% /Fp%OUTDIR%\%MAKE%.pch /Fo%OUTDIR%\%1.%O% /Fd%OUTDIR%\%MAKE%.pdb %EXTRAS% /c %1.c
|
||||
@echo off
|
||||
goto CompileDone
|
||||
|
||||
:GccCompile
|
||||
:: GCC Compile
|
||||
if "%VERBOSE%" == "Y" echo on
|
||||
call %COMPILER% -mthreads -Wall -std=gnu99 -gdwarf-2 -g3 %OPTS% -I%OUTDIR%/src -I./src -I%OUTDIR%/lib -I./lib -I./src/w32/include -DWINDOWS32 -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%/%1.%O% -c %1.c
|
||||
call %COMPILER% -mthreads -Wall -std=gnu99 -gdwarf-2 -g3 %OPTS% -I%OUTDIR%/src -I./src -I%OUTDIR%/lib -I./lib -I./src/w32/include -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%/%1.%O% -c %1.c
|
||||
@echo off
|
||||
goto CompileDone
|
||||
|
||||
:TccCompile
|
||||
:: TCC Compile
|
||||
if "%VERBOSE%" == "Y" echo on
|
||||
call %COMPILER% -mthreads -Wall -std=c11 %OPTS% -I%OUTDIR%/src -I./src -I%OUTDIR%/lib -I./lib -I./src/w32/include -D_cdecl= -D_MSC_VER -DWINDOWS32 -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%/%1.%O% -c %1.c
|
||||
call %COMPILER% -mthreads -Wall -std=c11 %OPTS% -I%OUTDIR%/src -I./src -I%OUTDIR%/lib -I./lib -I./src/w32/include -D_cdecl= -D_MSC_VER -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%/%1.%O% -c %1.c
|
||||
@echo off
|
||||
goto CompileDone
|
||||
|
||||
|
||||
19
builddos.bat
19
builddos.bat
@@ -13,7 +13,7 @@ rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
|
||||
rem more details.
|
||||
rem
|
||||
rem You should have received a copy of the GNU General Public License along
|
||||
rem with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
rem with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
echo Building Make for MSDOS with DJGPP
|
||||
|
||||
@@ -49,14 +49,14 @@ gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/s
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/dir.c -o dir.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/file.c -o file.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/misc.c -o misc.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/main.c -o main.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -DINCLUDEDIR=\"c:/djgpp/include\" -O2 -g %XSRC%/src/read.c -o read.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -DLIBDIR=\"c:/djgpp/lib\" -O2 -g %XSRC%/src/remake.c -o remake.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -DLOCALEDIR=\"/dev/env/DJDIR/share/locale\" -O2 -g %XSRC%/src/main.c -o main.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -DINCLUDEDIR=\"/dev/env/DJDIR/include\" -O2 -g %XSRC%/src/read.c -o read.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -DLIBDIR=\"/dev/env/DJDIR/lib\" -O2 -g %XSRC%/src/remake.c -o remake.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/rule.c -o rule.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/implicit.c -o implicit.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/default.c -o default.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/variable.c -o variable.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/expand.c -o eyxpand.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/expand.c -o expand.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/function.c -o function.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/vpath.c -o vpath.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/hash.c -o hash.o
|
||||
@@ -69,15 +69,16 @@ gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/s
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/getopt.c -o getopt.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/getopt1.c -o getopt1.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/shuffle.c -o shuffle.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/load.c -o load.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/lib/glob.c -o lib/glob.o
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/lib/fnmatch.c -o lib/fnmatch.o
|
||||
@echo off
|
||||
echo commands.o > respf.$$$
|
||||
for %%f in (job output dir file misc main read remake rule implicit default variable) do echo %%f.o >> respf.$$$
|
||||
for %%f in (job output dir file misc main read remake rule implicit default variable load) do echo %%f.o >> respf.$$$
|
||||
for %%f in (expand function vpath hash strcache version ar arscan signame remote-stub getopt getopt1 shuffle) do echo %%f.o >> respf.$$$
|
||||
for %%f in (lib\glob lib\fnmatch) do echo %%f.o >> respf.$$$
|
||||
rem gcc -c -I./src -I%XSRC% -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/guile.c -o guile.o
|
||||
rem echo guile.o >> respf.$$$
|
||||
gcc -c -I./src -I%XSRC%/src -I./lib -I%XSRC%/lib -DHAVE_CONFIG_H -O2 -g %XSRC%/src/guile.c -o guile.o
|
||||
echo guile.o >> respf.$$$
|
||||
@echo Linking...
|
||||
@echo on
|
||||
gcc -o make.exe @respf.$$$
|
||||
@@ -85,7 +86,7 @@ gcc -o make.exe @respf.$$$
|
||||
if not exist make.exe echo Make.exe build failed...
|
||||
if exist make.exe echo make.exe is now built!
|
||||
if exist make.exe del respf.$$$
|
||||
if exist make.exe copy /Y Basic.mk Makefile
|
||||
if exist make.exe copy /Y %XSRC%\Basic.mk Makefile
|
||||
goto End
|
||||
|
||||
:SmallEnv
|
||||
|
||||
70
configure.ac
70
configure.ac
@@ -14,9 +14,9 @@
|
||||
# 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/>.
|
||||
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
AC_INIT([GNU make],[4.3.90],[bug-make@gnu.org])
|
||||
AC_INIT([GNU Make],[4.3.92],[bug-make@gnu.org])
|
||||
|
||||
AC_PREREQ([2.69])
|
||||
|
||||
@@ -31,7 +31,7 @@ AC_CONFIG_LIBOBJ_DIR([lib])
|
||||
# We have to enable "foreign" because ChangeLog is auto-generated
|
||||
# Automake 1.15 and gnulib don't get along: gnulib has some strange error
|
||||
# in the way it handles getloadavg.c which causes make distcheck to fail.
|
||||
# http://lists.gnu.org/archive/html/bug-gnulib/2018-06/msg00024.html
|
||||
# https://lists.gnu.org/archive/html/bug-gnulib/2018-06/msg00024.html
|
||||
AM_INIT_AUTOMAKE([1.16.1 foreign -Werror -Wall])
|
||||
|
||||
# Checks for programs.
|
||||
@@ -57,11 +57,6 @@ AC_C_BIGENDIAN
|
||||
AM_GNU_GETTEXT_VERSION([0.19.4])
|
||||
AM_GNU_GETTEXT([external])
|
||||
|
||||
# This test must come as early as possible after the compiler configuration
|
||||
# tests, because the choice of the file model can (in principle) affect
|
||||
# whether functions and headers are available, whether they work, etc.
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
# Checks for libraries.
|
||||
AC_SEARCH_LIBS([strerror],[cposix])
|
||||
AC_SEARCH_LIBS([getpwnam], [sun])
|
||||
@@ -80,8 +75,12 @@ AC_TYPE_PID_T
|
||||
AC_TYPE_OFF_T
|
||||
AC_TYPE_SIZE_T
|
||||
AC_TYPE_SSIZE_T
|
||||
AC_TYPE_INTMAX_T
|
||||
AC_TYPE_UINTMAX_T
|
||||
|
||||
# Check for sig_atomic_t
|
||||
gt_TYPE_SIG_ATOMIC_T
|
||||
|
||||
# Find out whether our struct stat returns nanosecond resolution timestamps.
|
||||
|
||||
AC_STRUCT_ST_MTIM_NSEC
|
||||
@@ -176,15 +175,35 @@ AS_IF([test "x$with_guile" != xno],
|
||||
AC_MSG_RESULT([$guile_version])
|
||||
AS_IF([test "$have_guile" = yes],
|
||||
[ PKG_CHECK_MODULES(GUILE, [guile-$guile_version])
|
||||
# Unfortunately Guile requires a C99 compiler but GNU make doesn't, so
|
||||
# verify we can actually compile the header.
|
||||
# Unfortunately pkg doesn't help in multi-arch environments where the
|
||||
# package is installed for some architectures but not others; we need
|
||||
# to try to link.
|
||||
keep_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $pkg_cv_GUILE_CFLAGS"
|
||||
keep_LIBS="$LIBS"
|
||||
CPPFLAGS="$CPPFLAGS $GUILE_CFLAGS"
|
||||
LIBS="$LIBS $GUILE_LIBS"
|
||||
AC_CHECK_HEADER([libguile.h],
|
||||
[AC_DEFINE([HAVE_GUILE], [1], [Embed GNU Guile support])],
|
||||
[have_guile=no],
|
||||
[/* Avoid configuration error warnings. */])
|
||||
AS_IF([test "$have_guile" = yes],
|
||||
[ AC_MSG_CHECKING([whether we can link GNU Guile])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <libguile.h>
|
||||
static void *
|
||||
guile_init (void *arg)
|
||||
{
|
||||
(void) arg;
|
||||
return 0;
|
||||
}
|
||||
]], [[
|
||||
scm_with_guile (guile_init, 0);
|
||||
]])],
|
||||
[have_guile=yes],
|
||||
[have_guile=no])
|
||||
AC_MSG_RESULT([$have_guile])])
|
||||
CPPFLAGS="$keep_CPPFLAGS"
|
||||
LIBS="$keep_LIBS"
|
||||
])
|
||||
])
|
||||
|
||||
@@ -369,20 +388,16 @@ AS_IF([test "$make_cv_posix_spawn" = yes],
|
||||
[make_cv_synchronous_posix_spawn],
|
||||
[make_cv_synchronous_posix_spawn=no
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <errno.h>
|
||||
#include <spawn.h>
|
||||
#include <string.h>
|
||||
|
||||
extern char **environ;
|
||||
|
||||
int main() {
|
||||
char* path = strdup("./non-existent");
|
||||
char *argv[[2]];
|
||||
argv[[0]] = path;
|
||||
argv[[1]] = 0;
|
||||
return posix_spawn(0, path, 0, 0, argv, environ);
|
||||
int main () {
|
||||
char path[[]] = "./xxx-non-existent";
|
||||
char *argv[[]] = {path, 0};
|
||||
return posix_spawn (0, path, 0, 0, argv, environ) == ENOENT ? 0 : 1;
|
||||
}]])],
|
||||
[make_cv_synchronous_posix_spawn=no],
|
||||
[make_cv_synchronous_posix_spawn=yes],
|
||||
[make_cv_synchronous_posix_spawn=no],
|
||||
[make_cv_synchronous_posix_spawn="no (cross-compiling)"])]))
|
||||
|
||||
AS_CASE([/$user_posix_spawn/$make_cv_posix_spawn/$make_cv_synchronous_posix_spawn/],
|
||||
@@ -430,8 +445,8 @@ AS_CASE([$host],
|
||||
[*-*-mingw32],
|
||||
[AM_CONDITIONAL([WINDOWSENV], [true])
|
||||
w32_target_env=yes
|
||||
AC_DEFINE([WINDOWS32], [1], [Use platform specific coding])
|
||||
AC_DEFINE([HAVE_DOS_PATHS], [1], [Use platform specific coding])
|
||||
AC_DEFINE([WINDOWS32], [1], [Build for the WINDOWS32 API.])
|
||||
AC_DEFINE([HAVE_DOS_PATHS], [1], [Support DOS-style pathnames.])
|
||||
])
|
||||
|
||||
AC_DEFINE_UNQUOTED([PATH_SEPARATOR_CHAR],['$PATH_SEPARATOR'],
|
||||
@@ -440,6 +455,11 @@ AC_DEFINE_UNQUOTED([PATH_SEPARATOR_CHAR],['$PATH_SEPARATOR'],
|
||||
AC_DEFINE_UNQUOTED([HAVE_DECL_GETLOADAVG],[$HAVE_DECL_GETLOADAVG],
|
||||
[Define to 1 if you have the declaration of 'getloadavg'.])
|
||||
|
||||
# Remember that we ran configure to generate config.h
|
||||
|
||||
AC_DEFINE([MK_CONFIGURE], [1],
|
||||
[Define to 1 if config.h is generated by running the configure script.])
|
||||
|
||||
# Include the Maintainer's Makefile section, if it's here.
|
||||
|
||||
MAINT_MAKEFILE=/dev/null
|
||||
@@ -514,8 +534,8 @@ AM_CONDITIONAL([KNOWN_PREFIX],
|
||||
-o "x$prefix" = x/usr/gnu -o "x$prefix" = x/usr])
|
||||
|
||||
# Specify what files are to be created.
|
||||
AC_CONFIG_FILES([Makefile build.cfg lib/Makefile po/Makefile.in doc/Makefile \
|
||||
tests/config-flags.pm])
|
||||
AC_CONFIG_FILES([build.cfg tests/config-flags.pm \
|
||||
Makefile lib/Makefile doc/Makefile po/Makefile.in])
|
||||
# We don't need this: the standard automake output suffices for POSIX systems.
|
||||
#mk/Posix.mk
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
# 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/>.
|
||||
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
TEXI2HTML = texi2html
|
||||
TEXI2HTML_FLAGS = -split_chapter
|
||||
|
||||
@@ -2075,26 +2075,25 @@ extra features (@pxref{Recipes, ,Writing Recipes in Rules}).
|
||||
@cindex normal prerequisites
|
||||
@cindex prerequisites, order-only
|
||||
@cindex order-only prerequisites
|
||||
There are actually two different types of prerequisites understood by
|
||||
GNU @code{make}: normal prerequisites such as described in the
|
||||
previous section, and @dfn{order-only} prerequisites. A normal
|
||||
prerequisite makes two statements: first, it imposes an order in which
|
||||
recipes will be invoked: the recipes for all prerequisites of a target
|
||||
will be completed before the recipe for the target is run. Second, it
|
||||
imposes a dependency relationship: if any prerequisite is newer than
|
||||
the target, then the target is considered out-of-date and must be
|
||||
There are two different types of prerequisites understood by GNU @code{make}:
|
||||
normal prerequisites, described in the previous section, and @dfn{order-only}
|
||||
prerequisites. A normal prerequisite makes two statements: first, it imposes
|
||||
an order in which recipes will be invoked: the recipes for all prerequisites
|
||||
of a target will be completed before the recipe for the target is started.
|
||||
Second, it imposes a dependency relationship: if any prerequisite is newer
|
||||
than the target, then the target is considered out-of-date and must be
|
||||
rebuilt.
|
||||
|
||||
Normally, this is exactly what you want: if a target's prerequisite is
|
||||
updated, then the target should also be updated.
|
||||
|
||||
Occasionally, however, you have a situation where you want to impose a
|
||||
specific ordering on the rules to be invoked @emph{without} forcing
|
||||
the target to be updated if one of those rules is executed. In that
|
||||
case, you want to define @dfn{order-only} prerequisites. Order-only
|
||||
prerequisites can be specified by placing a pipe symbol (@code{|})
|
||||
in the prerequisites list: any prerequisites to the left of the pipe
|
||||
symbol are normal; any prerequisites to the right are order-only:
|
||||
Occasionally you may want to ensure that a prerequisite is built before a
|
||||
target, but @emph{without} forcing the target to be updated if the
|
||||
prerequisite is updated. @dfn{Order-only} prerequisites are used to create
|
||||
this type of relationship. Order-only prerequisites can be specified by
|
||||
placing a pipe symbol (@code{|}) in the prerequisites list: any prerequisites
|
||||
to the left of the pipe symbol are normal; any prerequisites to the right are
|
||||
order-only:
|
||||
|
||||
@example
|
||||
@var{targets} : @var{normal-prerequisites} | @var{order-only-prerequisites}
|
||||
@@ -3307,17 +3306,17 @@ can do it with a @dfn{static pattern rule}. @xref{Static Pattern,
|
||||
@cindex grouped targets
|
||||
@cindex targets, grouped
|
||||
|
||||
If instead of independent targets you have a recipe that generates
|
||||
multiple files from a single invocation, you can express that
|
||||
relationship by declaring your rule to use @emph{grouped targets}. A
|
||||
grouped target rule uses the separator @code{&:} (the @samp{&} here is
|
||||
used to imply ``all'').
|
||||
If instead of independent targets you have a recipe that generates multiple
|
||||
files from a single invocation, you can express that relationship by declaring
|
||||
your rule to use @emph{grouped targets}. A grouped target rule uses the
|
||||
separator @code{&:} (the @samp{&} here is used to imply ``all'').
|
||||
|
||||
When @code{make} builds any one of the grouped targets, it understands
|
||||
that all the other targets in the group are also created as a result
|
||||
of the invocation of the recipe. Furthermore, if only some of the
|
||||
grouped targets are out of date or missing @code{make} will realize
|
||||
that running the recipe will update all of the targets.
|
||||
When @code{make} builds any one of the grouped targets, it understands that
|
||||
all the other targets in the group are also updated as a result of the
|
||||
invocation of the recipe. Furthermore, if only some of the grouped targets
|
||||
are out of date or missing @code{make} will realize that running the recipe
|
||||
will update all of the targets. Finally, if any of the grouped targets are
|
||||
out of date, all the grouped targets are considered out of date.
|
||||
|
||||
As an example, this rule defines a grouped target:
|
||||
|
||||
@@ -10618,12 +10617,21 @@ More than one pattern rule may match a target. In this case
|
||||
|
||||
@cindex multiple targets, in pattern rule
|
||||
@cindex target, multiple in pattern rule
|
||||
Pattern rules may have more than one target; however, every target
|
||||
must contain a @code{%} character. Pattern rules are always treated
|
||||
as grouped targets (@pxref{Multiple Targets, , Multiple Targets in a
|
||||
Rule}) regardless of whether they use the @code{:} or @code{&:}
|
||||
Pattern rules may have more than one target; however, every target must
|
||||
contain a @code{%} character. Multiple target patterns in pattern rules are
|
||||
always treated as grouped targets (@pxref{Multiple Targets, , Multiple Targets
|
||||
in a Rule}) regardless of whether they use the @code{:} or @code{&:}
|
||||
separator.
|
||||
|
||||
There is one exception: if a pattern target is out of date or does
|
||||
not exist and the makefile does not need to build it, then it will not cause
|
||||
the other targets to be considered out of date. Note that this historical
|
||||
exception will be removed in future versions of GNU @code{make} and should not
|
||||
be relied on. If this situation is detected @code{make} will generate a
|
||||
warning @emph{pattern recipe did not update peer target}; however, @code{make}
|
||||
cannot detect all such situations. Please be sure that your recipe updates
|
||||
@emph{all} the target patterns when it runs.
|
||||
|
||||
@node Pattern Examples, Automatic Variables, Pattern Intro, Pattern Rules
|
||||
@subsection Pattern Rule Examples
|
||||
|
||||
@@ -12031,7 +12039,7 @@ arguments.
|
||||
@item max_args
|
||||
The maximum number of arguments the function will accept. Must be
|
||||
between 0 and 255. GNU @code{make} will check this and fail before
|
||||
invoking @code{func_ptr} if the function was invoked with too few
|
||||
invoking @code{func_ptr} if the function was invoked with too many
|
||||
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}.
|
||||
@@ -12109,12 +12117,13 @@ needed) using @code{gmk_free}.
|
||||
@findex gmk_alloc
|
||||
Return a pointer to a newly-allocated buffer. This function will
|
||||
always return a valid pointer; if not enough memory is available
|
||||
@code{make} will exit.
|
||||
@code{make} will exit. @code{gmk_alloc} does not initialize allocated memory.
|
||||
|
||||
@item gmk_free
|
||||
@findex gmk_free
|
||||
Free a buffer returned to you by @code{make}. Once the
|
||||
@code{gmk_free} function returns the string will no longer be valid.
|
||||
If NULL is passed to @code{gmk_free}, no operation is performed.
|
||||
@end table
|
||||
|
||||
@node Loaded Object Example, , Loaded Object API, Loading Objects
|
||||
@@ -12130,7 +12139,6 @@ function in a file @file{mk_temp.c}:
|
||||
@example
|
||||
@group
|
||||
#include <stdlib.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
@@ -12167,8 +12175,9 @@ gen_tmpfile(const char *nm, int argc, char **argv)
|
||||
@}
|
||||
|
||||
int
|
||||
mk_temp_gmk_setup ()
|
||||
mk_temp_gmk_setup (const gmk_floc *floc)
|
||||
@{
|
||||
printf ("mk_temp plugin loaded from %s:%lu\n", floc->filenm, floc->lineno);
|
||||
/* Register the function with make name "mk-temp". */
|
||||
gmk_add_function ("mk-temp", gen_tmpfile, 1, 1, 1);
|
||||
return 1;
|
||||
@@ -12176,7 +12185,7 @@ mk_temp_gmk_setup ()
|
||||
@end group
|
||||
@end example
|
||||
|
||||
Next, we will write a makefile that can build this shared object, load
|
||||
Next, we will write a @file{Makefile} that can build this shared object, load
|
||||
it, and use it:
|
||||
|
||||
@example
|
||||
@@ -12187,7 +12196,7 @@ all:
|
||||
load mk_temp.so
|
||||
|
||||
mk_temp.so: mk_temp.c
|
||||
$(CC) -shared -fPIC -o $@ $<
|
||||
$(CC) -shared -fPIC -o $@@ $<
|
||||
@end group
|
||||
@end example
|
||||
|
||||
@@ -12201,7 +12210,7 @@ object will look on Windows like this (assuming the API version is 1):
|
||||
@example
|
||||
@group
|
||||
mk_temp.dll: mk_temp.c
|
||||
$(CC) -shared -o $@ $< -lgnumake-1
|
||||
$(CC) -shared -o $@@ $< -lgnumake-1
|
||||
@end group
|
||||
@end example
|
||||
|
||||
@@ -12209,6 +12218,7 @@ Now when you run @code{make} you'll see something like:
|
||||
|
||||
@example
|
||||
$ make
|
||||
mk_temp plugin loaded from Makefile:4
|
||||
cc -shared -fPIC -o mk_temp.so mk_temp.c
|
||||
Temporary filename: tmpfile.A7JEwd
|
||||
@end example
|
||||
|
||||
@@ -15,7 +15,7 @@ dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
|
||||
dnl more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU General Public License along
|
||||
dnl with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
dnl with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Got this from the lynx 2.8 distribution.
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
# 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/>.
|
||||
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
AC_DEFUN([pds_AC_DOS_PATHS], [
|
||||
AC_CACHE_CHECK([whether system uses MSDOS-style paths], [ac_cv_dos_paths], [
|
||||
|
||||
@@ -43,31 +43,28 @@ GUILE_CFLAGS := $(patsubst -I%,-isystem %,$(GUILE_CFLAGS))
|
||||
MAKE_MAINTAINER_MODE := -DMAKE_MAINTAINER_MODE
|
||||
AM_CPPFLAGS += $(MAKE_MAINTAINER_MODE)
|
||||
|
||||
TEMPLATES = README README.DOS README.W32 README.OS2 \
|
||||
src/config.ami src/configh.dos src/config.h.W32 src/config.h-vms
|
||||
|
||||
all: $(TEMPLATES)
|
||||
|
||||
# Create preprocessor output files--GCC specific!
|
||||
%.i : %.c
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) -E -dD -o $@ $<
|
||||
|
||||
# General rule for turning a .template into a regular file.
|
||||
#
|
||||
$(TEMPLATES) : % : %.template Makefile
|
||||
rm -f $@
|
||||
sed -e 's@%VERSION%@$(VERSION)@g' \
|
||||
-e 's@%PACKAGE%@$(PACKAGE)@g' \
|
||||
$< > $@
|
||||
chmod a-w $@
|
||||
# Create the mkconfig.h file for non-POSIX config headers
|
||||
|
||||
all: src/mkconfig.h
|
||||
src/mkconfig.h: src/mkconfig.h.in config.status
|
||||
./config.status --header=$@
|
||||
|
||||
# Build the README
|
||||
|
||||
all: README
|
||||
README : README.in config.status
|
||||
./config.status --file=$@
|
||||
|
||||
# Construct Makefiles by adding on dependencies, etc.
|
||||
#
|
||||
cvt = $(patsubst $1/%,$$($1)%,$(filter %.c,$2))
|
||||
Basic.mk: Basic.mk.template .dep_segment Makefile
|
||||
rm -f $@
|
||||
sed -e 's@%VERSION%@$(VERSION)@g' \
|
||||
-e 's@%make_SOURCES%@$(call cvt,src,$(make_SRCS))@g' \
|
||||
sed -e 's@%make_SOURCES%@$(call cvt,src,$(make_SRCS))@g' \
|
||||
-e 's@%w32_SOURCES%@$(call cvt,src,$(w32_SRCS))@g' \
|
||||
-e 's@%vms_SOURCES%@$(call cvt,src,$(vms_SRCS))@g' \
|
||||
-e 's@%amiga_SOURCES%@$(call cvt,src,$(amiga_SRCS))@g' \
|
||||
@@ -76,6 +73,7 @@ Basic.mk: Basic.mk.template .dep_segment Makefile
|
||||
-e 's@%glob_SOURCES%@$(call cvt,lib,$(glob_SRCS))@g' \
|
||||
$< > $@
|
||||
echo >>$@; echo '# --------------- DEPENDENCIES' >>$@; echo '#' >>$@; \
|
||||
echo >>$@; echo '$$(OBJECTS): $$(SRCDIR)/src/mkconfig.h' >>$@; \
|
||||
sed -e 's@^\([^ ]*\)\.o:@$$(OUTDIR)\1.$$(OBJEXT):@' \
|
||||
-e 's@\([^ ]*\.[ch]\)@$$(SRCDIR)/\1@g' \
|
||||
-e 's@$$(SRCDIR)/src/config.h@$$(OUTDIR)src/config.h@g' \
|
||||
@@ -176,7 +174,7 @@ po_sync = translationproject.org::tp/latest/$(PACKAGE)/
|
||||
|
||||
.PHONY: do-po-update po-update
|
||||
do-po-update:
|
||||
tmppo="/tmp/po-$(PACKAGE)-$(VERSION).$$$$" \
|
||||
tmppo="/tmp/po-$(PACKAGE)-$(PACKAGE_VERSION).$$$$" \
|
||||
&& rm -rf "$$tmppo" \
|
||||
&& mkdir "$$tmppo" \
|
||||
&& $(RSYNC) $(po_sync) "$$tmppo" \
|
||||
@@ -238,7 +236,7 @@ export TAR_OPTIONS := --mode=u+w,go-w --owner=0 --group=0 --numeric-owner --sort
|
||||
# When I released 4.3 somehow the INSTALL file was missing.
|
||||
# When I tried to build it again, it was there. I have no idea what happened
|
||||
# but add a new check to be sure it doesn't happen again.
|
||||
mk_dist_files = AUTHORS ChangeLog COPYING INSTALL README
|
||||
mk_dist_files = AUTHORS ChangeLog COPYING INSTALL README src/mkconfig.h
|
||||
|
||||
dist: mk-distcheck
|
||||
|
||||
@@ -363,10 +361,10 @@ local-check: po-check changelog-check
|
||||
# copyright-check writable-files
|
||||
|
||||
changelog-check:
|
||||
if head $(top_srcdir)/ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
|
||||
if head $(top_srcdir)/ChangeLog | grep 'Version $(PACKAGE_VERSION)' >/dev/null; then \
|
||||
:; \
|
||||
else \
|
||||
echo "$(VERSION) not in ChangeLog" 1>&2; \
|
||||
echo "$(PACKAGE_VERSION) not in ChangeLog" 1>&2; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
@@ -413,7 +411,7 @@ gendocs: update-gnuweb update-makeweb
|
||||
cd doc \
|
||||
&& rm -rf doc/manual \
|
||||
&& $(GNULIBDIR)/build-aux/gendocs.sh --email '$(BUGLIST)' \
|
||||
make 'GNU Make Manual'
|
||||
make '$(PACKAGE_NAME) 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)' \
|
||||
@@ -421,7 +419,7 @@ gendocs: update-gnuweb update-makeweb
|
||||
@echo '- cvs add <new files>' \
|
||||
&& echo '- cvs remove <deleted files>' \
|
||||
&& echo '- cvs commit' \
|
||||
&& echo '- cvs tag make-$(subst .,-,$(VERSION))'
|
||||
&& echo '- cvs tag make-$(subst .,-,$(PACKAGE_VERSION))'
|
||||
|
||||
|
||||
## --------------------------------------------- ##
|
||||
@@ -459,15 +457,15 @@ $(COV_BUILD_FILE)-submitted: $(COV_BUILD_FILE)
|
||||
@test -n "$(COVERITY_TOKEN)" || { echo 'COVERITY_TOKEN not set'; exit 1; }
|
||||
@test -n "$(COVERITY_EMAIL)" || { echo 'COVERITY_EMAIL not set'; exit 1; }
|
||||
rm -f '$@'
|
||||
case '$(VERSION)' in \
|
||||
case '$(PACKAGE_VERSION)' in \
|
||||
(*.*.9*) type="daily build"; ext=".$$(date +%Y%m%d)" ;; \
|
||||
(*) type="release"; ext= ;; \
|
||||
esac; \
|
||||
curl --form token='$(COVERITY_TOKEN)' \
|
||||
--form email='$(COVERITY_EMAIL)' \
|
||||
--form file='@$<' \
|
||||
--form version="$(VERSION)$$ext" \
|
||||
--form description="GNU make $$type" \
|
||||
--form version="$(PACKAGE_VERSION)$$ext" \
|
||||
--form description="$(PACKAGE_NAME) $$type" \
|
||||
'https://scan.coverity.com/builds?project=gmake'
|
||||
cp '$<' '$@'
|
||||
|
||||
@@ -478,11 +476,11 @@ $(COV_BUILD_FILE)-submitted: $(COV_BUILD_FILE)
|
||||
|
||||
.PHONY: tag-release
|
||||
tag-release:
|
||||
case '$(VERSION)' in \
|
||||
case '$(PACKAGE_VERSION)' in \
|
||||
(*.*.9*) message=" candidate" ;; \
|
||||
(*) message= ;; \
|
||||
esac; \
|
||||
$(GIT) tag -m "GNU Make release$$message $(VERSION)" -u '$(GPG_KEYID)' '$(VERSION)'
|
||||
$(GIT) tag -m "$(PACKAGE_NAME) release$$message $(PACKAGE_VERSION)" -u '$(GPG_KEYID)' '$(PACKAGE_VERSION)'
|
||||
|
||||
|
||||
## ------------------------- ##
|
||||
@@ -513,14 +511,14 @@ distsign: $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
|
||||
echo 'version: 1.2'; \
|
||||
echo 'directory: make'; \
|
||||
echo 'filename: $*'; \
|
||||
echo 'comment: Official upload of GNU make version $(VERSION)'; \
|
||||
echo 'comment: Official upload of $(PACKAGE_NAME) version $(PACKAGE_VERSION)'; \
|
||||
) > "$*.directive"
|
||||
$(GPG) $(GPGFLAGS) -o "$@" --clearsign "$*.directive"
|
||||
@rm -f "$*.directive"
|
||||
|
||||
# Upload the artifacts
|
||||
|
||||
FTPPUT = ncftpput
|
||||
FTPPUT := $(firstword $(shell command -v ncftpput) $(wildcard $(GNULIBDIR)/build-aux/ncftpput-ftp) invalid)
|
||||
gnu-upload-host = ftp-upload.gnu.org
|
||||
gnu-upload-dir = /incoming
|
||||
|
||||
@@ -548,4 +546,4 @@ Makefile.in: maintMakefile
|
||||
# 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/>.
|
||||
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""GDB pretty-printer macros for GNU make."""
|
||||
"""GDB pretty-printer macros for GNU Make."""
|
||||
|
||||
import gdb # pylint: disable=import-error
|
||||
import gdb.printing # pylint: disable=import-error
|
||||
|
||||
@@ -168,4 +168,4 @@ $!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/>.
|
||||
$!this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
# 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/>.
|
||||
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
CC = sc
|
||||
LD = $(CC) Link
|
||||
|
||||
@@ -16,11 +16,11 @@
|
||||
# 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/>.
|
||||
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# Very little is needed here since the default Basic.mk assumes POSIX
|
||||
|
||||
prog_SOURCES += $(posix_SOURCES)
|
||||
prog_SOURCES += $(src)/posixos.c
|
||||
|
||||
extra_CPPFLAGS += @GUILE_CFLAGS@
|
||||
extra_LDFLAGS += @AM_LDFLAGS@
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
# 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/>.
|
||||
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
src = [.src]
|
||||
lib = [.lib]
|
||||
@@ -93,5 +93,5 @@ define CLEANSPACE
|
||||
endef
|
||||
|
||||
|
||||
$(OUTDIR)$(src)config.h: $(SRCDIR)$(src)config.h.W32
|
||||
$(OUTDIR)$(src)config.h: $(SRCDIR)$(src)config.h-vms
|
||||
$(call CP.cmd,$<,$@)
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
# 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/>.
|
||||
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
# TARGET_TYPE can be either "release" or "debug"
|
||||
TARGET_TYPE = release
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
# 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/>.
|
||||
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
OBJEXT = o
|
||||
EXEEXT = .exe
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
# 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/>.
|
||||
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
src/ar.c
|
||||
src/arscan.c
|
||||
|
||||
@@ -4,28 +4,27 @@ $!
|
||||
$! 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")
|
||||
$ config_template = f$search("sys$disk:[.src]mkconfig*h.in")
|
||||
$ 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")
|
||||
$ config_template = f$search("sys$disk:[.src]mkconfig.h*in")
|
||||
$ if config_template .eqs. ""
|
||||
$ then
|
||||
$ write sys$output "Could not find config.h-vms*template!"
|
||||
$ write sys$output "Could not find mkconfig.h.in!"
|
||||
$ 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
|
||||
$ config_template = "sys$disk:[.src]" + config_template_file + config_template_type
|
||||
$!
|
||||
$!
|
||||
$! Pull the package and version from configure.ac
|
||||
$! Pull the version from configure.ac
|
||||
$!
|
||||
$ open/read ac_file sys$disk:[]configure.ac
|
||||
$ac_read_loop:
|
||||
@@ -39,21 +38,26 @@ $ version = f$element (0,"]",version)
|
||||
$ac_read_loop_end:
|
||||
$ close ac_file
|
||||
$!
|
||||
$ if (package .eqs. "") .or. (version .eqs. "")
|
||||
$ if (version .eqs. "")
|
||||
$ then
|
||||
$ write sys$output "Unable to determine package and/or version!"
|
||||
$ write sys$output "Unable to determine version!"
|
||||
$ exit 44
|
||||
$ endif
|
||||
$!
|
||||
$!
|
||||
$ outfile = "sys$disk:[]config.h-vms"
|
||||
$ outfile = "sys$disk:[.src]mkconfig.h"
|
||||
$!
|
||||
$! 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" ;-
|
||||
$! PDS: Blown out; someone else will have to figure this out
|
||||
$ pipe (write sys$output "sub,@PACKAGE@,make,WHOLE/NOTYPE" ;-
|
||||
write sys$output "sub,@PACKAGE_BUGREPORT@,bug-make@gnu.org,WHOLE/NOTYPE" ;-
|
||||
write sys$output "sub,@PACKAGE_NAME@,GNU Make,WHOLE/NOTYPE" ;-
|
||||
write sys$output "sub,@PACKAGE_TARNAME@,make,WHOLE/NOTYPE" ;-
|
||||
write sys$output "sub,@PACKAGE_URL@,https://www.gnu.org/software/make/,WHOLE/NOTYPE" ;-
|
||||
write sys$output "sub,@PACKAGE_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"
|
||||
$ write sys$output "GNU Make version: ", version, " prepared for VMS"
|
||||
|
||||
@@ -60,4 +60,4 @@ run "$@"
|
||||
# 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/>.
|
||||
# this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
#include "variable.h"
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
int MyExecute (char ** argv);
|
||||
char * wildcard_expansion (char * wc, char * o);
|
||||
|
||||
17
src/ar.c
17
src/ar.c
@@ -13,7 +13,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
|
||||
@@ -22,6 +22,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#include "filedef.h"
|
||||
#include "dep.h"
|
||||
#include <fnmatch.h>
|
||||
#include <intprops.h>
|
||||
|
||||
/* Return nonzero if NAME is an archive-member reference, zero if not. An
|
||||
archive-member reference is a name like 'lib(member)' where member is a
|
||||
@@ -69,10 +70,10 @@ ar_parse_name (const char *name, char **arname_p, char **memname_p)
|
||||
/* This function is called by 'ar_scan' to find which member to look at. */
|
||||
|
||||
/* ARGSUSED */
|
||||
static long int
|
||||
static intmax_t
|
||||
ar_member_date_1 (int desc UNUSED, const char *mem, int truncated,
|
||||
long int hdrpos UNUSED, long int datapos UNUSED,
|
||||
long int size UNUSED, long int date,
|
||||
long int size UNUSED, intmax_t date,
|
||||
int uid UNUSED, int gid UNUSED, unsigned int mode UNUSED,
|
||||
const void *name)
|
||||
{
|
||||
@@ -86,7 +87,7 @@ ar_member_date (const char *name)
|
||||
{
|
||||
char *arname;
|
||||
char *memname;
|
||||
long int val;
|
||||
intmax_t val;
|
||||
|
||||
ar_parse_name (name, &arname, &memname);
|
||||
|
||||
@@ -111,7 +112,7 @@ ar_member_date (const char *name)
|
||||
|
||||
free (arname);
|
||||
|
||||
return (val <= 0 ? (time_t) -1 : (time_t) val);
|
||||
return 0 < val && val <= TYPE_MAXIMUM (time_t) ? val : -1;
|
||||
}
|
||||
|
||||
/* Set the archive-member NAME's modtime to now. */
|
||||
@@ -194,10 +195,10 @@ struct ar_glob_state
|
||||
/* This function is called by 'ar_scan' to match one archive
|
||||
element against the pattern in STATE. */
|
||||
|
||||
static long int
|
||||
static intmax_t
|
||||
ar_glob_match (int desc UNUSED, const char *mem, int truncated UNUSED,
|
||||
long int hdrpos UNUSED, long int datapos UNUSED,
|
||||
long int size UNUSED, long int date UNUSED, int uid UNUSED,
|
||||
long int size UNUSED, intmax_t date UNUSED, int uid UNUSED,
|
||||
int gid UNUSED, unsigned int mode UNUSED, const void *arg)
|
||||
{
|
||||
struct ar_glob_state *state = (struct ar_glob_state *)arg;
|
||||
@@ -218,7 +219,7 @@ ar_glob_match (int desc UNUSED, const char *mem, int truncated UNUSED,
|
||||
++state->n;
|
||||
}
|
||||
|
||||
return 0L;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Return nonzero if PATTERN contains any metacharacters.
|
||||
|
||||
97
src/arscan.c
97
src/arscan.c
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
|
||||
@@ -75,9 +75,9 @@ static void *VMS_lib_idx;
|
||||
|
||||
static const void *VMS_saved_arg;
|
||||
|
||||
static long int (*VMS_function) ();
|
||||
static intmax_t (*VMS_function) ();
|
||||
|
||||
static long int VMS_function_ret;
|
||||
static intmax_t VMS_function_ret;
|
||||
|
||||
|
||||
/* This is a callback procedure for lib$get_index */
|
||||
@@ -203,7 +203,7 @@ VMS_get_member_info(struct dsc$descriptor_s *module, unsigned long *rfa)
|
||||
Returns -2 if archive has invalid format.
|
||||
Returns 0 if have scanned successfully. */
|
||||
|
||||
long int
|
||||
intmax_t
|
||||
ar_scan (const char *archive, ar_member_func_t function, const void *varg)
|
||||
{
|
||||
char *vms_archive;
|
||||
@@ -376,16 +376,18 @@ struct ar_hdr
|
||||
# define AR_HDR_SIZE (sizeof (struct ar_hdr))
|
||||
#endif
|
||||
|
||||
#include "intprops.h"
|
||||
|
||||
#include "output.h"
|
||||
|
||||
|
||||
static unsigned long int
|
||||
parse_int (const char *ptr, const size_t len, const int base,
|
||||
static uintmax_t
|
||||
parse_int (const char *ptr, const size_t len, const int base, uintmax_t max,
|
||||
const char *type, const char *archive, const char *name)
|
||||
{
|
||||
const char *const ep = ptr + len;
|
||||
const char max = '0' + base - 1;
|
||||
long int val = 0;
|
||||
const int maxchar = '0' + base - 1;
|
||||
uintmax_t val = 0;
|
||||
|
||||
/* In all the versions I know of the spaces come last, but be safe. */
|
||||
while (ptr < ep && *ptr == ' ')
|
||||
@@ -393,10 +395,16 @@ parse_int (const char *ptr, const size_t len, const int base,
|
||||
|
||||
while (ptr < ep && *ptr != ' ')
|
||||
{
|
||||
if (*ptr < '0' || *ptr > max)
|
||||
OSSS (fatal, NILF, _("Invalid %s for archive %s member %s"),
|
||||
type, archive, name);
|
||||
val = (val * base) + (*ptr - '0');
|
||||
uintmax_t nv;
|
||||
|
||||
if (*ptr < '0' || *ptr > maxchar)
|
||||
OSSS (fatal, NILF,
|
||||
_("Invalid %s for archive %s member %s"), type, archive, name);
|
||||
nv = (val * base) + (*ptr - '0');
|
||||
if (nv < val || nv > max)
|
||||
OSSS (fatal, NILF,
|
||||
_("Invalid %s for archive %s member %s"), type, archive, name);
|
||||
val = nv;
|
||||
++ptr;
|
||||
}
|
||||
|
||||
@@ -430,7 +438,7 @@ parse_int (const char *ptr, const size_t len, const int base,
|
||||
Returns -2 if archive has invalid format.
|
||||
Returns 0 if have scanned successfully. */
|
||||
|
||||
long int
|
||||
intmax_t
|
||||
ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
{
|
||||
#ifdef AIAMAG
|
||||
@@ -550,7 +558,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
# define ARNAME_MAX 255
|
||||
char name[ARNAME_MAX + 1];
|
||||
int name_len;
|
||||
long int dateval;
|
||||
intmax_t dateval;
|
||||
int uidval, gidval;
|
||||
long int data_offset;
|
||||
#else
|
||||
@@ -562,7 +570,9 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
#endif
|
||||
long int eltsize;
|
||||
unsigned int eltmode;
|
||||
long int fnval;
|
||||
intmax_t eltdate;
|
||||
int eltuid, eltgid;
|
||||
intmax_t fnval;
|
||||
off_t o;
|
||||
|
||||
memset(&member_header, '\0', sizeof (member_header));
|
||||
@@ -593,7 +603,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
|
||||
name[name_len] = '\0';
|
||||
|
||||
sscanf (member_header_big.ar_date, "%12ld", &dateval);
|
||||
sscanf (member_header_big.ar_date, "%12" SCNdMAX, &dateval);
|
||||
sscanf (member_header_big.ar_uid, "%12d", &uidval);
|
||||
sscanf (member_header_big.ar_gid, "%12d", &gidval);
|
||||
sscanf (member_header_big.ar_mode, "%12o", &eltmode);
|
||||
@@ -621,7 +631,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
|
||||
name[name_len] = '\0';
|
||||
|
||||
sscanf (member_header.ar_date, "%12ld", &dateval);
|
||||
sscanf (member_header.ar_date, "%12" SCNdMAX, &dateval);
|
||||
sscanf (member_header.ar_uid, "%12d", &uidval);
|
||||
sscanf (member_header.ar_gid, "%12d", &gidval);
|
||||
sscanf (member_header.ar_mode, "%12o", &eltmode);
|
||||
@@ -716,12 +726,12 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
const char* err;
|
||||
unsigned int name_len = make_toui (name + 3, &err);
|
||||
|
||||
if (err || name_len == 0 || name_len > PATH_MAX)
|
||||
if (err || name_len == 0 || name_len >= MIN (PATH_MAX, INT_MAX))
|
||||
goto invalid;
|
||||
|
||||
name = alloca (name_len + 1);
|
||||
nread = readbuf (desc, name, name_len);
|
||||
if (nread != name_len)
|
||||
if (nread < 0 || (unsigned int) nread != name_len)
|
||||
goto invalid;
|
||||
|
||||
name[name_len] = '\0';
|
||||
@@ -732,8 +742,16 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
}
|
||||
|
||||
#ifndef M_XENIX
|
||||
eltmode = parse_int (TOCHAR (member_header.ar_mode), sizeof (member_header.ar_mode), 8, "mode", archive, name);
|
||||
eltsize = parse_int (TOCHAR (member_header.ar_size), sizeof (member_header.ar_size), 10, "size", archive, name);
|
||||
#define PARSE_INT(_m, _t, _b, _n) \
|
||||
(_t) parse_int (TOCHAR (member_header._m), sizeof (member_header._m), \
|
||||
_b, TYPE_MAXIMUM (_t), _n, archive, name)
|
||||
|
||||
eltmode = PARSE_INT (ar_mode, unsigned int, 8, "mode");
|
||||
eltsize = PARSE_INT (ar_size, long, 10, "size");
|
||||
eltdate = PARSE_INT (ar_date, intmax_t, 10, "date");
|
||||
eltuid = PARSE_INT (ar_uid, int, 10, "uid");
|
||||
eltgid = PARSE_INT (ar_gid, int, 10, "gid");
|
||||
#undef PARSE_INT
|
||||
#else /* Xenix. */
|
||||
eltmode = (unsigned short int) member_header.ar_mode;
|
||||
eltsize = member_header.ar_size;
|
||||
@@ -743,9 +761,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
|
||||
(*function) (desc, name, ! long_name, member_offset,
|
||||
member_offset + AR_HDR_SIZE, eltsize,
|
||||
#ifndef M_XENIX
|
||||
parse_int (TOCHAR (member_header.ar_date), sizeof (member_header.ar_date), 10, "date", archive, name),
|
||||
parse_int (TOCHAR (member_header.ar_uid), sizeof (member_header.ar_uid), 10, "uid", archive, name),
|
||||
parse_int (TOCHAR (member_header.ar_gid), sizeof (member_header.ar_gid), 10, "gid", archive, name),
|
||||
eltdate, eltuid, eltgid,
|
||||
#else /* Xenix. */
|
||||
member_header.ar_date,
|
||||
member_header.ar_uid,
|
||||
@@ -885,10 +901,10 @@ ar_name_equal (const char *name, const char *mem, int truncated)
|
||||
|
||||
#ifndef VMS
|
||||
/* ARGSUSED */
|
||||
static long int
|
||||
static intmax_t
|
||||
ar_member_pos (int desc UNUSED, const char *mem, int truncated,
|
||||
long int hdrpos, long int datapos UNUSED, long int size UNUSED,
|
||||
long int date UNUSED, int uid UNUSED, int gid UNUSED,
|
||||
intmax_t date UNUSED, int uid UNUSED, int gid UNUSED,
|
||||
unsigned int mode UNUSED, const void *name)
|
||||
{
|
||||
if (!ar_name_equal (name, mem, truncated))
|
||||
@@ -906,12 +922,13 @@ ar_member_pos (int desc UNUSED, const char *mem, int truncated,
|
||||
int
|
||||
ar_member_touch (const char *arname, const char *memname)
|
||||
{
|
||||
long int pos = ar_scan (arname, ar_member_pos, memname);
|
||||
intmax_t pos = ar_scan (arname, ar_member_pos, memname);
|
||||
off_t opos;
|
||||
int fd;
|
||||
struct ar_hdr ar_hdr;
|
||||
off_t o;
|
||||
int r;
|
||||
unsigned int ui;
|
||||
int datelen;
|
||||
struct stat statbuf;
|
||||
|
||||
if (pos < 0)
|
||||
@@ -919,11 +936,13 @@ ar_member_touch (const char *arname, const char *memname)
|
||||
if (!pos)
|
||||
return 1;
|
||||
|
||||
opos = (off_t) pos;
|
||||
|
||||
EINTRLOOP (fd, open (arname, O_RDWR, 0666));
|
||||
if (fd < 0)
|
||||
return -3;
|
||||
/* Read in this member's header */
|
||||
EINTRLOOP (o, lseek (fd, pos, 0));
|
||||
EINTRLOOP (o, lseek (fd, opos, 0));
|
||||
if (o < 0)
|
||||
goto lose;
|
||||
r = readbuf (fd, &ar_hdr, AR_HDR_SIZE);
|
||||
@@ -935,15 +954,16 @@ ar_member_touch (const char *arname, const char *memname)
|
||||
goto lose;
|
||||
/* Advance member's time to that time */
|
||||
#if defined(ARFMAG) || defined(ARFZMAG) || defined(AIAMAG) || defined(WINDOWS32)
|
||||
for (ui = 0; ui < sizeof ar_hdr.ar_date; ui++)
|
||||
ar_hdr.ar_date[ui] = ' ';
|
||||
sprintf (TOCHAR (ar_hdr.ar_date), "%lu", (long unsigned) statbuf.st_mtime);
|
||||
ar_hdr.ar_date[strlen ((char *) ar_hdr.ar_date)] = ' ';
|
||||
datelen = snprintf (TOCHAR (ar_hdr.ar_date), sizeof ar_hdr.ar_date,
|
||||
"%" PRIdMAX, (intmax_t) statbuf.st_mtime);
|
||||
if (! (0 <= datelen && datelen < (int) sizeof ar_hdr.ar_date))
|
||||
goto lose;
|
||||
memset (ar_hdr.ar_date + datelen, ' ', sizeof ar_hdr.ar_date - datelen);
|
||||
#else
|
||||
ar_hdr.ar_date = statbuf.st_mtime;
|
||||
#endif
|
||||
/* Write back this member's header */
|
||||
EINTRLOOP (o, lseek (fd, pos, 0));
|
||||
EINTRLOOP (o, lseek (fd, opos, 0));
|
||||
if (o < 0)
|
||||
goto lose;
|
||||
r = writebuf (fd, &ar_hdr, AR_HDR_SIZE);
|
||||
@@ -962,18 +982,21 @@ ar_member_touch (const char *arname, const char *memname)
|
||||
|
||||
#ifdef TEST
|
||||
|
||||
long int
|
||||
intmax_t
|
||||
describe_member (int desc, const char *name, int truncated,
|
||||
long int hdrpos, long int datapos, long int size,
|
||||
long int date, int uid, int gid, unsigned int mode,
|
||||
intmax_t date, int uid, int gid, unsigned int mode,
|
||||
const void *arg)
|
||||
{
|
||||
extern char *ctime ();
|
||||
time_t d = date;
|
||||
char const *ds;
|
||||
|
||||
printf (_("Member '%s'%s: %ld bytes at %ld (%ld).\n"),
|
||||
name, truncated ? _(" (name might be truncated)") : "",
|
||||
size, hdrpos, datapos);
|
||||
printf (_(" Date %s"), ctime (&date));
|
||||
ds = ctime (&d);
|
||||
printf (_(" Date %s"), ds ? ds : "?");
|
||||
printf (_(" uid = %d, gid = %d, mode = 0%o.\n"), uid, gid, mode);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -12,10 +12,11 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
#include "filedef.h"
|
||||
#include "os.h"
|
||||
#include "dep.h"
|
||||
#include "variable.h"
|
||||
#include "job.h"
|
||||
@@ -321,14 +322,12 @@ set_file_variables (struct file *file, const char *stem)
|
||||
void
|
||||
chop_commands (struct commands *cmds)
|
||||
{
|
||||
unsigned int nlines;
|
||||
unsigned short idx;
|
||||
unsigned short nlines;
|
||||
unsigned short i;
|
||||
char **lines;
|
||||
|
||||
/* If we don't have any commands,
|
||||
or we already parsed them, never mind. */
|
||||
|
||||
if (!cmds || cmds->command_lines != 0)
|
||||
/* If we don't have any commands, or we already parsed them, never mind. */
|
||||
if (!cmds || cmds->command_lines != NULL)
|
||||
return;
|
||||
|
||||
/* Chop CMDS->commands up into lines in CMDS->command_lines. */
|
||||
@@ -347,25 +346,27 @@ chop_commands (struct commands *cmds)
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *p;
|
||||
const char *p = cmds->commands;
|
||||
size_t max = 5;
|
||||
|
||||
nlines = 5;
|
||||
lines = xmalloc (nlines * sizeof (char *));
|
||||
idx = 0;
|
||||
p = cmds->commands;
|
||||
nlines = 0;
|
||||
lines = xmalloc (max * sizeof (char *));
|
||||
while (*p != '\0')
|
||||
{
|
||||
const char *end = p;
|
||||
find_end:;
|
||||
end = strchr (end, '\n');
|
||||
if (end == 0)
|
||||
if (end == NULL)
|
||||
end = p + strlen (p);
|
||||
else if (end > p && end[-1] == '\\')
|
||||
{
|
||||
int backslash = 1;
|
||||
const char *b;
|
||||
for (b = end - 2; b >= p && *b == '\\'; --b)
|
||||
backslash = !backslash;
|
||||
if (end > p + 1)
|
||||
{
|
||||
const char *b;
|
||||
for (b = end - 2; b >= p && *b == '\\'; --b)
|
||||
backslash = !backslash;
|
||||
}
|
||||
if (backslash)
|
||||
{
|
||||
++end;
|
||||
@@ -373,40 +374,36 @@ chop_commands (struct commands *cmds)
|
||||
}
|
||||
}
|
||||
|
||||
if (idx == nlines)
|
||||
if (nlines == USHRT_MAX)
|
||||
ON (fatal, &cmds->fileinfo,
|
||||
_("Recipe has too many lines (limit %hu)"), nlines);
|
||||
|
||||
if (nlines == max)
|
||||
{
|
||||
nlines += 2;
|
||||
lines = xrealloc (lines, nlines * sizeof (char *));
|
||||
max += 2;
|
||||
lines = xrealloc (lines, max * sizeof (char *));
|
||||
}
|
||||
lines[idx++] = xstrndup (p, (size_t) (end - p));
|
||||
|
||||
lines[nlines++] = xstrndup (p, (size_t) (end - p));
|
||||
p = end;
|
||||
if (*p != '\0')
|
||||
++p;
|
||||
}
|
||||
|
||||
if (idx != nlines)
|
||||
{
|
||||
nlines = idx;
|
||||
lines = xrealloc (lines, nlines * sizeof (char *));
|
||||
}
|
||||
}
|
||||
|
||||
/* Finally, set the corresponding CMDS->lines_flags elements and the
|
||||
CMDS->any_recurse flag. */
|
||||
|
||||
if (nlines > USHRT_MAX)
|
||||
ON (fatal, &cmds->fileinfo, _("Recipe has too many lines (%ud)"), nlines);
|
||||
|
||||
cmds->ncommand_lines = (unsigned short)nlines;
|
||||
cmds->ncommand_lines = nlines;
|
||||
cmds->command_lines = lines;
|
||||
|
||||
cmds->any_recurse = 0;
|
||||
cmds->lines_flags = xmalloc (nlines);
|
||||
|
||||
for (idx = 0; idx < nlines; ++idx)
|
||||
for (i = 0; i < nlines; ++i)
|
||||
{
|
||||
unsigned char flags = 0;
|
||||
const char *p = lines[idx];
|
||||
const char *p = lines[i];
|
||||
|
||||
while (ISBLANK (*p) || *p == '-' || *p == '@' || *p == '+')
|
||||
switch (*(p++))
|
||||
@@ -423,12 +420,12 @@ chop_commands (struct commands *cmds)
|
||||
}
|
||||
|
||||
/* If no explicit '+' was given, look for MAKE variable references. */
|
||||
if (!(flags & COMMANDS_RECURSE)
|
||||
if (! ANY_SET (flags, COMMANDS_RECURSE)
|
||||
&& (strstr (p, "$(MAKE)") != 0 || strstr (p, "${MAKE}") != 0))
|
||||
flags |= COMMANDS_RECURSE;
|
||||
|
||||
cmds->lines_flags[idx] = flags;
|
||||
cmds->any_recurse |= flags & COMMANDS_RECURSE ? 1 : 0;
|
||||
cmds->lines_flags[i] = flags;
|
||||
cmds->any_recurse |= ANY_SET (flags, COMMANDS_RECURSE) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -479,7 +476,7 @@ execute_file_commands (struct file *file)
|
||||
/* This is set while we are inside fatal_error_signal,
|
||||
so things can avoid nonreentrant operations. */
|
||||
|
||||
int handling_fatal_signal = 0;
|
||||
volatile sig_atomic_t handling_fatal_signal = 0;
|
||||
|
||||
/* Handle fatal signals. */
|
||||
|
||||
@@ -532,6 +529,10 @@ fatal_error_signal (int sig)
|
||||
It is blocked now while we run this handler. */
|
||||
signal (sig, SIG_DFL);
|
||||
|
||||
temp_stdin_unlink ();
|
||||
osync_clear ();
|
||||
jobserver_clear ();
|
||||
|
||||
/* A termination signal won't be sent to the entire
|
||||
process group, but it means we want to kill the children. */
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Structure that gives the commands to make a file
|
||||
and information about where these commands came from. */
|
||||
|
||||
@@ -12,7 +12,11 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "mkconfig.h"
|
||||
|
||||
#define MK_AMIGAOS 1
|
||||
|
||||
/* Define if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
@@ -37,6 +41,10 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define for DGUX with <sys/dg_sys_info.h>. */
|
||||
/* #undef DGUX */
|
||||
|
||||
/* Define to the widest signed integer type if <stdint.h> and <inttypes.h> do
|
||||
not define. */
|
||||
#define intmax_t long
|
||||
|
||||
/* Define to 'unsigned long' or 'unsigned long long'
|
||||
if <inttypes.h> doesn't define. */
|
||||
#define uintmax_t unsigned long
|
||||
@@ -162,12 +170,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
instead of <sys/cpustats.h>. */
|
||||
/* #undef UMAX4_3 */
|
||||
|
||||
/* Name of this package (needed by automake) */
|
||||
#define PACKAGE "%PACKAGE%"
|
||||
|
||||
/* Version of this package (needed by automake) */
|
||||
#define VERSION "%VERSION%"
|
||||
|
||||
/* Define to the name of the SCCS 'get' command. */
|
||||
#define SCCS_GET "get"
|
||||
|
||||
@@ -13,10 +13,11 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* config.h. Generated automatically by configure. */
|
||||
/* config.h.in. Generated automatically from configure.ac by autoheader. */
|
||||
#include "mkconfig.h"
|
||||
|
||||
#define MK_VMS 1
|
||||
|
||||
/* Pull in types.h here to get __CRTL_VER defined for old versions of the
|
||||
compiler which don't define it. */
|
||||
@@ -65,6 +66,10 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define for DGUX with <sys/dg_sys_info.h>. */
|
||||
/* #undef DGUX */
|
||||
|
||||
/* Define to the widest signed integer type if <stdint.h> and <inttypes.h> do
|
||||
not define. */
|
||||
#define intmax_t unsigned long
|
||||
|
||||
/* Define to 'unsigned long' or 'unsigned long long'
|
||||
if <inttypes.h> doesn't define. */
|
||||
#define uintmax_t unsigned long
|
||||
@@ -202,24 +207,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
instead of <sys/cpustats.h>. */
|
||||
/* #undef UMAX4_3 */
|
||||
|
||||
/* Name of this package (needed by automake) */
|
||||
#define PACKAGE "%PACKAGE%"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT "bug-make@gnu.org"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "GNU make"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL "https://www.gnu.org/software/make/"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "%VERSION%"
|
||||
|
||||
/* Version of this package (needed by automake) */
|
||||
#define VERSION "%VERSION%"
|
||||
|
||||
/* Define to the name of the SCCS 'get' command. */
|
||||
/* #undef SCCS_GET */
|
||||
|
||||
@@ -13,7 +13,14 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "mkconfig.h"
|
||||
|
||||
#define MK_W32 1
|
||||
|
||||
/* Build for the WINDOWS32 API. */
|
||||
#define WINDOWS32 1
|
||||
|
||||
/* Suppress some Visual C++ warnings.
|
||||
Maybe after the code cleanup for ISO C we can remove some/all of these. */
|
||||
@@ -104,7 +111,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
# define HAVE_DIRECT_H 1
|
||||
#endif
|
||||
|
||||
/* Use platform specific coding */
|
||||
/* Support DOS-style pathnames. */
|
||||
#define HAVE_DOS_PATHS 1
|
||||
|
||||
/* Define to 1 if you have the 'dup' function. */
|
||||
@@ -177,6 +184,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define to 1 if you have the <locale.h> header file. */
|
||||
/* #undef HAVE_LOCALE_H */
|
||||
|
||||
/* Define to 1 if the system has the type 'long long int'. */
|
||||
#define HAVE_LONG_LONG_INT 1
|
||||
|
||||
/* Define to 1 if you have the 'lstat' function. */
|
||||
/* #undef HAVE_LSTAT */
|
||||
|
||||
@@ -390,6 +400,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#define HAVE_TTYNAME 1
|
||||
char *ttyname (int);
|
||||
|
||||
/* Define to 1 if the system has the type `intmax_t'. */
|
||||
#define HAVE_INTMAX_T 1
|
||||
|
||||
/* Define to 1 if the system has the type `uintmax_t'. */
|
||||
#define HAVE_UINTMAX_T 1
|
||||
|
||||
@@ -455,21 +468,6 @@ char *ttyname (int);
|
||||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
||||
/* #undef NO_MINUS_C_MINUS_O */
|
||||
|
||||
/* Name of this package (needed by automake) */
|
||||
#define PACKAGE "%PACKAGE%"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT "bug-make@gnu.org"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "GNU make"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL "https://www.gnu.org/software/make/"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "%VERSION%"
|
||||
|
||||
/* Define to the character that separates directories in PATH. */
|
||||
#define PATH_SEPARATOR_CHAR ';'
|
||||
|
||||
@@ -506,9 +504,6 @@ char *ttyname (int);
|
||||
<sys/cpustats.h>. */
|
||||
/* #undef UMAX4_3 */
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "%VERSION%"
|
||||
|
||||
/* Define if using the dmalloc debugging malloc package */
|
||||
/* #undef WITH_DMALLOC */
|
||||
|
||||
@@ -547,6 +542,14 @@ char *ttyname (int);
|
||||
# define __USE_MINGW_ANSI_STDIO 1
|
||||
#endif
|
||||
|
||||
/* Number of bits in a timestamp, on hosts where this is settable. */
|
||||
/* #undef _TIME_BITS */
|
||||
|
||||
/* For 64-bit time_t on 32-bit mingw. */
|
||||
#ifdef __MINGW32__
|
||||
# define __MINGW_USE_VC2005_COMPAT 1
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/* Define to 'int' if <sys/types.h> doesn't define. */
|
||||
@@ -568,9 +571,10 @@ char *ttyname (int);
|
||||
/* Define to 'int' if <sys/types.h> doesn't define. */
|
||||
#define uid_t int
|
||||
|
||||
/* Define uintmax_t if not defined in <stdint.h> or <inttypes.h>. */
|
||||
/* Define {u,}intmax_t if not defined in <stdint.h> or <inttypes.h>. */
|
||||
#if !HAVE_STDINT_H && !HAVE_INTTYPES_H
|
||||
#define uintmax_t unsigned long
|
||||
#define intmax_t long long
|
||||
#define uintmax_t unsigned long long
|
||||
#endif
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
@@ -13,7 +13,11 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "mkconfig.h"
|
||||
|
||||
#define MK_DJGPP 1
|
||||
|
||||
/* Include this header to make __DJGPP_MINOR__ available because DJGPP ports
|
||||
of GCC 4.3.0 and later no longer do it automatically. */
|
||||
@@ -49,6 +53,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define to 1 if you have the 'getgroups' function. */
|
||||
#define HAVE_GETGROUPS 1
|
||||
|
||||
/* Define to 1 if the system has the type 'long long int'. */
|
||||
#define HAVE_LONG_LONG_INT 1
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
@@ -66,13 +73,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define SCCS_GET "get"
|
||||
|
||||
/* Define to 'unsigned long' or 'unsigned long long'
|
||||
if <inttypes.h> doesn't define. */
|
||||
#define uintmax_t unsigned long long
|
||||
|
||||
/* Define the type of the first arg to select(). */
|
||||
#define fd_set_size_t int
|
||||
|
||||
/* Define to 1 if you have the select function. */
|
||||
#define HAVE_SELECT 1
|
||||
|
||||
@@ -82,35 +82,30 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
/* Define to 1 if you have the 'strncasecmp' function. */
|
||||
#define HAVE_STRNCASECMP 1
|
||||
|
||||
/* Name of the package */
|
||||
#define PACKAGE "%PACKAGE%"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT "bug-%PACKAGE%@gnu.org"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "GNU %PACKAGE%"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "GNU %PACKAGE% %VERSION%"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "%PACKAGE%"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "%VERSION%"
|
||||
/* Define to 1 if you have the `strtoll' function. */
|
||||
#define HAVE_STRTOLL 1
|
||||
|
||||
/* Output sync support */
|
||||
#define NO_OUTPUT_SYNC
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "%VERSION%"
|
||||
#define NO_OUTPUT_SYNC 1
|
||||
|
||||
/* Build host information. */
|
||||
#define MAKE_HOST "i386-pc-msdosdjgpp"
|
||||
|
||||
/* Grok DOS paths (drive specs and backslash path element separators) */
|
||||
#define HAVE_DOS_PATHS
|
||||
#define HAVE_DOS_PATHS 1
|
||||
|
||||
/* Define the type of the first arg to select(). */
|
||||
#define fd_set_size_t int
|
||||
|
||||
/* Define to the widest signed integer type if <stdint.h> and <inttypes.h> do
|
||||
not define. */
|
||||
#define intmax_t long long
|
||||
|
||||
/* Define to `int' if <sys/types.h> does not define. */
|
||||
#if __DJGPP__ == 2 && __DJGPP_MINOR__ < 5
|
||||
#define ssize_t int
|
||||
#endif
|
||||
|
||||
/* Define to 'unsigned long' or 'unsigned long long'
|
||||
if <inttypes.h> doesn't define. */
|
||||
#define uintmax_t unsigned long long
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#define DB_NONE (0x000)
|
||||
#define DB_BASIC (0x001)
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
|
||||
|
||||
23
src/dep.h
23
src/dep.h
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
/* Structure used in chains of names, for parsing and globbing. */
|
||||
@@ -102,24 +102,23 @@ char *tilde_expand (const char *name);
|
||||
struct nameseq *ar_glob (const char *arname, const char *member_pattern, size_t size);
|
||||
#endif
|
||||
|
||||
#define dep_name(d) ((d)->name ? (d)->name : (d)->file->name)
|
||||
#define dep_name(d) ((d)->name ? (d)->name : (d)->file->name)
|
||||
|
||||
#define alloc_seq_elt(_t) xcalloc (sizeof (_t))
|
||||
#define alloc_seq_elt(_t) xcalloc (sizeof (_t))
|
||||
void free_ns_chain (struct nameseq *n);
|
||||
|
||||
#if defined(MAKE_MAINTAINER_MODE) && defined(__GNUC__) && !defined(__STRICT_ANSI__)
|
||||
/* Use inline to get real type-checking. */
|
||||
#define SI static inline
|
||||
SI struct nameseq *alloc_ns() { return alloc_seq_elt (struct nameseq); }
|
||||
SI struct dep *alloc_dep() { return alloc_seq_elt (struct dep); }
|
||||
SI struct goaldep *alloc_goaldep() { return alloc_seq_elt (struct goaldep); }
|
||||
SI struct nameseq *alloc_ns (void) { return alloc_seq_elt (struct nameseq); }
|
||||
SI struct dep *alloc_dep (void) { return alloc_seq_elt (struct dep); }
|
||||
SI struct goaldep *alloc_goaldep (void) { return alloc_seq_elt (struct goaldep); }
|
||||
|
||||
SI void free_ns(struct nameseq *n) { free (n); }
|
||||
SI void free_dep(struct dep *d) { free_ns ((struct nameseq *)d); }
|
||||
SI void free_goaldep(struct goaldep *g) { free_dep ((struct dep *)g); }
|
||||
|
||||
SI void free_dep_chain(struct dep *d) { free_ns_chain((struct nameseq *)d); }
|
||||
SI void free_goal_chain(struct goaldep *g) { free_dep_chain((struct dep *)g); }
|
||||
SI void free_ns (struct nameseq *n) { free (n); }
|
||||
SI void free_dep (struct dep *d) { free_ns ((struct nameseq *)d); }
|
||||
SI void free_goaldep (struct goaldep *g) { free_dep ((struct dep *)g); }
|
||||
SI void free_dep_chain (struct dep *d) { free_ns_chain((struct nameseq *)d); }
|
||||
SI void free_goal_chain (struct goaldep *g) { free_dep_chain((struct dep *)g); }
|
||||
#else
|
||||
# define alloc_ns() alloc_seq_elt (struct nameseq)
|
||||
# define alloc_dep() alloc_seq_elt (struct dep)
|
||||
|
||||
62
src/dir.c
62
src/dir.c
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
#include "hash.h"
|
||||
@@ -521,7 +521,7 @@ find_directory (const char *name)
|
||||
/* See if the directory exists. */
|
||||
#if defined(WINDOWS32)
|
||||
{
|
||||
char tem[MAXPATHLEN], *tstart, *tend;
|
||||
char tem[MAX_PATH+1], *tstart, *tend;
|
||||
size_t len = strlen (name);
|
||||
|
||||
/* Remove any trailing slashes. Windows32 stat fails even on
|
||||
@@ -530,9 +530,7 @@ find_directory (const char *name)
|
||||
tstart = tem;
|
||||
if (tstart[1] == ':')
|
||||
tstart += 2;
|
||||
for (tend = tem + (len - 1);
|
||||
tend > tstart && (*tend == '/' || *tend == '\\');
|
||||
tend--)
|
||||
for (tend = tem + (len - 1); tend > tstart && ISDIRSEP (*tend); tend--)
|
||||
*tend = '\0';
|
||||
|
||||
r = stat (tem, &st);
|
||||
@@ -867,7 +865,7 @@ file_exists_p (const char *name)
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
/* d:/ and d: are *very* different... */
|
||||
if (dirend < name + 3 && name[1] == ':' &&
|
||||
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
|
||||
(ISDIRSEP (*dirend) || *dirend == ':'))
|
||||
dirend++;
|
||||
#endif
|
||||
p = alloca (dirend - name + 1);
|
||||
@@ -943,7 +941,7 @@ file_impossible (const char *filename)
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
/* d:/ and d: are *very* different... */
|
||||
if (dirend < p + 3 && p[1] == ':' &&
|
||||
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
|
||||
(ISDIRSEP (*dirend) || *dirend == ':'))
|
||||
dirend++;
|
||||
#endif
|
||||
cp = alloca (dirend - p + 1);
|
||||
@@ -1041,7 +1039,7 @@ file_impossible_p (const char *filename)
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
/* d:/ and d: are *very* different... */
|
||||
if (dirend < filename + 3 && filename[1] == ':' &&
|
||||
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
|
||||
(ISDIRSEP (*dirend) || *dirend == ':'))
|
||||
dirend++;
|
||||
#endif
|
||||
cp = alloca (dirend - filename + 1);
|
||||
@@ -1102,6 +1100,9 @@ print_dir_data_base (void)
|
||||
unsigned int impossible;
|
||||
struct directory **dir_slot;
|
||||
struct directory **dir_end;
|
||||
#ifdef WINDOWS32
|
||||
char buf[INTSTR_LENGTH + 1];
|
||||
#endif
|
||||
|
||||
puts (_("\n# Directories\n"));
|
||||
|
||||
@@ -1117,24 +1118,19 @@ print_dir_data_base (void)
|
||||
if (dir->contents == 0)
|
||||
printf (_("# %s: could not be stat'd.\n"), dir->name);
|
||||
else if (dir->contents->dirfiles.ht_vec == 0)
|
||||
{
|
||||
#ifdef WINDOWS32
|
||||
printf (_("# %s (key %s, mtime %I64u): could not be opened.\n"),
|
||||
dir->name, dir->contents->path_key,
|
||||
(unsigned long long)dir->contents->mtime);
|
||||
#else /* WINDOWS32 */
|
||||
#ifdef VMS_INO_T
|
||||
printf (_("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n"),
|
||||
dir->name, dir->contents->dev,
|
||||
dir->contents->ino[0], dir->contents->ino[1],
|
||||
dir->contents->ino[2]);
|
||||
printf (_("# %s (key %s, mtime %s): could not be opened.\n"),
|
||||
dir->name, dir->contents->path_key,
|
||||
make_ulltoa ((unsigned long long)dir->contents->mtime, buf));
|
||||
#elif defined(VMS_INO_T)
|
||||
printf (_("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n"),
|
||||
dir->name, dir->contents->dev,
|
||||
dir->contents->ino[0], dir->contents->ino[1],
|
||||
dir->contents->ino[2]);
|
||||
#else
|
||||
printf (_("# %s (device %ld, inode %ld): could not be opened.\n"),
|
||||
dir->name, (long int) dir->contents->dev,
|
||||
(long int) dir->contents->ino);
|
||||
printf (_("# %s (device %ld, inode %ld): could not be opened.\n"),
|
||||
dir->name, (long) dir->contents->dev, (long) dir->contents->ino);
|
||||
#endif
|
||||
#endif /* WINDOWS32 */
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned int f = 0;
|
||||
@@ -1156,21 +1152,18 @@ print_dir_data_base (void)
|
||||
}
|
||||
}
|
||||
#ifdef WINDOWS32
|
||||
printf (_("# %s (key %s, mtime %I64u): "),
|
||||
printf (_("# %s (key %s, mtime %s): "),
|
||||
dir->name, dir->contents->path_key,
|
||||
(unsigned long long)dir->contents->mtime);
|
||||
#else /* WINDOWS32 */
|
||||
#ifdef VMS_INO_T
|
||||
make_ulltoa ((unsigned long long)dir->contents->mtime, buf));
|
||||
#elif defined(VMS_INO_T)
|
||||
printf (_("# %s (device %d, inode [%d,%d,%d]): "),
|
||||
dir->name, dir->contents->dev,
|
||||
dir->contents->ino[0], dir->contents->ino[1],
|
||||
dir->contents->ino[2]);
|
||||
#else
|
||||
printf (_("# %s (device %ld, inode %ld): "),
|
||||
dir->name,
|
||||
printf (_("# %s (device %ld, inode %ld): "), dir->name,
|
||||
(long)dir->contents->dev, (long)dir->contents->ino);
|
||||
#endif
|
||||
#endif /* WINDOWS32 */
|
||||
if (f == 0)
|
||||
fputs (_("No"), stdout);
|
||||
else
|
||||
@@ -1319,13 +1312,12 @@ local_stat (const char *path, struct stat *buf)
|
||||
/* Make sure the parent of "." exists and is a directory, not a
|
||||
file. This is because 'stat' on Windows normalizes the argument
|
||||
foo/. => foo without checking first that foo is a directory. */
|
||||
if (plen > 2 && path[plen - 1] == '.'
|
||||
&& (path[plen - 2] == '/' || path[plen - 2] == '\\'))
|
||||
if (plen > 2 && path[plen - 1] == '.' && ISDIRSEP (path[plen - 2]))
|
||||
{
|
||||
char parent[MAXPATHLEN+1];
|
||||
char parent[MAX_PATH+1];
|
||||
|
||||
strncpy (parent, path, MAXPATHLEN);
|
||||
parent[MIN(plen - 2, MAXPATHLEN)] = '\0';
|
||||
strncpy (parent, path, MAX_PATH);
|
||||
parent[MIN(plen - 2, MAX_PATH)] = '\0';
|
||||
if (stat (parent, buf) < 0 || !_S_ISDIR (buf->st_mode))
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
|
||||
|
||||
29
src/file.c
29
src/file.c
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
|
||||
@@ -108,20 +108,10 @@ lookup_file (const char *name)
|
||||
while (name[0] == '<' && name[1] == '>' && name[2] != '\0')
|
||||
name += 2;
|
||||
#endif
|
||||
while (name[0] == '.'
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
&& (name[1] == '/' || name[1] == '\\')
|
||||
#else
|
||||
&& name[1] == '/'
|
||||
#endif
|
||||
&& name[2] != '\0')
|
||||
while (name[0] == '.' && ISDIRSEP (name[1]) && name[2] != '\0')
|
||||
{
|
||||
name += 2;
|
||||
while (*name == '/'
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
|| *name == '\\'
|
||||
#endif
|
||||
)
|
||||
while (ISDIRSEP (*name))
|
||||
/* Skip following slashes: ".//foo" is "foo", not "/foo". */
|
||||
++name;
|
||||
}
|
||||
@@ -1018,13 +1008,16 @@ file_timestamp_sprintf (char *p, FILE_TIMESTAMP ts)
|
||||
struct tm *tm = localtime (&t);
|
||||
|
||||
if (tm)
|
||||
sprintf (p, "%04d-%02d-%02d %02d:%02d:%02d",
|
||||
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
|
||||
tm->tm_hour, tm->tm_min, tm->tm_sec);
|
||||
{
|
||||
intmax_t year = tm->tm_year;
|
||||
sprintf (p, "%04" PRIdMAX "-%02d-%02d %02d:%02d:%02d",
|
||||
year + 1900, tm->tm_mon + 1, tm->tm_mday,
|
||||
tm->tm_hour, tm->tm_min, tm->tm_sec);
|
||||
}
|
||||
else if (t < 0)
|
||||
sprintf (p, "%ld", (long) t);
|
||||
sprintf (p, "%" PRIdMAX, (intmax_t) t);
|
||||
else
|
||||
sprintf (p, "%lu", (unsigned long) t);
|
||||
sprintf (p, "%" PRIuMAX, (uintmax_t) t);
|
||||
p += strlen (p);
|
||||
|
||||
/* Append nanoseconds as a fraction, but remove trailing zeros. We don't
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
/* Structure that represents the info on one file
|
||||
@@ -212,6 +212,8 @@ FILE_TIMESTAMP f_mtime (struct file *file, int search);
|
||||
<< FILE_TIMESTAMP_LO_BITS) \
|
||||
+ ORDINARY_MTIME_MIN + FILE_TIMESTAMPS_PER_S - 1)
|
||||
|
||||
#define is_ordinary_mtime(_t) ((_t) >= ORDINARY_MTIME_MIN && (_t) <= ORDINARY_MTIME_MAX)
|
||||
|
||||
/* Modtime value to use for 'infinitely new'. We used to get the current time
|
||||
from the system and use that whenever we wanted 'new'. But that causes
|
||||
trouble when the machine running make and the machine holding a file have
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
#include "filedef.h"
|
||||
@@ -816,20 +816,18 @@ func_word (char *o, char **argv, const char *funcname UNUSED)
|
||||
static char *
|
||||
func_wordlist (char *o, char **argv, const char *funcname UNUSED)
|
||||
{
|
||||
char buf[INTSTR_LENGTH + 1];
|
||||
long long start, stop, count;
|
||||
const char* badfirst = _("invalid first argument to 'wordlist' function");
|
||||
const char* badsecond = _("invalid second argument to 'wordlist' function");
|
||||
|
||||
start = parse_numeric (argv[0],
|
||||
_("invalid first argument to 'wordlist' function"));
|
||||
stop = parse_numeric (argv[1],
|
||||
_("invalid second argument to 'wordlist' function"));
|
||||
|
||||
start = parse_numeric (argv[0], badfirst);
|
||||
if (start < 1)
|
||||
ON (fatal, *expanding_var,
|
||||
"invalid first argument to 'wordlist' function: '%lld'", start);
|
||||
OSS (fatal, *expanding_var, "%s: '%s'", badfirst, make_lltoa (start, buf));
|
||||
|
||||
stop = parse_numeric (argv[1], badsecond);
|
||||
if (stop < 0)
|
||||
ON (fatal, *expanding_var,
|
||||
"invalid second argument to 'wordlist' function: '%lld'", stop);
|
||||
OSS (fatal, *expanding_var, "%s: '%s'", badsecond, make_lltoa (stop, buf));
|
||||
|
||||
count = stop - start + 1;
|
||||
|
||||
@@ -987,12 +985,13 @@ a_word_hash_2 (const void *key)
|
||||
static int
|
||||
a_word_hash_cmp (const void *x, const void *y)
|
||||
{
|
||||
int result = (int) ((struct a_word const *) x)->length - ((struct a_word const *) y)->length;
|
||||
if (result)
|
||||
return result;
|
||||
return_STRING_N_COMPARE (((struct a_word const *) x)->str,
|
||||
((struct a_word const *) y)->str,
|
||||
((struct a_word const *) y)->length);
|
||||
const struct a_word *ax = x;
|
||||
const struct a_word *ay = y;
|
||||
|
||||
if (ax->length != ay->length)
|
||||
return ax->length > ay->length ? 1 : -1;
|
||||
|
||||
return_STRING_N_COMPARE (ax->str, ay->str, ax->length);
|
||||
}
|
||||
|
||||
struct a_pattern
|
||||
@@ -1011,7 +1010,7 @@ func_filter_filterout (char *o, char **argv, const char *funcname)
|
||||
struct a_pattern *patterns;
|
||||
struct a_pattern *pat_end;
|
||||
struct a_pattern *pp;
|
||||
size_t pat_count = 0, word_count = 0;
|
||||
unsigned long pat_count = 0, word_count = 0;
|
||||
|
||||
struct hash_table a_word_table;
|
||||
int is_filter = funcname[CSTRLEN ("filter")] == '\0';
|
||||
@@ -2136,7 +2135,7 @@ func_not (char *o, char **argv, char *funcname UNUSED)
|
||||
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
# ifdef __CYGWIN__
|
||||
# define IS_ABSOLUTE(n) ((n[0] && n[1] == ':') || STOP_SET (n[0], MAP_DIRSEP))
|
||||
# define IS_ABSOLUTE(n) ((n[0] && n[1] == ':') || ISDIRSEP (n[0]))
|
||||
# else
|
||||
# define IS_ABSOLUTE(n) (n[0] && n[1] == ':')
|
||||
# endif
|
||||
@@ -2170,9 +2169,9 @@ abspath (const char *name, char *apath)
|
||||
strcpy (apath, starting_directory);
|
||||
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
if (STOP_SET (name[0], MAP_DIRSEP))
|
||||
if (ISDIRSEP (name[0]))
|
||||
{
|
||||
if (STOP_SET (name[1], MAP_DIRSEP))
|
||||
if (ISDIRSEP (name[1]))
|
||||
{
|
||||
/* A UNC. Don't prepend a drive letter. */
|
||||
apath[0] = name[0];
|
||||
@@ -2192,7 +2191,7 @@ abspath (const char *name, char *apath)
|
||||
else
|
||||
{
|
||||
#if defined(__CYGWIN__) && defined(HAVE_DOS_PATHS)
|
||||
if (STOP_SET (name[0], MAP_DIRSEP))
|
||||
if (ISDIRSEP (name[0]))
|
||||
root_len = 1;
|
||||
#endif
|
||||
memcpy (apath, name, root_len);
|
||||
@@ -2201,7 +2200,7 @@ abspath (const char *name, char *apath)
|
||||
/* Get past the root, since we already copied it. */
|
||||
name += root_len;
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
if (! STOP_SET (apath[root_len - 1], MAP_DIRSEP))
|
||||
if (! ISDIRSEP (apath[root_len - 1]))
|
||||
{
|
||||
/* Convert d:foo into d:./foo and increase root_len. */
|
||||
apath[2] = '.';
|
||||
@@ -2221,7 +2220,7 @@ abspath (const char *name, char *apath)
|
||||
size_t len;
|
||||
|
||||
/* Skip sequence of multiple path-separators. */
|
||||
while (STOP_SET (*start, MAP_DIRSEP))
|
||||
while (ISDIRSEP (*start))
|
||||
++start;
|
||||
|
||||
/* Find end of path component. */
|
||||
@@ -2238,12 +2237,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_DIRSEP); --dest)
|
||||
for (--dest; ! ISDIRSEP (dest[-1]); --dest)
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! STOP_SET (dest[-1], MAP_DIRSEP))
|
||||
if (! ISDIRSEP (dest[-1]))
|
||||
*dest++ = '/';
|
||||
|
||||
if (dest + len >= apath_limit)
|
||||
@@ -2255,7 +2254,7 @@ abspath (const char *name, char *apath)
|
||||
}
|
||||
|
||||
/* Unless it is root strip trailing separator. */
|
||||
if (dest > apath + root_len && STOP_SET (dest[-1], MAP_DIRSEP))
|
||||
if (dest > apath + root_len && ISDIRSEP (dest[-1]))
|
||||
--dest;
|
||||
|
||||
*dest = '\0';
|
||||
@@ -2518,14 +2517,14 @@ static struct function_table_entry function_table_init[] =
|
||||
/* These must come after the definition of function_table. */
|
||||
|
||||
static char *
|
||||
expand_builtin_function (char *o, int argc, char **argv,
|
||||
expand_builtin_function (char *o, unsigned int argc, char **argv,
|
||||
const struct function_table_entry *entry_p)
|
||||
{
|
||||
char *p;
|
||||
|
||||
if (argc < (int)entry_p->minimum_args)
|
||||
if (argc < entry_p->minimum_args)
|
||||
fatal (*expanding_var, strlen (entry_p->name),
|
||||
_("insufficient number of arguments (%d) to function '%s'"),
|
||||
_("insufficient number of arguments (%u) to function '%s'"),
|
||||
argc, entry_p->name);
|
||||
|
||||
/* I suppose technically some function could do something with no arguments,
|
||||
@@ -2574,7 +2573,7 @@ handle_function (char **op, const char **stringp)
|
||||
int count = 0;
|
||||
char *abeg = NULL;
|
||||
char **argv, **argvp;
|
||||
int nargs;
|
||||
unsigned int nargs;
|
||||
|
||||
beg = *stringp + 1;
|
||||
|
||||
@@ -2686,11 +2685,11 @@ handle_function (char **op, const char **stringp)
|
||||
static char *
|
||||
func_call (char *o, char **argv, const char *funcname UNUSED)
|
||||
{
|
||||
static int max_args = 0;
|
||||
static unsigned int max_args = 0;
|
||||
char *fname;
|
||||
char *body;
|
||||
size_t flen;
|
||||
int i;
|
||||
unsigned int i;
|
||||
int saved_args;
|
||||
const struct function_table_entry *entry_p;
|
||||
struct variable *v;
|
||||
@@ -2741,7 +2740,7 @@ func_call (char *o, char **argv, const char *funcname UNUSED)
|
||||
{
|
||||
char num[INTSTR_LENGTH];
|
||||
|
||||
sprintf (num, "%d", i);
|
||||
sprintf (num, "%u", i);
|
||||
define_variable (num, strlen (num), *argv, o_automatic, 0);
|
||||
}
|
||||
|
||||
@@ -2754,7 +2753,7 @@ func_call (char *o, char **argv, const char *funcname UNUSED)
|
||||
{
|
||||
char num[INTSTR_LENGTH];
|
||||
|
||||
sprintf (num, "%d", i);
|
||||
sprintf (num, "%u", i);
|
||||
define_variable (num, strlen (num), "", o_automatic, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
|
||||
Ditto for AIX 3.2 and <stdlib.h>. */
|
||||
|
||||
@@ -14,7 +14,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _GETOPT_H
|
||||
#define _GETOPT_H 1
|
||||
|
||||
@@ -14,7 +14,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _LIBGETTEXT_H
|
||||
#define _LIBGETTEXT_H 1
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
;; 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/>.
|
||||
;; with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
(define (to-string-maybe x)
|
||||
(cond
|
||||
|
||||
@@ -14,7 +14,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _GNUMAKE_H_
|
||||
#define _GNUMAKE_H_
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
#include "hash.h"
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _hash_h_
|
||||
#define _hash_h_
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
#include "filedef.h"
|
||||
@@ -234,7 +234,9 @@ pattern_search (struct file *file, int archive,
|
||||
We may replace % by $(*F) for second expansion, increasing the length. */
|
||||
size_t deplen = namelen + max_pattern_dep_length + 4;
|
||||
char *depname = alloca (deplen);
|
||||
#ifndef NDEBUG
|
||||
char *dend = depname + deplen;
|
||||
#endif
|
||||
|
||||
/* The start and length of the stem of FILENAME for the current rule. */
|
||||
const char *stem = 0;
|
||||
|
||||
80
src/job.c
80
src/job.c
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
|
||||
@@ -204,6 +204,15 @@ int getgid ();
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if HAVE_SYS_LOADAVG_H
|
||||
# include <sys/time.h>
|
||||
# include <sys/loadavg.h>
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_DECL_GETLOADAVG
|
||||
int getloadavg (double loadavg[], int nelem);
|
||||
#endif
|
||||
|
||||
/* Different systems have different requirements for pid_t.
|
||||
Plus we have to support gettext string translation... Argh. */
|
||||
static const char *
|
||||
@@ -220,10 +229,6 @@ pid2str (pid_t pid)
|
||||
return pidstring;
|
||||
}
|
||||
|
||||
#ifndef HAVE_DECL_GETLOADAVG
|
||||
int getloadavg (double loadavg[], int nelem);
|
||||
#endif
|
||||
|
||||
static void free_child (struct child *);
|
||||
static void start_job_command (struct child *child);
|
||||
static int load_too_high (void);
|
||||
@@ -278,7 +283,7 @@ create_batch_file (char const *base, int unixy, int *fd)
|
||||
{
|
||||
const char *const ext = unixy ? "sh" : "bat";
|
||||
const char *error_string = NULL;
|
||||
char temp_path[MAXPATHLEN]; /* need to know its length */
|
||||
char temp_path[MAX_PATH+1]; /* need to know its length */
|
||||
unsigned path_size = GetTempPath (sizeof temp_path, temp_path);
|
||||
int path_is_dot = 0;
|
||||
/* The following variable is static so we won't try to reuse a name
|
||||
@@ -411,7 +416,8 @@ _is_unixy_shell (const char *path)
|
||||
else if (!name) /* name and p must be 0 */
|
||||
name = path;
|
||||
|
||||
if (*name == '/' || *name == '\\') name++;
|
||||
if (ISDIRSEP (*name))
|
||||
name++;
|
||||
|
||||
i = 0;
|
||||
while (known_os2shells[i] != NULL)
|
||||
@@ -434,38 +440,30 @@ is_bourne_compatible_shell (const char *path)
|
||||
static const char *unix_shells[] = {
|
||||
"sh",
|
||||
"bash",
|
||||
"dash",
|
||||
"ksh",
|
||||
"rksh",
|
||||
"zsh",
|
||||
"ash",
|
||||
"dash",
|
||||
NULL
|
||||
};
|
||||
const char **s;
|
||||
|
||||
/* find the rightmost '/' or '\\' */
|
||||
const char *name = strrchr (path, '/');
|
||||
char *p = strrchr (path, '\\');
|
||||
/* find the last directory separator, or the beginning of the string. */
|
||||
const char *cp = path + strlen (path);
|
||||
|
||||
if (name && p) /* take the max */
|
||||
name = (name > p) ? name : p;
|
||||
else if (p) /* name must be 0 */
|
||||
name = p;
|
||||
else if (!name) /* name and p must be 0 */
|
||||
name = path;
|
||||
|
||||
if (*name == '/' || *name == '\\')
|
||||
++name;
|
||||
while (cp > path && !ISDIRSEP (cp[-1]))
|
||||
--cp;
|
||||
|
||||
/* this should be able to deal with extensions on Windows-like systems */
|
||||
for (s = unix_shells; *s != NULL; ++s)
|
||||
{
|
||||
#if defined(WINDOWS32) || defined(__MSDOS__)
|
||||
size_t len = strlen (*s);
|
||||
if ((strlen (name) >= len && STOP_SET (name[len], MAP_DOT|MAP_NUL))
|
||||
&& strncasecmp (name, *s, len) == 0)
|
||||
if ((strlen (cp) >= len && STOP_SET (cp[len], MAP_DOT|MAP_NUL))
|
||||
&& strncasecmp (cp, *s, len) == 0)
|
||||
#else
|
||||
if (strcmp (name, *s) == 0)
|
||||
if (strcmp (cp, *s) == 0)
|
||||
#endif
|
||||
return 1; /* a known unix-style shell */
|
||||
}
|
||||
@@ -1460,9 +1458,6 @@ start_job_command (struct child *child)
|
||||
#endif /* !VMS */
|
||||
{
|
||||
/* Fork the child process. */
|
||||
|
||||
char **parent_environ;
|
||||
|
||||
run_local:
|
||||
block_sigs ();
|
||||
|
||||
@@ -1473,14 +1468,11 @@ start_job_command (struct child *child)
|
||||
|
||||
#else
|
||||
|
||||
parent_environ = environ;
|
||||
|
||||
jobserver_pre_child (flags & COMMANDS_RECURSE);
|
||||
|
||||
child->pid = child_execute_job ((struct childbase *)child,
|
||||
child->good_stdin, argv);
|
||||
|
||||
environ = parent_environ; /* Restore value child may have clobbered. */
|
||||
jobserver_post_child (flags & COMMANDS_RECURSE);
|
||||
|
||||
#endif /* !VMS */
|
||||
@@ -1503,7 +1495,7 @@ start_job_command (struct child *child)
|
||||
char *cmdline = argv[0];
|
||||
/* We don't have a way to pass environment to 'system',
|
||||
so we need to save and restore ours, sigh... */
|
||||
char **parent_environ = environ;
|
||||
char **parent_env = environ;
|
||||
|
||||
environ = child->environment;
|
||||
|
||||
@@ -1518,7 +1510,7 @@ start_job_command (struct child *child)
|
||||
|
||||
dos_command_running = 1;
|
||||
proc_return = system (cmdline);
|
||||
environ = parent_environ;
|
||||
environ = parent_env;
|
||||
execute_by_shell = 0; /* for the next time */
|
||||
}
|
||||
else
|
||||
@@ -2100,6 +2092,7 @@ load_too_high (void)
|
||||
}
|
||||
|
||||
/* Find the real system load average. */
|
||||
errno = 0;
|
||||
if (getloadavg (&load, 1) != 1)
|
||||
{
|
||||
static int lossage = -1;
|
||||
@@ -2299,9 +2292,16 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
|
||||
|
||||
#if !defined(USE_POSIX_SPAWN)
|
||||
|
||||
pid = vfork();
|
||||
if (pid != 0)
|
||||
return pid;
|
||||
{
|
||||
/* The child may clobber environ so remember ours and restore it. */
|
||||
char **parent_env = environ;
|
||||
pid = vfork ();
|
||||
if (pid != 0)
|
||||
{
|
||||
environ = parent_env;
|
||||
return pid;
|
||||
}
|
||||
}
|
||||
|
||||
/* We are the child. */
|
||||
unblock_all_sigs ();
|
||||
@@ -2552,7 +2552,9 @@ exec_command (char **argv, char **envp)
|
||||
errno = ENOEXEC;
|
||||
|
||||
# else
|
||||
/* Run the program. */
|
||||
|
||||
/* Run the program. Don't use execvpe() as we want the search for argv[0]
|
||||
to use the new PATH, but execvpe() searches before resetting PATH. */
|
||||
environ = envp;
|
||||
execvp (argv[0], argv);
|
||||
|
||||
@@ -3045,8 +3047,7 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (p[1] != '\\' && p[1] != '\''
|
||||
&& !ISSPACE (p[1])
|
||||
if (p[1] != '\\' && p[1] != '\'' && !ISSPACE (p[1])
|
||||
&& strchr (sh_chars_sh, p[1]) == 0)
|
||||
/* back up one notch, to copy the backslash */
|
||||
--p;
|
||||
@@ -3472,7 +3473,7 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
|
||||
|
||||
#ifdef WINDOWS32
|
||||
/* Some shells do not work well when invoked as 'sh -c xxx' to run a
|
||||
command line (e.g. Cygnus GNUWIN32 sh.exe on WIN32 systems). In these
|
||||
command line (e.g. Cygnus GNUWIN32 sh.exe on W32 systems). In these
|
||||
cases, run commands via a script file. */
|
||||
if (just_print_flag && !(flags & COMMANDS_RECURSE))
|
||||
{
|
||||
@@ -3680,8 +3681,7 @@ construct_command_argv (char *line, char **restp, struct file *file,
|
||||
performed) and if shell is an absolute path without drive letter,
|
||||
try whether it exists e.g.: if "/bin/sh" does not exist use
|
||||
"$UNIXROOT/bin/sh" instead. */
|
||||
if (unixroot && shell && strcmp (shell, last_shell) != 0
|
||||
&& (shell[0] == '/' || shell[0] == '\\'))
|
||||
if (unixroot && shell && ISDIRSEP (shell[0]) && !streq (shell, last_shell))
|
||||
{
|
||||
/* trying a new shell, check whether it exists */
|
||||
size_t size = strlen (shell);
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "output.h"
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
|
||||
|
||||
88
src/main.c
88
src/main.c
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
#include "os.h"
|
||||
@@ -989,7 +989,7 @@ handle_runtime_exceptions (struct _EXCEPTION_POINTERS *exinfo)
|
||||
}
|
||||
|
||||
/*
|
||||
* On WIN32 systems we don't have the luxury of a /bin directory that
|
||||
* On W32 systems we don't have the luxury of a /bin directory that
|
||||
* is mapped globally to every drive mounted to the system. Since make could
|
||||
* be invoked from any drive, and we don't want to propagate /bin/sh
|
||||
* to every single drive. Allow ourselves a chance to search for
|
||||
@@ -1016,12 +1016,10 @@ find_and_set_default_shell (const char *token)
|
||||
"cmd.exe" case-insensitive. */
|
||||
tokend = search_token + strlen (search_token) - 3;
|
||||
if (((tokend == search_token
|
||||
|| (tokend > search_token
|
||||
&& (tokend[-1] == '/' || tokend[-1] == '\\')))
|
||||
|| (tokend > search_token && ISDIRSEP (tokend[-1])))
|
||||
&& !strcasecmp (tokend, "cmd"))
|
||||
|| ((tokend - 4 == search_token
|
||||
|| (tokend - 4 > search_token
|
||||
&& (tokend[-5] == '/' || tokend[-5] == '\\')))
|
||||
|| (tokend - 4 > search_token && ISDIRSEP (tokend[-5])))
|
||||
&& !strcasecmp (tokend - 4, "cmd.exe")))
|
||||
{
|
||||
batch_mode_shell = 1;
|
||||
@@ -1137,6 +1135,23 @@ reset_jobserver (void)
|
||||
jobserver_auth = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
temp_stdin_unlink ()
|
||||
{
|
||||
/* This function is called from a signal handler. Keep async-signal-safe.
|
||||
If there is a temp file from reading from stdin, get rid of it. */
|
||||
if (stdin_offset >= 0)
|
||||
{
|
||||
const char *nm = makefiles->list[stdin_offset];
|
||||
int r = 0;
|
||||
|
||||
stdin_offset = -1;
|
||||
EINTRLOOP(r, unlink (nm));
|
||||
if (r < 0 && errno != ENOENT && !handling_fatal_signal)
|
||||
perror_with_name (_("unlink (temporary file): "), nm);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _AMIGA
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
@@ -1167,6 +1182,11 @@ main (int argc, char **argv, char **envp)
|
||||
/* Useful for attaching debuggers, etc. */
|
||||
SPIN ("main-entry");
|
||||
|
||||
/* Don't die if our stdout sends us SIGPIPE. */
|
||||
#ifdef SIGPIPE
|
||||
bsd_signal (SIGPIPE, SIG_IGN);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ATEXIT
|
||||
if (ANY_SET (check_io_state (), IO_STDOUT_OK))
|
||||
atexit (close_stdout);
|
||||
@@ -1303,7 +1323,7 @@ main (int argc, char **argv, char **envp)
|
||||
else
|
||||
{
|
||||
program = start + strlen (start);
|
||||
while (program > start && ! STOP_SET (program[-1], MAP_DIRSEP))
|
||||
while (program > start && ! ISDIRSEP (program[-1]))
|
||||
--program;
|
||||
|
||||
/* Remove the .exe extension if present. */
|
||||
@@ -1370,6 +1390,10 @@ main (int argc, char **argv, char **envp)
|
||||
|
||||
initialize_global_hash_tables ();
|
||||
|
||||
/* Ensure the temp directory is set up: we don't want the first time we use
|
||||
it to be in a forked process. */
|
||||
get_tmpdir ();
|
||||
|
||||
/* Figure out where we are. */
|
||||
|
||||
#ifdef WINDOWS32
|
||||
@@ -1745,7 +1769,7 @@ main (int argc, char **argv, char **envp)
|
||||
But allow -C/ just in case someone wants that. */
|
||||
{
|
||||
char *p = (char *)dir + strlen (dir) - 1;
|
||||
while (p > dir && (p[0] == '/' || p[0] == '\\'))
|
||||
while (p > dir && ISDIRSEP (p[0]))
|
||||
--p;
|
||||
p[1] = '\0';
|
||||
}
|
||||
@@ -1906,9 +1930,7 @@ main (int argc, char **argv, char **envp)
|
||||
_("Makefile from standard input specified twice"));
|
||||
|
||||
outfile = get_tmpfile (&newnm);
|
||||
if (outfile == 0)
|
||||
OSS (fatal, NILF,
|
||||
_("fopen: temporary file %s: %s"), newnm, strerror (errno));
|
||||
|
||||
while (!feof (stdin) && ! ferror (stdin))
|
||||
{
|
||||
char buf[2048];
|
||||
@@ -1919,8 +1941,8 @@ main (int argc, char **argv, char **envp)
|
||||
}
|
||||
fclose (outfile);
|
||||
|
||||
/* Replace the name that read_all_makefiles will
|
||||
see with the name of the temporary file. */
|
||||
/* Replace the name that read_all_makefiles will see with the name
|
||||
of the temporary file. */
|
||||
makefiles->list[i] = strcache_add (newnm);
|
||||
stdin_offset = i;
|
||||
|
||||
@@ -2206,7 +2228,7 @@ main (int argc, char **argv, char **envp)
|
||||
|
||||
if (syncing)
|
||||
{
|
||||
/* If there a mutex we're the child, else we're the origin. */
|
||||
/* If there is no mutex we're the base: create one. Else parse it. */
|
||||
if (!sync_mutex)
|
||||
{
|
||||
osync_setup ();
|
||||
@@ -2214,12 +2236,19 @@ main (int argc, char **argv, char **envp)
|
||||
}
|
||||
else if (!osync_parse_mutex (sync_mutex))
|
||||
{
|
||||
/* Parsing failed; continue without output sync. */
|
||||
osync_clear ();
|
||||
free (sync_mutex);
|
||||
sync_mutex = NULL;
|
||||
syncing = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (jobserver_auth)
|
||||
DB (DB_VERBOSE|DB_JOBS, (_("Using jobserver controller %s\n"), jobserver_auth));
|
||||
if (sync_mutex)
|
||||
DB (DB_VERBOSE, (_("Using output-sync mutex %s\n"), sync_mutex));
|
||||
|
||||
#ifndef MAKE_SYMLINKS
|
||||
if (check_symlink_flag)
|
||||
{
|
||||
@@ -2294,6 +2323,9 @@ main (int argc, char **argv, char **envp)
|
||||
OUTPUT_UNSET ();
|
||||
output_close (&make_sync);
|
||||
|
||||
if (shuffle_mode)
|
||||
DB (DB_BASIC, (_("Enabled shuffle mode: %s\n"), shuffle_mode));
|
||||
|
||||
if (read_files)
|
||||
{
|
||||
/* Update any makefiles if necessary. */
|
||||
@@ -2558,13 +2590,11 @@ main (int argc, char **argv, char **envp)
|
||||
|
||||
for (; *av; ++av, ++nv)
|
||||
{
|
||||
size_t len;
|
||||
char *f;
|
||||
char *a = *av;
|
||||
const char *mf = makefiles->list[mfidx];
|
||||
|
||||
len = strlen (a);
|
||||
assert (len > 0);
|
||||
assert (strlen (a) > 0);
|
||||
|
||||
*nv = a;
|
||||
|
||||
@@ -2729,6 +2759,8 @@ main (int argc, char **argv, char **envp)
|
||||
fflush (stdout);
|
||||
fflush (stderr);
|
||||
|
||||
osync_clear();
|
||||
|
||||
/* The exec'd "child" will be another make, of course. */
|
||||
jobserver_pre_child(1);
|
||||
|
||||
@@ -2769,9 +2801,7 @@ main (int argc, char **argv, char **envp)
|
||||
#endif
|
||||
jobserver_post_child(1);
|
||||
|
||||
/* Get rid of any stdin temp file. */
|
||||
if (stdin_offset >= 0)
|
||||
unlink (makefiles->list[stdin_offset]);
|
||||
temp_stdin_unlink ();
|
||||
|
||||
_exit (127);
|
||||
}
|
||||
@@ -2797,15 +2827,7 @@ main (int argc, char **argv, char **envp)
|
||||
}
|
||||
}
|
||||
|
||||
/* If there is a temp file from reading a makefile from stdin, get rid of
|
||||
it now. */
|
||||
if (stdin_offset >= 0)
|
||||
{
|
||||
const char *nm = makefiles->list[stdin_offset];
|
||||
if (unlink (nm) < 0 && errno != ENOENT)
|
||||
perror_with_name (_("unlink (temporary file): "), nm);
|
||||
stdin_offset = -1;
|
||||
}
|
||||
temp_stdin_unlink ();
|
||||
|
||||
/* If there were no command-line goals, use the default. */
|
||||
if (goals == 0)
|
||||
@@ -3724,13 +3746,7 @@ die (int status)
|
||||
print_version ();
|
||||
|
||||
/* Get rid of a temp file from reading a makefile from stdin. */
|
||||
if (stdin_offset >= 0)
|
||||
{
|
||||
const char *nm = makefiles->list[stdin_offset];
|
||||
if (unlink (nm) < 0 && errno != ENOENT)
|
||||
perror_with_name (_("unlink (temporary file): "), nm);
|
||||
stdin_offset = -1;
|
||||
}
|
||||
temp_stdin_unlink ();
|
||||
|
||||
/* Wait for children to die. */
|
||||
err = (status != 0);
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* We use <config.h> instead of "config.h" so that a compilation
|
||||
using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
|
||||
@@ -152,13 +152,14 @@ extern int errno;
|
||||
#endif
|
||||
|
||||
#ifndef PATH_MAX
|
||||
# ifndef POSIX
|
||||
# ifdef MAXPATHLEN
|
||||
# define PATH_MAX MAXPATHLEN
|
||||
# else
|
||||
/* Some systems (HURD) have fully dynamic pathnames with no maximum.
|
||||
Ideally we'd support this but it will take some work. */
|
||||
# define PATH_MAX 4096
|
||||
# endif
|
||||
#endif
|
||||
#ifndef MAXPATHLEN
|
||||
# define MAXPATHLEN 1024
|
||||
#endif
|
||||
|
||||
#ifdef PATH_MAX
|
||||
# define GET_PATH_MAX PATH_MAX
|
||||
@@ -294,6 +295,21 @@ char *strerror (int errnum);
|
||||
#if HAVE_STDINT_H
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
#if defined _MSC_VER || defined __MINGW32__
|
||||
# define MK_PRI64_PREFIX "I64"
|
||||
#else
|
||||
# define MK_PRI64_PREFIX "ll"
|
||||
#endif
|
||||
#ifndef PRIdMAX
|
||||
# define PRIdMAX MK_PRI64_PREFIX "d"
|
||||
#endif
|
||||
#ifndef PRIuMAX
|
||||
# define PRIuMAX MK_PRI64_PREFIX "u"
|
||||
#endif
|
||||
#ifndef SCNdMAX
|
||||
# define SCNdMAX PRIdMAX
|
||||
#endif
|
||||
#define FILE_TIMESTAMP uintmax_t
|
||||
|
||||
#if !defined(HAVE_STRSIGNAL)
|
||||
@@ -453,6 +469,8 @@ extern int unixy_shell;
|
||||
|
||||
#define STOP_SET(_v,_m) ANY_SET(stopchar_map[(unsigned char)(_v)],(_m))
|
||||
|
||||
/* True if C is a directory separator on the current system. */
|
||||
#define ISDIRSEP(c) STOP_SET((c),MAP_DIRSEP)
|
||||
/* True if C is whitespace but not newline. */
|
||||
#define ISBLANK(c) STOP_SET((c),MAP_BLANK)
|
||||
/* True if C is whitespace including newlines. */
|
||||
@@ -477,6 +495,8 @@ extern struct rlimit stack_limit;
|
||||
|
||||
/* Number of characters in a string constant. Does NOT include the \0 byte. */
|
||||
#define CSTRLEN(_s) (sizeof (_s)-1)
|
||||
|
||||
/* Only usable when NOT calling a macro: only use it for local functions. */
|
||||
#define STRING_SIZE_TUPLE(_s) (_s), CSTRLEN(_s)
|
||||
|
||||
/* The number of bytes needed to represent the largest signed and unsigned
|
||||
@@ -492,6 +512,15 @@ extern struct rlimit stack_limit;
|
||||
# define TTYNAME(_f) DEFAULT_TTYNAME
|
||||
#endif
|
||||
|
||||
#ifdef VMS
|
||||
# define DEFAULT_TMPDIR "/sys$scratch/"
|
||||
#elif defined(P_tmpdir)
|
||||
# define DEFAULT_TMPDIR P_tmpdir
|
||||
#else
|
||||
# define DEFAULT_TMPDIR "/tmp"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
struct file;
|
||||
@@ -511,7 +540,7 @@ void error (const floc *flocp, size_t length, const char *fmt, ...)
|
||||
ATTRIBUTE ((__format__ (__printf__, 3, 4)));
|
||||
void fatal (const floc *flocp, size_t length, const char *fmt, ...)
|
||||
ATTRIBUTE ((noreturn, __format__ (__printf__, 3, 4)));
|
||||
void out_of_memory () NORETURN;
|
||||
void out_of_memory (void) NORETURN;
|
||||
|
||||
/* When adding macros to this list be sure to update the value of
|
||||
XGETTEXT_OPTIONS in the po/Makevars file. */
|
||||
@@ -530,12 +559,17 @@ void out_of_memory () NORETURN;
|
||||
(_f), (_n), (_s))
|
||||
|
||||
void decode_env_switches (const char*, size_t line);
|
||||
void temp_stdin_unlink (void);
|
||||
void die (int) NORETURN;
|
||||
void pfatal_with_name (const char *) NORETURN;
|
||||
void perror_with_name (const char *, const char *);
|
||||
#define xstrlen(_s) ((_s)==NULL ? 0 : strlen (_s))
|
||||
unsigned int make_toui (const char*, const char**);
|
||||
pid_t make_pid ();
|
||||
char *make_lltoa (long long, char *);
|
||||
char *make_ulltoa (unsigned long long, char *);
|
||||
void make_seed (unsigned int);
|
||||
unsigned int make_rand (void);
|
||||
pid_t make_pid (void);
|
||||
void *xmalloc (size_t);
|
||||
void *xcalloc (size_t);
|
||||
void *xrealloc (void *, size_t);
|
||||
@@ -550,7 +584,7 @@ int alpha_compare (const void *, const void *);
|
||||
void print_spaces (unsigned int);
|
||||
char *find_percent (char *);
|
||||
const char *find_percent_cached (const char **);
|
||||
char *get_tmppath ();
|
||||
const char *get_tmpdir (void);
|
||||
int get_tmpfd (char **);
|
||||
FILE *get_tmpfile (char **);
|
||||
ssize_t writebuf (int, const void *, size_t);
|
||||
@@ -566,13 +600,14 @@ void ar_parse_name (const char *, char **, char **);
|
||||
int ar_touch (const char *);
|
||||
time_t ar_member_date (const char *);
|
||||
|
||||
typedef long int (*ar_member_func_t) (int desc, const char *mem, int truncated,
|
||||
typedef intmax_t (*ar_member_func_t) (int desc, const char *mem, int truncated,
|
||||
long int hdrpos, long int datapos,
|
||||
long int size, long int date, int uid,
|
||||
long int size, intmax_t date, int uid,
|
||||
int gid, unsigned int mode,
|
||||
const void *arg);
|
||||
|
||||
long int ar_scan (const char *archive, ar_member_func_t function, const void *arg);
|
||||
intmax_t ar_scan (const char *archive, ar_member_func_t function,
|
||||
const void *arg);
|
||||
int ar_name_equal (const char *name, const char *mem, int truncated);
|
||||
#ifndef VMS
|
||||
int ar_member_touch (const char *arname, const char *memname);
|
||||
@@ -625,8 +660,12 @@ int unload_file (const char *name);
|
||||
#ifdef MAKE_MAINTAINER_MODE
|
||||
# define SPIN(_s) spin (_s)
|
||||
void spin (const char* suffix);
|
||||
# define DBG(_f) dbg _f
|
||||
void dbg (const char *fmt, ...);
|
||||
#else
|
||||
# define SPIN(_s)
|
||||
/* Never put this code into Git or a release. */
|
||||
# define DBG(_f) compile-error
|
||||
#endif
|
||||
|
||||
/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION,
|
||||
@@ -640,10 +679,10 @@ long int lseek ();
|
||||
|
||||
# ifdef HAVE_GETCWD
|
||||
# if !defined(VMS) && !defined(__DECC)
|
||||
char *getcwd ();
|
||||
char *getcwd (void);
|
||||
# endif
|
||||
# else
|
||||
char *getwd ();
|
||||
char *getwd (void);
|
||||
# define getcwd(buf, len) getwd (buf)
|
||||
# endif
|
||||
|
||||
@@ -667,7 +706,7 @@ int strcasecmp (const char *s1, const char *s2);
|
||||
# define strncasecmp strncmpi
|
||||
# else
|
||||
/* Create our own, in misc.c */
|
||||
int strncasecmp (const char *s1, const char *s2, int n);
|
||||
int strncasecmp (const char *s1, const char *s2, size_t n);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -771,7 +810,7 @@ extern char *version_string, *remote_description, *make_host;
|
||||
|
||||
extern unsigned int commands_started;
|
||||
|
||||
extern int handling_fatal_signal;
|
||||
extern volatile sig_atomic_t handling_fatal_signal;
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(_a,_b) ((_a)<(_b)?(_a):(_b))
|
||||
|
||||
204
src/misc.c
204
src/misc.c
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
#include "filedef.h"
|
||||
@@ -54,6 +54,52 @@ make_toui (const char *str, const char **error)
|
||||
return val;
|
||||
}
|
||||
|
||||
/* Convert val into a string, written to buf. buf must be large enough
|
||||
to hold the largest possible value, plus a nul byte. Returns buf.
|
||||
We can't use standard PRI* here: those are based on intNN_t types. */
|
||||
|
||||
char *
|
||||
make_lltoa (long long val, char *buf)
|
||||
{
|
||||
sprintf (buf, "%" MK_PRI64_PREFIX "d", val);
|
||||
return buf;
|
||||
}
|
||||
|
||||
char *
|
||||
make_ulltoa (unsigned long long val, char *buf)
|
||||
{
|
||||
sprintf (buf, "%" MK_PRI64_PREFIX "u", val);
|
||||
return buf;
|
||||
}
|
||||
|
||||
/* Simple random number generator, for use with shuffle.
|
||||
This doesn't need to be truly random, just pretty random. Use our own
|
||||
implementation rather than relying on the C runtime's rand() so we always
|
||||
get the same results for a given seed, regardless of C runtime. */
|
||||
|
||||
static unsigned int mk_state = 0;
|
||||
|
||||
void
|
||||
make_seed (unsigned int seed)
|
||||
{
|
||||
mk_state = seed;
|
||||
}
|
||||
|
||||
unsigned int
|
||||
make_rand ()
|
||||
{
|
||||
/* mk_state must never be 0. */
|
||||
if (mk_state == 0)
|
||||
mk_state = (unsigned int)(time (NULL) ^ make_pid ()) + 1;
|
||||
|
||||
/* A simple xorshift RNG. */
|
||||
mk_state ^= mk_state << 13;
|
||||
mk_state ^= mk_state >> 17;
|
||||
mk_state ^= mk_state << 5;
|
||||
|
||||
return mk_state;
|
||||
}
|
||||
|
||||
/* Compare strings *S1 and *S2.
|
||||
Return negative if the first is less, positive if it is greater,
|
||||
zero if they are equal. */
|
||||
@@ -484,6 +530,22 @@ spin (const char* type)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
dbg (const char *fmt, ...)
|
||||
{
|
||||
FILE *fp = fopen ("/tmp/gmkdebug.log", "a+");
|
||||
va_list args;
|
||||
char buf[4096];
|
||||
|
||||
va_start (args, fmt);
|
||||
vsprintf (buf, fmt, args);
|
||||
va_end (args);
|
||||
|
||||
fprintf(fp, "%u: %s\n", (unsigned) make_pid (), buf);
|
||||
fflush (fp);
|
||||
fclose (fp);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -506,33 +568,49 @@ umask (mode_t mask)
|
||||
}
|
||||
#endif
|
||||
|
||||
#define MAKE_TMPDIR "MAKE_TMPDIR"
|
||||
#ifdef VMS
|
||||
# define DEFAULT_TMPFILE "sys$scratch:gnv$make_cmdXXXXXX.com"
|
||||
# define DEFAULT_TMPDIR "/sys$scratch/"
|
||||
#else
|
||||
# define DEFAULT_TMPFILE "GmXXXXXX"
|
||||
# ifdef P_tmpdir
|
||||
# define DEFAULT_TMPDIR P_tmpdir
|
||||
# else
|
||||
# define DEFAULT_TMPDIR "/tmp"
|
||||
# endif
|
||||
# define DEFAULT_TMPFILE "GmXXXXXX"
|
||||
#endif
|
||||
|
||||
static const char *
|
||||
const char *
|
||||
get_tmpdir ()
|
||||
{
|
||||
static const char *tmpdir = NULL;
|
||||
|
||||
if (!tmpdir)
|
||||
{
|
||||
if (((tmpdir = getenv (MAKE_TMPDIR)) == NULL || *tmpdir == '\0')
|
||||
#if defined (__MSDOS__) || defined (WINDOWS32) || defined (__EMX__)
|
||||
&& ((tmpdir = getenv ("TMP")) == NULL || *tmpdir == '\0')
|
||||
&& ((tmpdir = getenv ("TEMP")) == NULL || *tmpdir == '\0')
|
||||
# define TMP_EXTRAS "TMP", "TEMP",
|
||||
#else
|
||||
# define TMP_EXTRAS
|
||||
#endif
|
||||
&& ((tmpdir = getenv ("TMPDIR")) == NULL || *tmpdir == '\0'))
|
||||
tmpdir = DEFAULT_TMPDIR;
|
||||
const char *tlist[] = { "MAKE_TMPDIR", "TMPDIR", TMP_EXTRAS NULL };
|
||||
const char **tp;
|
||||
unsigned int found = 0;
|
||||
|
||||
for (tp = tlist; *tp; ++tp)
|
||||
if ((tmpdir = getenv (*tp)) && *tmpdir != '\0')
|
||||
{
|
||||
struct stat st;
|
||||
int r;
|
||||
found = 1;
|
||||
EINTRLOOP(r, stat (tmpdir, &st));
|
||||
if (r < 0)
|
||||
OSSS (error, NILF,
|
||||
_("%s value %s: %s"), *tp, tmpdir, strerror (errno));
|
||||
else if (! S_ISDIR (st.st_mode))
|
||||
OSS (error, NILF,
|
||||
_("%s value %s: not a directory"), *tp, tmpdir);
|
||||
else
|
||||
return tmpdir;
|
||||
}
|
||||
|
||||
tmpdir = DEFAULT_TMPDIR;
|
||||
|
||||
if (found)
|
||||
OS (error, NILF, _("using default temporary directory '%s'"), tmpdir);
|
||||
}
|
||||
|
||||
return tmpdir;
|
||||
@@ -543,44 +621,45 @@ get_tmptemplate ()
|
||||
{
|
||||
const char *tmpdir = get_tmpdir ();
|
||||
char *template;
|
||||
size_t len;
|
||||
char *cp;
|
||||
|
||||
len = strlen (tmpdir);
|
||||
template = xmalloc (len + CSTRLEN (DEFAULT_TMPFILE) + 2);
|
||||
strcpy (template, tmpdir);
|
||||
template = xmalloc (strlen (tmpdir) + CSTRLEN (DEFAULT_TMPFILE) + 2);
|
||||
cp = stpcpy (template, tmpdir);
|
||||
|
||||
#ifdef HAVE_DOS_PATHS
|
||||
if (template[len - 1] != '/' && template[len - 1] != '\\')
|
||||
strcat (template, "/");
|
||||
#else
|
||||
# ifndef VMS
|
||||
if (template[len - 1] != '/')
|
||||
strcat (template, "/");
|
||||
# endif /* !VMS */
|
||||
#endif /* !HAVE_DOS_PATHS */
|
||||
#if !defined VMS
|
||||
/* It's not possible for tmpdir to be empty. */
|
||||
if (! ISDIRSEP (cp[-1]))
|
||||
*(cp++) = '/';
|
||||
#endif
|
||||
|
||||
strcat (template, DEFAULT_TMPFILE);
|
||||
strcpy (cp, DEFAULT_TMPFILE);
|
||||
|
||||
return template;
|
||||
}
|
||||
|
||||
char *
|
||||
#if !HAVE_MKSTEMP || !HAVE_FDOPEN
|
||||
/* Generate a temporary filename. This is not safe as another program could
|
||||
snipe our filename after we've generated it: use this only on systems
|
||||
without more secure alternatives. */
|
||||
|
||||
static char *
|
||||
get_tmppath ()
|
||||
{
|
||||
char *path;
|
||||
|
||||
#ifdef HAVE_MKTEMP
|
||||
path = get_tmptemplate();
|
||||
# ifdef HAVE_MKTEMP
|
||||
path = get_tmptemplate ();
|
||||
if (*mktemp (path) == '\0')
|
||||
pfatal_with_name ("mktemp");
|
||||
#else
|
||||
# else
|
||||
path = xmalloc (L_tmpnam + 1);
|
||||
if (tmpnam (path) == NULL)
|
||||
pfatal_with_name ("tmpnam");
|
||||
#endif
|
||||
# endif
|
||||
|
||||
return path;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Generate a temporary file and return an fd for it. If name is NULL then
|
||||
the temp file is anonymous and will be deleted when the process exits. */
|
||||
@@ -589,7 +668,6 @@ get_tmpfd (char **name)
|
||||
{
|
||||
int fd = -1;
|
||||
char *tmpnm;
|
||||
mode_t mask;
|
||||
|
||||
/* If there's an os-specific way to get an anoymous temp file use it. */
|
||||
if (!name)
|
||||
@@ -599,9 +677,6 @@ get_tmpfd (char **name)
|
||||
return fd;
|
||||
}
|
||||
|
||||
/* Preserve the current umask, and set a restrictive one for temp files. */
|
||||
mask = umask (0077);
|
||||
|
||||
#if defined(HAVE_MKSTEMP)
|
||||
tmpnm = get_tmptemplate ();
|
||||
|
||||
@@ -613,48 +688,61 @@ get_tmpfd (char **name)
|
||||
/* Can't use mkstemp(), but try to guard against a race condition. */
|
||||
EINTRLOOP (fd, open (tmpnm, O_CREAT|O_EXCL|O_RDWR, 0600));
|
||||
#endif
|
||||
|
||||
umask (mask);
|
||||
if (fd < 0)
|
||||
OSS (fatal, NILF,
|
||||
_("create temporary file %s: %s"), tmpnm, strerror (errno));
|
||||
|
||||
if (name)
|
||||
*name = tmpnm;
|
||||
else
|
||||
{
|
||||
unlink (tmpnm);
|
||||
int r;
|
||||
EINTRLOOP (r, unlink (tmpnm));
|
||||
if (r < 0)
|
||||
OSS (fatal, NILF,
|
||||
_("unlink temporary file %s: %s"), tmpnm, strerror (errno));
|
||||
free (tmpnm);
|
||||
}
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
/* Return a FILE* for a temporary file, opened in the safest way possible.
|
||||
Set name to point to an allocated buffer containing the name of the file.
|
||||
Note, this cannot be NULL! */
|
||||
FILE *
|
||||
get_tmpfile (char **name)
|
||||
{
|
||||
/* Be consistent with tmpfile, which opens as if by "wb+". */
|
||||
const char *tmpfile_mode = "wb+";
|
||||
FILE *file;
|
||||
|
||||
#if defined(HAVE_FDOPEN)
|
||||
int fd = get_tmpfd (name);
|
||||
|
||||
return fd < 0 ? NULL : fdopen (fd, "w");
|
||||
ENULLLOOP (file, fdopen (fd, tmpfile_mode));
|
||||
if (file == NULL)
|
||||
OSS (fatal, NILF,
|
||||
_("fdopen: temporary file %s: %s"), *name, strerror (errno));
|
||||
#else
|
||||
/* Preserve the current umask, and set a restrictive one for temp files. */
|
||||
mode_t mask = umask (0077);
|
||||
int err;
|
||||
|
||||
char *tmpnm = get_tmppath ();
|
||||
*name = get_tmppath ();
|
||||
|
||||
/* Not secure, but...? If name is NULL we could use tmpfile()... */
|
||||
FILE *file = fopen (tmpnm, "w");
|
||||
/* Although this fopen is insecure, it is executed only on non-fdopen
|
||||
platforms, which should be a rarity nowadays. */
|
||||
|
||||
ENULLLOOP (file, fopen (*name, tmpfile_mode));
|
||||
if (file == NULL)
|
||||
OSS (fatal, NILF,
|
||||
_("fopen: temporary file %s: %s"), *name, strerror (errno));
|
||||
|
||||
umask (mask);
|
||||
|
||||
if (name)
|
||||
*name = tmpnm;
|
||||
else
|
||||
{
|
||||
unlink (tmpnm);
|
||||
free (tmpnm);
|
||||
}
|
||||
#endif
|
||||
|
||||
return file;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -688,7 +776,7 @@ strcasecmp (const char *s1, const char *s2)
|
||||
substitute for it, define our own version. */
|
||||
|
||||
int
|
||||
strncasecmp (const char *s1, const char *s2, int n)
|
||||
strncasecmp (const char *s1, const char *s2, size_t n)
|
||||
{
|
||||
while (n-- > 0)
|
||||
{
|
||||
@@ -719,11 +807,11 @@ get_path_max (void)
|
||||
|
||||
if (value == 0)
|
||||
{
|
||||
long int x = pathconf ("/", _PC_PATH_MAX);
|
||||
long x = pathconf ("/", _PC_PATH_MAX);
|
||||
if (x > 0)
|
||||
value = x;
|
||||
value = (unsigned int) x;
|
||||
else
|
||||
return MAXPATHLEN;
|
||||
value = PATH_MAX;
|
||||
}
|
||||
|
||||
return value;
|
||||
|
||||
36
src/mkconfig.h.in
Normal file
36
src/mkconfig.h.in
Normal file
@@ -0,0 +1,36 @@
|
||||
/* Autoconf values for use on non-POSIX systems.
|
||||
Copyright (C) 2022 Free Software Foundation, Inc.
|
||||
This file is part of GNU Make.
|
||||
|
||||
GNU Make is free software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the Free Software
|
||||
Foundation; either version 3 of the License, or (at your option) any later
|
||||
version.
|
||||
|
||||
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "@PACKAGE@"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "@PACKAGE_NAME@"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "@PACKAGE_NAME@ @PACKAGE_VERSION@"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "@PACKAGE_TARNAME@"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL "@PACKAGE_URL@"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "@PACKAGE_VERSION@"
|
||||
49
src/os.h
49
src/os.h
@@ -12,8 +12,7 @@ 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/>. */
|
||||
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#define IO_UNKNOWN 0x0001
|
||||
#define IO_COMBINED_OUTERR 0x0002
|
||||
@@ -26,10 +25,11 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
# define fd_inherit(_i) (0)
|
||||
# define fd_noinherit(_i) (0)
|
||||
# define fd_set_append(_i) (void)(0)
|
||||
# define os_anontmp() (-1)
|
||||
#else
|
||||
|
||||
/* Determine the state of stdin/stdout/stderr. */
|
||||
unsigned int check_io_state ();
|
||||
unsigned int check_io_state (void);
|
||||
|
||||
/* Set a file descriptor to close/not close in a subprocess. */
|
||||
void fd_inherit (int);
|
||||
@@ -37,13 +37,9 @@ void fd_noinherit (int);
|
||||
|
||||
/* If the file descriptor is for a file put it into append mode. */
|
||||
void fd_set_append (int);
|
||||
#endif
|
||||
|
||||
/* Return a file descriptor for a new anonymous temp file, or -1. */
|
||||
#if defined(WINDOWS32)
|
||||
int os_anontmp ();
|
||||
#else
|
||||
# define os_anontmp() (-1)
|
||||
int os_anontmp (void);
|
||||
#endif
|
||||
|
||||
/* This section provides OS-specific functions to support the jobserver. */
|
||||
@@ -51,7 +47,7 @@ int os_anontmp ();
|
||||
#ifdef MAKE_JOBSERVER
|
||||
|
||||
/* Returns 1 if the jobserver is enabled, else 0. */
|
||||
unsigned int jobserver_enabled ();
|
||||
unsigned int jobserver_enabled (void);
|
||||
|
||||
/* Called in the parent make to set up the jobserver initially. */
|
||||
unsigned int jobserver_setup (int job_slots, const char *style);
|
||||
@@ -61,23 +57,25 @@ unsigned int jobserver_setup (int job_slots, const char *style);
|
||||
unsigned int jobserver_parse_auth (const char* auth);
|
||||
|
||||
/* Returns an allocated buffer used to pass to child instances. */
|
||||
char *jobserver_get_auth ();
|
||||
char *jobserver_get_auth (void);
|
||||
|
||||
/* Returns a pointer to a static string used to indicate that the child
|
||||
cannot access the jobserver, or NULL if it always can. */
|
||||
const char *jobserver_get_invalid_auth ();
|
||||
const char *jobserver_get_invalid_auth (void);
|
||||
|
||||
/* Clear this instance's jobserver configuration. */
|
||||
void jobserver_clear ();
|
||||
/* Clear this instance's jobserver configuration.
|
||||
This method might be invoked from a signal handler. */
|
||||
void jobserver_clear (void);
|
||||
|
||||
/* Recover all the jobserver tokens and return the number we got. */
|
||||
unsigned int jobserver_acquire_all ();
|
||||
/* Recover all the jobserver tokens and return the number we got.
|
||||
Will also run jobserver_clear() as a side-effect. */
|
||||
unsigned int jobserver_acquire_all (void);
|
||||
|
||||
/* Release a jobserver token. If it fails and is_fatal is 1, fatal. */
|
||||
void jobserver_release (int is_fatal);
|
||||
|
||||
/* Notify the jobserver that a child exited. */
|
||||
void jobserver_signal ();
|
||||
void jobserver_signal (void);
|
||||
|
||||
/* Get ready to start a non-recursive child. */
|
||||
void jobserver_pre_child (int);
|
||||
@@ -86,7 +84,7 @@ void jobserver_pre_child (int);
|
||||
void jobserver_post_child (int);
|
||||
|
||||
/* Set up to acquire a new token. */
|
||||
void jobserver_pre_acquire ();
|
||||
void jobserver_pre_acquire (void);
|
||||
|
||||
/* Wait until we can acquire a jobserver token.
|
||||
TIMEOUT is 1 if we have other jobs waiting for the load to go down;
|
||||
@@ -116,28 +114,29 @@ unsigned int jobserver_acquire (int timeout);
|
||||
#ifndef NO_OUTPUT_SYNC
|
||||
|
||||
/* Returns 1 if output sync is enabled, else 0. */
|
||||
unsigned int osync_enabled ();
|
||||
unsigned int osync_enabled (void);
|
||||
|
||||
/* Called in the parent make to set up output sync initially. */
|
||||
void osync_setup ();
|
||||
void osync_setup (void);
|
||||
|
||||
/* Returns an allocated buffer containing output sync info to pass to child
|
||||
instances, or NULL if not needed. */
|
||||
char *osync_get_mutex ();
|
||||
char *osync_get_mutex (void);
|
||||
|
||||
/* Called in a child instance to obtain info on the output sync mutex.
|
||||
Return 1 if we got a valid mutex, else 0. */
|
||||
unsigned int osync_parse_mutex (const char *mutex);
|
||||
|
||||
/* Clean up this instance's output sync facilities. */
|
||||
void osync_clear ();
|
||||
/* Clean up this instance's output sync facilities.
|
||||
This method might be invoked from a signal handler. */
|
||||
void osync_clear (void);
|
||||
|
||||
/* Acquire the output sync lock. This will wait until available.
|
||||
Returns 0 if there was an error getting the semaphore. */
|
||||
unsigned int osync_acquire ();
|
||||
unsigned int osync_acquire (void);
|
||||
|
||||
/* Release the output sync lock. */
|
||||
void osync_release ();
|
||||
void osync_release (void);
|
||||
|
||||
#else
|
||||
|
||||
@@ -155,5 +154,5 @@ void osync_release ();
|
||||
#if defined(VMS) || defined(WINDOWS32) || defined(_AMIGA) || defined(__MSDOS__)
|
||||
# define get_bad_stdin() (-1)
|
||||
#else
|
||||
int get_bad_stdin ();
|
||||
int get_bad_stdin (void);
|
||||
#endif
|
||||
|
||||
62
src/output.c
62
src/output.c
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
#include "os.h"
|
||||
@@ -51,20 +51,24 @@ unsigned int stdio_traced = 0;
|
||||
static void
|
||||
_outputs (struct output *out, int is_err, const char *msg)
|
||||
{
|
||||
if (! out || ! out->syncout)
|
||||
{
|
||||
FILE *f = is_err ? stderr : stdout;
|
||||
fputs (msg, f);
|
||||
fflush (f);
|
||||
}
|
||||
else
|
||||
FILE *f;
|
||||
|
||||
if (out && out->syncout)
|
||||
{
|
||||
int fd = is_err ? out->err : out->out;
|
||||
size_t len = strlen (msg);
|
||||
int r;
|
||||
EINTRLOOP (r, lseek (fd, 0, SEEK_END));
|
||||
writebuf (fd, msg, len);
|
||||
if (fd != OUTPUT_NONE)
|
||||
{
|
||||
size_t len = strlen (msg);
|
||||
int r;
|
||||
EINTRLOOP (r, lseek (fd, 0, SEEK_END));
|
||||
writebuf (fd, msg, len);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
f = is_err ? stderr : stdout;
|
||||
fputs (msg, f);
|
||||
fflush (f);
|
||||
}
|
||||
|
||||
/* Write a message indicating that we've just entered or
|
||||
@@ -198,7 +202,16 @@ output_tmpfd (void)
|
||||
static void
|
||||
setup_tmpfile (struct output *out)
|
||||
{
|
||||
unsigned int io_state = check_io_state ();
|
||||
static unsigned int in_setup = 0;
|
||||
unsigned int io_state;
|
||||
|
||||
/* If something fails during setup we might recurse back into this function
|
||||
while writing errors. Make sure we don't do so infinitely. */
|
||||
if (in_setup)
|
||||
return;
|
||||
in_setup = 1;
|
||||
|
||||
io_state = check_io_state ();
|
||||
|
||||
if (NONE_SET (io_state, IO_STDOUT_OK|IO_STDERR_OK))
|
||||
{
|
||||
@@ -230,6 +243,7 @@ setup_tmpfile (struct output *out)
|
||||
}
|
||||
}
|
||||
|
||||
in_setup = 0;
|
||||
return;
|
||||
|
||||
/* If we failed to create a temp file, disable output sync going forward. */
|
||||
@@ -237,6 +251,7 @@ setup_tmpfile (struct output *out)
|
||||
output_close (out);
|
||||
output_sync = OUTPUT_SYNC_NONE;
|
||||
osync_clear ();
|
||||
in_setup = 0;
|
||||
}
|
||||
|
||||
/* Synchronize the output of jobs in -j mode to keep the results of
|
||||
@@ -394,10 +409,11 @@ void
|
||||
message (int prefix, size_t len, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char *start;
|
||||
char *p;
|
||||
|
||||
len += strlen (fmt) + strlen (program) + INTSTR_LENGTH + 4 + 1 + 1;
|
||||
p = get_buffer (len);
|
||||
start = p = get_buffer (len);
|
||||
|
||||
if (prefix)
|
||||
{
|
||||
@@ -414,8 +430,8 @@ message (int prefix, size_t len, const char *fmt, ...)
|
||||
|
||||
strcat (p, "\n");
|
||||
|
||||
assert (fmtbuf.buffer[len-1] == '\0');
|
||||
outputs (0, fmtbuf.buffer);
|
||||
assert (start[len-1] == '\0');
|
||||
outputs (0, start);
|
||||
}
|
||||
|
||||
/* Print an error message. */
|
||||
@@ -424,12 +440,13 @@ void
|
||||
error (const floc *flocp, size_t len, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char *start;
|
||||
char *p;
|
||||
|
||||
len += (strlen (fmt) + strlen (program)
|
||||
+ (flocp && flocp->filenm ? strlen (flocp->filenm) : 0)
|
||||
+ INTSTR_LENGTH + 4 + 1 + 1);
|
||||
p = get_buffer (len);
|
||||
start = p = get_buffer (len);
|
||||
|
||||
if (flocp && flocp->filenm)
|
||||
sprintf (p, "%s:%lu: ", flocp->filenm, flocp->lineno + flocp->offset);
|
||||
@@ -445,8 +462,8 @@ error (const floc *flocp, size_t len, const char *fmt, ...)
|
||||
|
||||
strcat (p, "\n");
|
||||
|
||||
assert (fmtbuf.buffer[len-1] == '\0');
|
||||
outputs (1, fmtbuf.buffer);
|
||||
assert (start[len-1] == '\0');
|
||||
outputs (1, start);
|
||||
}
|
||||
|
||||
/* Print an error message and exit. */
|
||||
@@ -456,12 +473,13 @@ fatal (const floc *flocp, size_t len, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
const char *stop = _(". Stop.\n");
|
||||
char *start;
|
||||
char *p;
|
||||
|
||||
len += (strlen (fmt) + strlen (program)
|
||||
+ (flocp && flocp->filenm ? strlen (flocp->filenm) : 0)
|
||||
+ INTSTR_LENGTH + 8 + strlen (stop) + 1);
|
||||
p = get_buffer (len);
|
||||
start = p = get_buffer (len);
|
||||
|
||||
if (flocp && flocp->filenm)
|
||||
sprintf (p, "%s:%lu: *** ", flocp->filenm, flocp->lineno + flocp->offset);
|
||||
@@ -477,8 +495,8 @@ fatal (const floc *flocp, size_t len, const char *fmt, ...)
|
||||
|
||||
strcat (p, stop);
|
||||
|
||||
assert (fmtbuf.buffer[len-1] == '\0');
|
||||
outputs (1, fmtbuf.buffer);
|
||||
assert (start[len-1] == '\0');
|
||||
outputs (1, start);
|
||||
|
||||
die (MAKE_FAILURE);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
struct output
|
||||
{
|
||||
|
||||
107
src/posixos.c
107
src/posixos.c
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
|
||||
@@ -75,6 +75,9 @@ check_io_state ()
|
||||
|
||||
/* This section provides OS-specific functions to support the jobserver. */
|
||||
|
||||
/* True if this is the root make instance. */
|
||||
static unsigned char job_root = 0;
|
||||
|
||||
/* These track the state of the jobserver pipe. Passed to child instances. */
|
||||
static int job_fds[2] = { -1, -1 };
|
||||
|
||||
@@ -140,7 +143,16 @@ jobserver_setup (int slots, const char *style)
|
||||
#if HAVE_MKFIFO
|
||||
if (style == NULL || strcmp (style, "fifo") == 0)
|
||||
{
|
||||
fifo_name = get_tmppath ();
|
||||
/* Unfortunately glibc warns about uses of mktemp even though we aren't
|
||||
using it in dangerous way here. So avoid this by generating our own
|
||||
temporary file name. */
|
||||
# define FNAME_PREFIX "GMfifo"
|
||||
const char *tmpdir = get_tmpdir ();
|
||||
|
||||
fifo_name = xmalloc (strlen (tmpdir) + CSTRLEN (FNAME_PREFIX)
|
||||
+ INTSTR_LENGTH + 2);
|
||||
sprintf (fifo_name, "%s/" FNAME_PREFIX "%" MK_PRI64_PREFIX "d",
|
||||
tmpdir, (long long)make_pid ());
|
||||
|
||||
EINTRLOOP (r, mkfifo (fifo_name, 0600));
|
||||
if (r < 0)
|
||||
@@ -163,8 +175,6 @@ jobserver_setup (int slots, const char *style)
|
||||
OSS (fatal, NILF, _("Cannot open jobserver %s: %s"),
|
||||
fifo_name, strerror (errno));
|
||||
|
||||
DB (DB_JOBS, (_("Jobserver setup (fifo %s)\n"), fifo_name));
|
||||
|
||||
js_type = js_fifo;
|
||||
}
|
||||
}
|
||||
@@ -179,9 +189,6 @@ jobserver_setup (int slots, const char *style)
|
||||
if (r < 0)
|
||||
pfatal_with_name (_("creating jobs pipe"));
|
||||
|
||||
DB (DB_JOBS, (_("Jobserver setup (fds %d,%d)\n"),
|
||||
job_fds[0], job_fds[1]));
|
||||
|
||||
js_type = js_pipe;
|
||||
}
|
||||
|
||||
@@ -203,6 +210,8 @@ jobserver_setup (int slots, const char *style)
|
||||
/* When using pselect() we want the read to be non-blocking. */
|
||||
set_blocking (job_fds[0], 0);
|
||||
|
||||
job_root = 1;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -233,8 +242,6 @@ jobserver_parse_auth (const char *auth)
|
||||
/* If not, it must be a simple pipe. */
|
||||
else if (sscanf (auth, "%d,%d", &rfd, &wfd) == 2)
|
||||
{
|
||||
DB (DB_JOBS, (_("Jobserver client (fds %d,%d)\n"), rfd, wfd));
|
||||
|
||||
/* The parent overrode our FDs because we aren't a recursive make. */
|
||||
if (rfd == -2 || wfd == -2)
|
||||
return 0;
|
||||
@@ -327,8 +334,20 @@ jobserver_clear ()
|
||||
|
||||
job_fds[0] = job_fds[1] = job_rfd = -1;
|
||||
|
||||
free (fifo_name);
|
||||
fifo_name = NULL;
|
||||
if (fifo_name)
|
||||
{
|
||||
if (job_root)
|
||||
{
|
||||
int r;
|
||||
EINTRLOOP (r, unlink (fifo_name));
|
||||
}
|
||||
|
||||
if (!handling_fatal_signal)
|
||||
{
|
||||
free (fifo_name);
|
||||
fifo_name = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
js_type = js_none;
|
||||
}
|
||||
@@ -368,11 +387,10 @@ jobserver_acquire_all ()
|
||||
++tokens;
|
||||
}
|
||||
|
||||
if (fifo_name)
|
||||
EINTRLOOP (r, unlink (fifo_name));
|
||||
|
||||
DB (DB_JOBS, ("Acquired all %u jobserver tokens.\n", tokens));
|
||||
|
||||
jobserver_clear ();
|
||||
|
||||
return tokens;
|
||||
}
|
||||
|
||||
@@ -462,7 +480,7 @@ jobserver_acquire (int timeout)
|
||||
case EBADF:
|
||||
/* Someone closed the jobs pipe.
|
||||
That shouldn't happen but if it does we're done. */
|
||||
O (fatal, NILF, _("job server shut down"));
|
||||
O (fatal, NILF, _("job server shut down"));
|
||||
|
||||
default:
|
||||
pfatal_with_name (_("pselect jobs pipe"));
|
||||
@@ -615,7 +633,7 @@ static int osync_handle = -1;
|
||||
|
||||
static char *osync_tmpfile = NULL;
|
||||
|
||||
static unsigned int sync_parent = 0;
|
||||
static unsigned int sync_root = 0;
|
||||
|
||||
unsigned int
|
||||
osync_enabled ()
|
||||
@@ -627,8 +645,8 @@ void
|
||||
osync_setup ()
|
||||
{
|
||||
osync_handle = get_tmpfd (&osync_tmpfile);
|
||||
if (osync_handle >= 0)
|
||||
sync_parent = 1;
|
||||
fd_noinherit (osync_handle);
|
||||
sync_root = 1;
|
||||
}
|
||||
|
||||
char *
|
||||
@@ -662,21 +680,26 @@ osync_parse_mutex (const char *mutex)
|
||||
OSS (fatal, NILF, _("cannot open output sync mutex %s: %s"),
|
||||
osync_tmpfile, strerror (errno));
|
||||
|
||||
fd_noinherit (osync_handle);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void
|
||||
osync_clear ()
|
||||
{
|
||||
if (osync_handle)
|
||||
if (osync_handle >= 0)
|
||||
{
|
||||
close (osync_handle);
|
||||
osync_handle = -1;
|
||||
}
|
||||
|
||||
if (sync_parent && osync_tmpfile)
|
||||
if (sync_root && osync_tmpfile)
|
||||
{
|
||||
unlink (osync_tmpfile);
|
||||
int r;
|
||||
|
||||
EINTRLOOP (r, unlink (osync_tmpfile));
|
||||
free (osync_tmpfile);
|
||||
osync_tmpfile = NULL;
|
||||
}
|
||||
}
|
||||
@@ -692,6 +715,7 @@ osync_acquire ()
|
||||
fl.l_whence = SEEK_SET;
|
||||
fl.l_start = 0;
|
||||
fl.l_len = 1;
|
||||
/* We don't want to keep waiting on EINTR. */
|
||||
if (fcntl (osync_handle, F_SETLKW, &fl) == -1)
|
||||
{
|
||||
perror ("fcntl()");
|
||||
@@ -713,6 +737,7 @@ osync_release ()
|
||||
fl.l_whence = SEEK_SET;
|
||||
fl.l_start = 0;
|
||||
fl.l_len = 1;
|
||||
/* We don't want to keep waiting on EINTR. */
|
||||
if (fcntl (osync_handle, F_SETLKW, &fl) == -1)
|
||||
perror ("fcntl()");
|
||||
}
|
||||
@@ -736,7 +761,7 @@ get_bad_stdin ()
|
||||
if (pipe (pd) == 0)
|
||||
{
|
||||
/* Close the write side. */
|
||||
(void) close (pd[1]);
|
||||
close (pd[1]);
|
||||
/* Save the read side. */
|
||||
bad_stdin = pd[0];
|
||||
|
||||
@@ -809,3 +834,41 @@ fd_set_append (int fd)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Return a file descriptor for a new anonymous temp file, or -1. */
|
||||
int
|
||||
os_anontmp ()
|
||||
{
|
||||
const char *tdir = get_tmpdir ();
|
||||
int fd = -1;
|
||||
|
||||
#ifdef O_TMPFILE
|
||||
EINTRLOOP (fd, open (tdir, O_RDWR | O_TMPFILE | O_EXCL, 0600));
|
||||
if (fd >= 0)
|
||||
return fd;
|
||||
|
||||
DB (DB_BASIC, (_("Cannot open '%s' with O_TMPFILE: %s.\n"),
|
||||
tdir, strerror (errno)));
|
||||
#endif
|
||||
|
||||
#if HAVE_DUP
|
||||
/* If we can dup and we are creating temp files in the default location then
|
||||
try tmpfile() + dup() + fclose() to avoid ever having a named file. */
|
||||
if (streq (tdir, DEFAULT_TMPDIR))
|
||||
{
|
||||
mode_t mask = umask (0077);
|
||||
FILE *tfile;
|
||||
ENULLLOOP (tfile, tmpfile ());
|
||||
if (!tfile)
|
||||
pfatal_with_name ("tmpfile");
|
||||
umask (mask);
|
||||
|
||||
EINTRLOOP (fd, dup (fileno (tfile)));
|
||||
if (fd < 0)
|
||||
pfatal_with_name ("dup");
|
||||
fclose (tfile);
|
||||
}
|
||||
#endif
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
12
src/read.c
12
src/read.c
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
|
||||
@@ -984,6 +984,7 @@ eval (struct ebuffer *ebuf, int set_default)
|
||||
/* Otherwise add it to the list to be rebuilt. */
|
||||
deps = alloc_goaldep ();
|
||||
deps->next = read_files;
|
||||
deps->floc = ebuf->floc;
|
||||
read_files = deps;
|
||||
deps->file = f;
|
||||
}
|
||||
@@ -1107,7 +1108,7 @@ eval (struct ebuffer *ebuf, int set_default)
|
||||
Note that the only separators of targets in this context are
|
||||
whitespace and a left paren. If others are possible, add them
|
||||
to the string in the call to strchr. */
|
||||
while (colonp && (colonp[1] == '/' || colonp[1] == '\\') &&
|
||||
while (colonp && ISDIRSEP (colonp[1]) &&
|
||||
isalpha ((unsigned char) colonp[-1]) &&
|
||||
(colonp == p2 + 1 || strchr (" \t(", colonp[-2]) != 0))
|
||||
colonp = find_char_unquote (colonp + 1, ':');
|
||||
@@ -1278,8 +1279,7 @@ eval (struct ebuffer *ebuf, int set_default)
|
||||
do {
|
||||
check_again = 0;
|
||||
/* For DOS-style paths, skip a "C:\..." or a "C:/..." */
|
||||
if (p != 0 && (p[1] == '\\' || p[1] == '/') &&
|
||||
isalpha ((unsigned char)p[-1]) &&
|
||||
if (p != 0 && ISDIRSEP (p[1]) && isalpha ((unsigned char)p[-1]) &&
|
||||
(p == p2 + 1 || strchr (" \t:(", p[-2]) != 0)) {
|
||||
p = strchr (p + 1, ':');
|
||||
check_again = 1;
|
||||
@@ -3070,7 +3070,7 @@ construct_include_path (const char **arg_dirs)
|
||||
do_variable_definition (NILF, ".INCLUDE_DIRS", *cpp,
|
||||
o_default, f_append, 0);
|
||||
|
||||
free (include_directories);
|
||||
free ((void *) include_directories);
|
||||
include_directories = dirs;
|
||||
}
|
||||
|
||||
@@ -3269,7 +3269,7 @@ parse_file_seq (char **stringp, size_t size, int stopmap,
|
||||
Tokens separated by spaces are treated as separate paths since make
|
||||
doesn't allow path names with spaces. */
|
||||
if (p && p == s+1 && p[0] == ':'
|
||||
&& isalpha ((unsigned char)s[0]) && STOP_SET (p[1], MAP_DIRSEP))
|
||||
&& isalpha ((unsigned char)s[0]) && ISDIRSEP (p[1]))
|
||||
p = find_map_unquote (p+1, findmap);
|
||||
#endif
|
||||
|
||||
|
||||
122
src/remake.c
122
src/remake.c
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
#include "filedef.h"
|
||||
@@ -34,6 +34,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
#include <starlet.h>
|
||||
#endif
|
||||
#ifdef WINDOWS32
|
||||
#include <windows.h>
|
||||
#include <io.h>
|
||||
#include <sys/stat.h>
|
||||
#if defined(_MSC_VER) && _MSC_VER > 1200
|
||||
@@ -78,6 +79,25 @@ static FILE_TIMESTAMP name_mtime (const char *name);
|
||||
static const char *library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr);
|
||||
|
||||
|
||||
static void
|
||||
check_also_make (const struct file *file)
|
||||
{
|
||||
struct dep *ad;
|
||||
FILE_TIMESTAMP mtime = file->last_mtime;
|
||||
|
||||
if (mtime == UNKNOWN_MTIME)
|
||||
mtime = name_mtime (file->name);
|
||||
|
||||
/* If we updated the file, check its also-make files. */
|
||||
|
||||
if (is_ordinary_mtime (mtime) && mtime > file->mtime_before_update)
|
||||
for (ad = file->also_make; ad; ad = ad->next)
|
||||
if (ad->file->last_mtime == NONEXISTENT_MTIME)
|
||||
OS (error, file->cmds ? &file->cmds->fileinfo : NILF,
|
||||
_("warning: pattern recipe did not update peer target '%s'."),
|
||||
ad->file->name);
|
||||
}
|
||||
|
||||
/* Remake all the goals in the 'struct dep' chain GOALS. Return update_status
|
||||
representing the totality of the status of the goals.
|
||||
|
||||
@@ -416,7 +436,7 @@ complain (struct file *file)
|
||||
}
|
||||
|
||||
/* Consider a single 'struct file' and update it as appropriate.
|
||||
Return 0 on success, or non-0 on failure. */
|
||||
Return an update_status value; use us_success if we aren't sure yet. */
|
||||
|
||||
static enum update_status
|
||||
update_file_1 (struct file *file, unsigned int depth)
|
||||
@@ -449,7 +469,7 @@ update_file_1 (struct file *file, unsigned int depth)
|
||||
}
|
||||
|
||||
DBF (DB_VERBOSE, _("File '%s' was considered already.\n"));
|
||||
return 0;
|
||||
return us_success;
|
||||
}
|
||||
|
||||
switch (file->command_state)
|
||||
@@ -459,7 +479,7 @@ update_file_1 (struct file *file, unsigned int depth)
|
||||
break;
|
||||
case cs_running:
|
||||
DBF (DB_VERBOSE, _("Still updating file '%s'.\n"));
|
||||
return 0;
|
||||
return us_success;
|
||||
case cs_finished:
|
||||
DBF (DB_VERBOSE, _("Finished updating file '%s'.\n"));
|
||||
return file->update_status;
|
||||
@@ -491,8 +511,7 @@ update_file_1 (struct file *file, unsigned int depth)
|
||||
noexist = this_mtime == NONEXISTENT_MTIME;
|
||||
if (noexist)
|
||||
DBF (DB_BASIC, _("File '%s' does not exist.\n"));
|
||||
else if (ORDINARY_MTIME_MIN <= this_mtime && this_mtime <= ORDINARY_MTIME_MAX
|
||||
&& file->low_resolution_time)
|
||||
else if (is_ordinary_mtime (this_mtime) && file->low_resolution_time)
|
||||
{
|
||||
/* Avoid spurious rebuilds due to low resolution time stamps. */
|
||||
int ns = FILE_TIMESTAMP_NS (this_mtime);
|
||||
@@ -503,6 +522,28 @@ update_file_1 (struct file *file, unsigned int depth)
|
||||
this_mtime += FILE_TIMESTAMPS_PER_S - 1 - ns;
|
||||
}
|
||||
|
||||
/* If any also_make target doesn't exist, we must remake this one too.
|
||||
If they do exist choose the oldest mtime so they will rebuild. */
|
||||
|
||||
for (ad = file->also_make; ad && !noexist; ad = ad->next)
|
||||
{
|
||||
struct file *adfile = ad->file;
|
||||
FILE_TIMESTAMP fmtime = file_mtime (adfile);
|
||||
|
||||
noexist = fmtime == NONEXISTENT_MTIME;
|
||||
if (noexist)
|
||||
{
|
||||
check_renamed (adfile);
|
||||
DBS (DB_BASIC,
|
||||
(_("Grouped target peer '%s' of file '%s' does not exist.\n"),
|
||||
adfile->name, file->name));
|
||||
}
|
||||
else if (fmtime < this_mtime)
|
||||
this_mtime = fmtime;
|
||||
}
|
||||
|
||||
must_make = noexist;
|
||||
|
||||
/* If file was specified as a target with no commands, come up with some
|
||||
default commands. This may also add more also_make files. */
|
||||
|
||||
@@ -518,26 +559,6 @@ update_file_1 (struct file *file, unsigned int depth)
|
||||
file->cmds = default_file->cmds;
|
||||
}
|
||||
|
||||
/* If any also_make target doesn't exist, we must remake this one too.
|
||||
If they do exist choose the oldest mtime so they will rebuild. */
|
||||
|
||||
for (ad = file->also_make; ad && !noexist; ad = ad->next)
|
||||
{
|
||||
struct file *adfile = ad->file;
|
||||
FILE_TIMESTAMP fmtime = file_mtime (adfile);
|
||||
|
||||
check_renamed (adfile);
|
||||
noexist = fmtime == NONEXISTENT_MTIME;
|
||||
if (noexist)
|
||||
DBS (DB_BASIC,
|
||||
(_("Grouped target peer '%s' of file '%s' does not exist.\n"),
|
||||
adfile->name, file->name));
|
||||
else if (fmtime < this_mtime)
|
||||
this_mtime = fmtime;
|
||||
}
|
||||
|
||||
must_make = noexist;
|
||||
|
||||
/* Update all non-intermediate files we depend on, if necessary, and see
|
||||
whether any of them is more recent than this file. We need to walk our
|
||||
deps, AND the deps of any also_make targets to ensure everything happens
|
||||
@@ -720,7 +741,7 @@ update_file_1 (struct file *file, unsigned int depth)
|
||||
set_command_state (file, cs_deps_running);
|
||||
--depth;
|
||||
DBF (DB_VERBOSE, _("The prerequisites of '%s' are being made.\n"));
|
||||
return 0;
|
||||
return us_success;
|
||||
}
|
||||
|
||||
/* If any dependency failed, give up now. */
|
||||
@@ -864,7 +885,7 @@ update_file_1 (struct file *file, unsigned int depth)
|
||||
file = file->prev;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return us_success;
|
||||
}
|
||||
|
||||
DBF (DB_BASIC, _("Must remake target '%s'.\n"));
|
||||
@@ -883,7 +904,7 @@ update_file_1 (struct file *file, unsigned int depth)
|
||||
if (file->command_state != cs_finished)
|
||||
{
|
||||
DBF (DB_VERBOSE, _("Recipe of '%s' is being run.\n"));
|
||||
return 0;
|
||||
return us_success;
|
||||
}
|
||||
|
||||
switch (file->update_status)
|
||||
@@ -1018,23 +1039,30 @@ notice_finished_file (struct file *file)
|
||||
}
|
||||
|
||||
if (ran && file->update_status != us_none)
|
||||
/* We actually tried to update FILE, which has
|
||||
updated its also_make's as well (if it worked).
|
||||
If it didn't work, it wouldn't work again for them.
|
||||
So mark them as updated with the same status. */
|
||||
for (d = file->also_make; d != 0; d = d->next)
|
||||
{
|
||||
d->file->command_state = cs_finished;
|
||||
d->file->updated = 1;
|
||||
d->file->update_status = file->update_status;
|
||||
{
|
||||
/* We actually tried to update FILE, which has
|
||||
updated its also_make's as well (if it worked).
|
||||
If it didn't work, it wouldn't work again for them.
|
||||
So mark them as updated with the same status. */
|
||||
for (d = file->also_make; d != 0; d = d->next)
|
||||
{
|
||||
d->file->command_state = cs_finished;
|
||||
d->file->updated = 1;
|
||||
d->file->update_status = file->update_status;
|
||||
|
||||
if (ran && !d->file->phony)
|
||||
/* Fetch the new modification time.
|
||||
We do this instead of just invalidating the cached time
|
||||
so that a vpath_search can happen. Otherwise, it would
|
||||
never be done because the target is already updated. */
|
||||
f_mtime (d->file, 0);
|
||||
}
|
||||
if (ran && !d->file->phony)
|
||||
/* Fetch the new modification time.
|
||||
We do this instead of just invalidating the cached time
|
||||
so that a vpath_search can happen. Otherwise, it would
|
||||
never be done because the target is already updated. */
|
||||
f_mtime (d->file, 0);
|
||||
}
|
||||
|
||||
/* If the target was created by an implicit rule, and it was updated,
|
||||
warn about any of its also_make targets that don't exist. */
|
||||
if (file->tried_implicit && file->also_make)
|
||||
check_also_make (file);
|
||||
}
|
||||
else if (file->update_status == us_none)
|
||||
/* Nothing was done for FILE, but it needed nothing done.
|
||||
So mark it now as "succeeded". */
|
||||
@@ -1524,7 +1552,7 @@ name_mtime (const char *name)
|
||||
|
||||
#if defined(WINDOWS32)
|
||||
{
|
||||
char tem[MAXPATHLEN], *tstart, *tend;
|
||||
char tem[MAX_PATH+1], *tstart, *tend;
|
||||
const char *p = name + strlen (name);
|
||||
|
||||
/* Remove any trailing slashes and "."/"..". MS-Windows stat
|
||||
@@ -1542,7 +1570,7 @@ name_mtime (const char *name)
|
||||
tend--;
|
||||
if (*tend == '.' && tend > tstart)
|
||||
tend--;
|
||||
for ( ; tend > tstart && (*tend == '/' || *tend == '\\'); tend--)
|
||||
for ( ; tend > tstart && ISDIRSEP (*tend); tend--)
|
||||
*tend = '\0';
|
||||
}
|
||||
else
|
||||
|
||||
@@ -16,7 +16,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
#include "filedef.h"
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
|
||||
@@ -94,7 +94,7 @@ get_rule_defn (struct rule *r)
|
||||
if (dep->ignore_mtime == 0)
|
||||
{
|
||||
if (dep->wait_here)
|
||||
p = mempcpy (p, STRING_SIZE_TUPLE (" .WAIT"));
|
||||
p = mempcpy (p, " .WAIT", CSTRLEN (" .WAIT"));
|
||||
p = mempcpy (mempcpy (p, " ", 1), dep_name (dep),
|
||||
strlen (dep_name (dep)));
|
||||
}
|
||||
@@ -107,7 +107,7 @@ get_rule_defn (struct rule *r)
|
||||
{
|
||||
p = mempcpy (p, sep, strlen (sep));
|
||||
if (ood->wait_here)
|
||||
p = mempcpy (p, STRING_SIZE_TUPLE (".WAIT "));
|
||||
p = mempcpy (p, ".WAIT ", CSTRLEN (".WAIT "));
|
||||
p = mempcpy (p, dep_name (ood), strlen (dep_name (ood)));
|
||||
}
|
||||
*p = '\0';
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
/* Structure used for pattern (implicit) rules. */
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
|
||||
@@ -83,7 +83,7 @@ shuffle_set_mode (const char *cmdarg)
|
||||
else
|
||||
{
|
||||
if (strcasecmp (cmdarg, "random") == 0)
|
||||
config.seed = (unsigned int) (time (NULL) ^ make_pid ());
|
||||
config.seed = make_rand ();
|
||||
else
|
||||
{
|
||||
/* Assume explicit seed. */
|
||||
@@ -109,7 +109,7 @@ random_shuffle_array (void **a, size_t len)
|
||||
void *t;
|
||||
|
||||
/* Pick random element and swap. */
|
||||
unsigned int j = rand () % len;
|
||||
unsigned int j = make_rand () % len;
|
||||
if (i == j)
|
||||
continue;
|
||||
|
||||
@@ -130,7 +130,7 @@ reverse_shuffle_array (void **a, size_t len)
|
||||
void *t;
|
||||
|
||||
/* Pick mirror and swap. */
|
||||
unsigned int j = len - 1 - i;
|
||||
size_t j = len - 1 - i;
|
||||
|
||||
/* Swap. */
|
||||
t = a[i];
|
||||
@@ -227,7 +227,7 @@ shuffle_deps_recursive (struct dep *deps)
|
||||
|
||||
/* Set specific seed at the top level of recursion. */
|
||||
if (config.mode == sm_random)
|
||||
srand (config.seed);
|
||||
make_seed (config.seed);
|
||||
|
||||
shuffle_deps (deps);
|
||||
|
||||
|
||||
@@ -12,13 +12,13 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
struct dep;
|
||||
struct goaldep;
|
||||
|
||||
void shuffle_set_mode (const char *cmdarg);
|
||||
const char * shuffle_get_mode ();
|
||||
const char *shuffle_get_mode (void);
|
||||
void shuffle_deps_recursive (struct dep* g);
|
||||
|
||||
#define shuffle_goaldeps_recursive(_g) do{ \
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "hash.h"
|
||||
|
||||
@@ -133,7 +133,7 @@ char *allocated_variable_expand_for_file (const char *line, struct file *file);
|
||||
allocated_variable_expand_for_file (line, (struct file *) 0)
|
||||
char *expand_argument (const char *str, const char *end);
|
||||
char *variable_expand_string (char *line, const char *string, size_t length);
|
||||
char *initialize_variable_output ();
|
||||
char *initialize_variable_output (void);
|
||||
void install_variable_buffer (char **bufp, size_t *lenp);
|
||||
void restore_variable_buffer (char *buf, size_t len);
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* We use <config.h> instead of "config.h" so that a compilation
|
||||
using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
|
||||
@@ -23,7 +23,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
# define MAKE_HOST "unknown"
|
||||
#endif
|
||||
|
||||
const char *version_string = VERSION;
|
||||
const char *version_string = PACKAGE_VERSION;
|
||||
const char *make_host = MAKE_HOST;
|
||||
|
||||
/*
|
||||
|
||||
@@ -19,7 +19,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
/* Per copyright assignment agreement with the Free Software Foundation
|
||||
|
||||
@@ -16,7 +16,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
/* Per copyright assignment agreement with the Free Software Foundation
|
||||
|
||||
@@ -48,7 +48,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
/* Per copyright assignment agreement with the Free Software Foundation
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef VMSDIR_H
|
||||
#define VMSDIR_H
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
#include "debug.h"
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Klaus Kämpf (kkaempf@progis.de)
|
||||
of proGIS Software, Aachen, Germany */
|
||||
|
||||
@@ -14,7 +14,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <string.h>
|
||||
#include <descrip.h>
|
||||
@@ -1242,8 +1242,7 @@ child_execute_job (struct childbase *child, int good_stdin UNUSED, char *argv)
|
||||
int cmd_len;
|
||||
|
||||
outfile = get_tmpfile (&child->comname);
|
||||
if (outfile == 0)
|
||||
pfatal_with_name (_("fopen (temporary file)"));
|
||||
|
||||
comnamelen = strlen (child->comname);
|
||||
|
||||
/* The whole DCL "script" is executed as one action, and it behaves as
|
||||
|
||||
@@ -12,7 +12,7 @@ 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/>. */
|
||||
this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "makeint.h"
|
||||
#include "filedef.h"
|
||||
@@ -239,8 +239,7 @@ construct_vpath_list (char *pattern, char *dirpath)
|
||||
also define HAVE_DOS_PATHS would like us to recognize
|
||||
colons after the drive letter in the likes of
|
||||
"D:/foo/bar:C:/xyzzy". */
|
||||
&& (*p != PATH_SEPARATOR_CHAR
|
||||
|| (p == v + 1 && (p[1] == '/' || p[1] == '\\')))
|
||||
&& (*p != PATH_SEPARATOR_CHAR || (p == v + 1 && ISDIRSEP (p[1])))
|
||||
#else
|
||||
&& *p != PATH_SEPARATOR_CHAR
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user