Compare commits

..

90 Commits

Author SHA1 Message Date
Paul Smith
85f9f6985d Add missing load.c file to POTFILES.in 2013-01-06 15:37:07 +00:00
Eli Zaretskii
0d12b1a207 job.c (create_batch_file): Fix last change: always increment the
counter of batch files before trying to use it.
2012-12-08 10:26:36 +00:00
Eli Zaretskii
299f5faf93 job.c (construct_command_argv_internal): Remove " from
sh_chars_dos[].  Ignore an escaped backslash inside a string
 quoted with "..".  This lifts the 4KB or 8KB command-line length
 limitation imposed by the Windows shell when a command uses quoted
 strings, because we now don't call the shell in that case.
2012-12-07 14:23:39 +00:00
Eli Zaretskii
0d5d963bcf job.c (reap_children): Add debug message for when removal of a temporary
batch file fails.
2012-12-07 14:13:16 +00:00
Eli Zaretskii
715927552f Avoid leaving temporary batch files in the temporary directory.
job.c (create_batch_file): Declare the counter of batch files
 static, to avoid having 2 jobs using the same file name and
 stepping on each other's toes.  When all 64K names are used up,
 make one more loop looking for slots that became vacant.  This
 avoids leaving behind temporary batch files in the temporary
 directory, which happens frequently on a fast machine when using
 parallel builds.
2012-12-07 14:11:15 +00:00
Paul Smith
7670c84f77 Implement new "load" directive.
Provides support for dynamically loadable objects in GNU make, as a
"technology preview".
2012-10-29 07:05:21 +00:00
Paul Smith
2efd6b47bf Rearrange elements to reduce struct size on 64bit architectures. 2012-10-28 14:57:49 +00:00
Paul Smith
ca8885d5be Remove extraneous close(). 2012-10-28 14:56:28 +00:00
Paul Smith
3a285e342e Update the required version of gettext to get new bugfix macros. 2012-09-30 03:20:50 +00:00
Paul Smith
f263ff4ce9 Define _GNU_SOURCE before testing for bsd_signal.
Fixes Savannah bug #32247
2012-09-10 03:05:49 +00:00
Paul Smith
fbe5b2c9cd Force intermediate targets to be considered if their non-intermediate
parent needs to be remade.  Fixes Savannah bug #30653.
2012-09-10 02:36:05 +00:00
Paul Smith
a94b0b0ea5 Keep the command line on the heap to avoid stack overflow.
Fixes Savannah bug #36451.
2012-09-09 23:25:07 +00:00
Paul Smith
b9c4a38022 On BSD, realpath(3) doesn't fail if the target doesn't exist, so test
explicitly with stat(2).  Fixes Savannah bug #35919.
2012-09-09 23:14:55 +00:00
Paul Smith
90ee335724 Get error messages in the C locale for comparision with make output.
Fixes Savannah bug #35764.
2012-09-09 22:52:50 +00:00
Paul Smith
7d3743dfdc Verify that backslashes before non-special characters are preserved. 2012-09-09 22:37:13 +00:00
Paul Smith
a839588fc9 Save the variable buffer content, not a potentially old pointer to it.
Fixes Savannah bug #36925.
2012-09-09 21:56:55 +00:00
Paul Smith
8a0d46468a Fix stupid wrong-pointer error handling target vars containing semicolons.
Fixes Savannah bug #36106.
2012-09-09 21:31:20 +00:00
Paul Smith
bc578b6c8e Ignore UTF-8 BOMs. See Savannah bug #36529. 2012-09-09 21:11:00 +00:00
Eli Zaretskii
1820908804 read.c (unescape_char): Fix a thinko in the last change. 2012-09-09 20:33:58 +00:00
Paul Smith
145661a541 Savannah bug #37179: Use alternate shared library syntax for MacOS. 2012-09-09 20:14:09 +00:00
Paul Smith
a95dc485fa Break out of an infinite loop if we're not making progress. 2012-09-09 20:06:03 +00:00
Paul Smith
30b2e4207d When .POSIX: is specified use POSIX-standard macro values by default. 2012-09-09 19:19:15 +00:00
Eli Zaretskii
7f5309ebb4 Update README.W32.template for Guile and job-server support. 2012-09-01 07:58:14 +00:00
Eli Zaretskii
6cb5be7813 Fix unescape_char when not unescaping.
read.c (unescape_char): Advance 'p' after copying the unescaped
 characters.  Otherwise the backslashes are incorrectly erased from
 the original string.
2012-09-01 07:52:54 +00:00
Paul Smith
adb50bd4c9 Simplify copyrights using ranges of years.
The new GNU Maintainer's Manual allows the use of year ranges in certain
situations; take advantage of this simplification.
2012-03-05 14:10:39 +00:00
Paul Smith
cf1c79c9a3 Improve handling for escaped colons in prerequisite lists.
Fixes Savannah bug #12126 and bug #16545
2012-03-04 16:53:50 +00:00
Paul Smith
76827d7c10 Create a new CSTRLEN (constant string length) macro, and use it. 2012-03-04 08:58:44 +00:00
Paul Smith
eb632d7676 Ensure appending private variables in pattern-specific target variables.
Fixes Savannah bug #35468.
2012-03-04 08:09:09 +00:00
Paul Smith
fdb5fcc28d Support nanosecond timestamps in stat() for AIX 5.2+.
Fixes Savannah bug #32485
2012-03-04 00:35:28 +00:00
Paul Smith
23c2b99e9d Convert all "`'" quotes to "''" per new GNU Coding Standard guidelines.
Fixes Savannah bug #34530.
2012-03-04 00:24:20 +00:00
Paul Smith
405c89ba1e Ensure that .ONESHELL works with .SHELLFLAGS options containing whitespace.
See Savannah bug #35397.
2012-03-03 22:56:20 +00:00
Paul Smith
a77c5c0910 Fix Savannah bug #35410: handle escape chars in filter/filter-out
Also add a valgrind suppression file for Guile-enabled make.
2012-03-03 22:12:46 +00:00
Paul Smith
88f1bc8b55 Modify backslash/newline handling for POSIX.
We fixed Savannah 16670 but that broke previously-working makefiles
that relied on the GNU make behavior.  The POSIX behavior doesn't
seem to me to be better, and can be obtained using GNU make as well,
so put it back as the default behavior and require .POSIX to
get the POSIX behavior.
Add a new section to the manual discussing backslash/newline handling.
Update the test suite.
2012-03-03 18:45:08 +00:00
Paul Smith
6405534814 Check for possible buffer overflow on very long filenames.
Fixes Savannah bug #35525
2012-02-26 21:34:51 +00:00
Eli Zaretskii
c0751bd3fc Ifdef away unused w32 functions.
w32/subproc/sub_proc.c (proc_stdin_thread, proc_stdout_thread)
 (proc_stderr_thread, process_pipe_io): Ifdef away unused
 functions.
2012-02-03 12:16:57 +00:00
Eli Zaretskii
1befa76448 Fix Savannah bug #34832 with unused TLS attributes.
w32/subproc/w32err.c (map_windows32_error_to_string) [_MSC_VER]:
 Don't use TLS storage for szMessageBuffer.  Ifdef away special
 code for handling Winsock error codes.  Make the function return a
 `const char *'.  Suggested by Ozkan Sezer.  Fixes Savannah bug #34832.
2012-02-03 12:15:56 +00:00
Paul Smith
e3b394f3f0 Map Guile variable objects to the empty string.
In Guile 2.0, (define ...) results in a variable object.  Ensure make
converts that to an empty string to avoid spurious errors.
2012-01-30 01:40:56 +00:00
Paul Smith
ef6461611b Add support for "::=" simple assignment operator.
The next POSIX standard will define "::=" to have the same behavior
as GNU make's ":=", so add support for this new operator.
2012-01-30 00:21:57 +00:00
Paul Smith
fca11f6039 Create a new function $(file ...) 2012-01-29 18:12:22 +00:00
Paul Smith
d6e1c6e6c5 Guile portability
Don't support Guile 1.6 and use a portable test for printable strings.
2012-01-29 16:30:12 +00:00
Eli Zaretskii
aa07c06387 config.h.W32.template: Update from config.h.in. 2012-01-28 21:59:26 +00:00
Eli Zaretskii
dc25e84754 Support a Windows build with Guile.
README.W32.template: Update with instructions for building with Guile.
 build_w32.bat: Support building with Guile.
 make.h [HAVE_STDINT_H]: Include stdint.h.
2012-01-28 20:28:31 +00:00
Eli Zaretskii
666ad44568 Actually commit main.c with changes announced in last commit. 2012-01-28 20:19:55 +00:00
Eli Zaretskii
dddd1be5ec main.c (main, clean_jobserver): Move declarations of variables
not used in the WINDOWS32 build to the #else branch, to avoid
 compiler warnings.
2012-01-28 16:54:00 +00:00
Eli Zaretskii
eb4f966971 Fix failures on MS-Windows when Make's standard handles are invalid.
This can happen when Make is invoked from a GUI application.

  * w32/subproc/sub_proc.c (process_init_fd): Don't dereference
  pproc if it is a NULL pointer.
  (process_begin, process_cleanup): Don't try to close pipe handles
  whose value is INVALID_HANDLE_VALUE.
  (process_easy): Initialize hIn, hOut, and hErr to
  INVALID_HANDLE_VALUE.  If DuplicateHandle fails with
  ERROR_INVALID_HANDLE, duplicate a handle for the null device
  instead of STD_INPUT_HANDLE, STD_OUTPUT_HANDLE or
  STD_ERROR_HANDLE.  Don't try to close pipe handles whose value is
  INVALID_HANDLE_VALUE.

  * function.c (windows32_openpipe): Initialize hIn and hErr to
  INVALID_HANDLE_VALUE.  If DuplicateHandle fails with
  ERROR_INVALID_HANDLE, duplicate a handle for the null device
  instead of STD_INPUT_HANDLE or STD_ERROR_HANDLE.  Fix indentation.
  Don't try to close handles whose value is INVALID_HANDLE_VALUE.
2012-01-28 16:50:21 +00:00
Eli Zaretskii
715a11735f function.c (define_new_function): Fix format strings in calls to `fatal'. 2012-01-25 18:16:14 +00:00
Paul Smith
89f7058b99 Handle NULL returns from Guile. 2012-01-18 13:31:11 +00:00
Paul Smith
9fb4cdeedb Fix an issue with PATH_SEPARATOR_CHAR when cross-compiling for Windows.
Fixes Savannah bug #34818.
2012-01-16 21:29:44 +00:00
Paul Smith
0bdc191501 Fix autoconf macros for detecting DOS-style pathnames.
Fixes Savannah bug #35256.
2012-01-16 03:53:34 +00:00
Paul Smith
49cc211819 Create a new internal interface for defining new make functions.
This allows us to create new functions without changing function.c.
You still have to modify the GNU make code (for now) though: this is
simply a preliminary step to possibly allowing make to load modules.

Modify the Guile integration to use this method rather than ifdefs
in function.c.
2012-01-16 03:32:49 +00:00
Paul Smith
4e2e5eb199 Disallow whitespace in variable names. 2012-01-16 02:44:04 +00:00
Paul Smith
3f6bb04e75 Update copyright notices. 2012-01-16 02:29:20 +00:00
Paul Smith
c992c4d80f Add GNU Guile as an optional embedded scripting language for make.
On configure-enabled systems, configure will detect Guile installed
(using pkg-config, which is how GNU Guile is distributed) and enable
it if so.

On all non-configure-enabled systems, currently, the default is for
Guile support to be disabled.
2012-01-15 22:41:53 +00:00
Paul Smith
3057357c0a Add prerequisites to ensure ordering of results. 2011-12-10 17:13:14 +00:00
Paul Smith
cb0bedc3d0 Allow os2 and mingw to disable jobserver with a configure option. 2011-11-15 22:56:26 +00:00
Paul Smith
dc2a6ceb81 Enable jobserver on W32 when using configure.
Some W32 cleanups: see Savannah bug #34830
Forgot to modify the config.h.W32.template file for jobserver support.
2011-11-15 21:12:53 +00:00
Paul Smith
4f47fbf953 Be sure to start parsing prereqs in the right place even if there are
escape characters (backslashes) in the target name.
See Savannah bug #33399
2011-11-14 07:31:06 +00:00
Paul Smith
9fcd90e36c Changes to resolve warnings.
Fixes Savannah bug #34608.
2011-11-14 02:26:00 +00:00
Paul Smith
83ce81fcaa Don't use Hungarian notation: remove _p/_ptr from var names.
Fixes Savannah bug #32567.
2011-11-14 00:58:49 +00:00
Paul Smith
63888b91f6 Support jobserver capability on Windows systems.
Implementation contributed by Troy Runkel <Troy.Runkel@mathworks.com>
2011-11-14 00:42:49 +00:00
Paul Smith
934f51d166 In very obscure situations we may write the free token back to the pipe.
Don't do that.  I couldn't come up with a repro case for this!
2011-11-14 00:18:38 +00:00
Paul Smith
bfc3e1ca7c Enable high-resolution timestamps for Darwin (Mac OSX)
Patch provided by Troy Runkel <Troy.Runkel@mathworks.com>
2011-11-13 23:39:54 +00:00
Paul Smith
c7d07fd0b5 Add translation for Czech (cs). 2011-09-26 19:18:30 +00:00
Paul Smith
d472624f33 When we re-exec the master makefile in a jobserver environment, ensure
that MAKEFLAGS is set properly so the re-exec'd make runs in parallel.
See Savannah bug #33873.
2011-09-18 23:39:26 +00:00
Paul Smith
0369a93825 We compute various values for vpath lookup the first time through
and store them in static variables; however one value (std_dirs)
was not being stored statically so the second time through it was
not set.
Fixes Savannah bug #32511
2011-09-18 20:52:13 +00:00
Paul Smith
ef2b0425e7 Avoid certificate checks when getting PO files from translationproject.org 2011-09-17 01:45:09 +00:00
Paul Smith
a5c774a51b Ensure variables defined in $(call ...) have global scope
Add a note about using #!/usr/bin/make -f to the manual.
Clean up the w32 subdirectory in the dist tarball.
2011-09-12 05:29:58 +00:00
Paul Smith
9a9f83e8b5 Ensure that -n takes precedence over -t.
Patch from Michael Witten <mfwitten@gmail.com>
2011-09-02 05:37:54 +00:00
Paul Smith
e4d5d43424 Save strings we're expanding in case an embedded eval causes them
to be freed (if they're the value of a variable that's reset for example).
See Savannah patch #7534
2011-08-29 16:20:19 +00:00
Paul Smith
b06b8c64a2 Fix another error related to whitespace handling in archives.
Newer version of VMS support strncasecmp() so update the config.h.
2011-06-12 16:22:04 +00:00
Paul Smith
f15efca811 Ensure private variables are not used when appending target-specific
variables.  Fixes Savannah bug #32872.
2011-05-07 20:03:49 +00:00
Paul Smith
b664d3a91d Inverted the boolean test from what I wanted it to be. Added a
regression test to make sure this continues to work.
2011-05-07 14:36:11 +00:00
Eli Zaretskii
b5c065418f job.c (construct_command_argv_internal): Don't assume shellflags
is always non-NULL.  Escape-protect characters special to the
 shell when copying the value of SHELL into new_line.  Fixes
 Savannah bug #23922.
2011-05-07 08:29:13 +00:00
Paul Smith
bd6f63e563 Updated documentation to fix Savannah bugs #32058 and #31582 2011-05-02 15:11:23 +00:00
Paul Smith
6979e7e43b Use the same algorithm for counting the number of words to sort as we
use to break up the list of words, so we're sure to get the same number.
Fixes Savannah bug #33125
2011-05-02 12:35:01 +00:00
Paul Smith
dc90160079 Extern the global declaration of stack_limit. Fixes Savannah bug #32753 2011-05-02 12:29:09 +00:00
Paul Smith
a81ee5209b Avoid invoking glob() unless the filename has potential globbing
characters in it, for performance improvements.
2011-05-02 00:18:06 +00:00
Boris Kolpackov
15a79d723d Delay caching of the file name in eval_makefile() until after all the
expansions and searches are complete. This fixes an assertion in a
situation where the MAKEFILES variable contains a file path that
contains tilde.
2011-04-29 15:27:39 +00:00
Paul Smith
b34438bee8 Add new feature: != shell assignment for portability with BSD make.
Feature submitted by David Wheeler.
2011-04-18 01:25:20 +00:00
Paul Smith
1454a04f81 * Fixups to the make man page
* Minor syntax cleanups in the manual
* In non-maintainer mode set NDEBUG to disable assert()
* Performance improvements in strcache:
    Build Info			1000	2000	4000
    3.82 -g			2.61s	8.85s	33.52s
    3.82 -O2			1.90s	7.62s	27.82s
    New -g (with asserts)	1.03s	2.31s	5.79s
    New -O2 (no asserts)	0.65s	1.50s	3.52s
2011-02-21 07:30:11 +00:00
Paul Smith
ae2ab76fac Check if the target-specific variable is the same as the global
variable, and if so don't try to update it.  Savannah bug #31743.
2010-11-30 14:48:52 +00:00
Paul Smith
391456aad7 Improve backslash/newline handling to adhere to POSIX requirements. 2010-11-06 21:56:23 +00:00
Paul Smith
a86d1693ba Bump the version to 3.82.90.
Fix some doc bugs.
Implement the --trace flag.
Show filename/linenumber on error.
2010-08-29 23:05:26 +00:00
Paul Smith
3b1432d86a Set shellflags to a reasonable default if it's not set already. 2010-08-29 04:50:26 +00:00
Eli Zaretskii
c3188c6f31 variable.c (define_automatic_variables) [__MSDOS__ || WINDOWS32]:
Remove trailing backslashes in $(@D), $(<D), etc., for consistency
 with forward slashes.  Fixes Savannah bug #30795.
2010-08-27 15:01:42 +00:00
Paul Smith
5acda13ace - Fix the NEWS file to be accurate
- Add oneshell to $(.FEATURES) (forgot that!)
- Fix Savannah bug #30612: handling of archive references with >1 object
2010-08-14 02:50:14 +00:00
Paul Smith
036760a9fd Fix Savannah bug #30723: expand MAKEFLAGS before we re-exec after
rebuilding makefiles.
2010-08-10 07:35:34 +00:00
Eli Zaretskii
91be515567 w32/subproc/build.bat: Make all 3 cl.exe compile command lines
use the same /I switches.  Fixes Savannah bug #30662.
2010-08-07 08:55:17 +00:00
Eli Zaretskii
b6b6875986 function.c (func_shell) [WINDOWS32]: Reset just_print_flag
around the call to construct_command_argv, so that a temporary
 batch file _is_ created when needed for $(shell).  Fixes Savannah
 bug #16362.
2010-08-07 08:46:06 +00:00
Eli Zaretskii
8f029808af Fix the DJGPP build.
configh.dos.template (HAVE_STRNCASECMP): Define.
2010-08-07 08:15:45 +00:00
165 changed files with 5930 additions and 2312 deletions

View File

@@ -22,6 +22,8 @@ config.ami configh.dos config.h.W32 config.h-vms
loadavg loadavg.c make
gmk-default.h
.deps .dep_segment ID TAGS
_*

View File

@@ -47,7 +47,9 @@ Other contributors:
Janet Carson <janet_carson@tivoli.com>
Howard Chu <hyc@highlandsun.com>
Ludovic Courtès <ludo@gnu.org>
Paul Eggert <eggert@twinsun.com>
Ramon Garcia Fernandez <ramon.garcia.f@gmail.com>
Klaus Heinz <kamar@ease.rhein-main.de>
Michael Joosten
Jim Kelton <jim_kelton@tivoli.com>
@@ -55,19 +57,19 @@ Other contributors:
Tim Magill <tim.magill@telops.gte.com>
Markus Mauhart <qwe123@chello.at>
Greg McGary <greg@mcgary.org>
Thien-Thi Nguyen <ttn@gnuvola.org>
Thomas Riedl <thomas.riedl@siemens.com>
Han-Wen Nienhuys <hanwen@cs.uu.nl>
Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
Carl Staelin (Princeton University)
Ian Stewartson (Data Logic Limited)
Ramon Garcia Fernandez <ramon.garcia.f@gmail.com>
David A. Wheeler <dwheeler@dwheeler.com>
With suggestions/comments/bug reports from a cast of ... well ...
hundreds, anyway :)
-------------------------------------------------------------------------------
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2008, 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 1997-2012 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

575
ChangeLog
View File

@@ -1,3 +1,575 @@
2012-12-08 Eli Zaretskii <eliz@gnu.org>
* job.c (create_batch_file): Fix last change: always increment the
counter of batch files before trying to use it.
2012-12-07 Eli Zaretskii <eliz@gnu.org>
* job.c (construct_command_argv_internal): Remove " from
sh_chars_dos[]. Ignore an escaped backslash inside a string
quoted with "..". This lifts the 4KB or 8KB command-line length
limitation imposed by the Windows shell when a command uses quoted
strings, because we now don't call the shell in that case.
* job.c (create_batch_file): Declare the counter of batch files
static, to avoid having 2 jobs using the same file name and
stepping on each other's toes. When all 64K names are used up,
make one more loop looking for slots that became vacant. This
avoids leaving behind temporary batch files in the temporary
directory, which happens frequently on a fast machine when using
parallel builds.
(reap_children): Add debug message for when removal of a temporary
batch file fails.
2012-10-29 Paul Smith <psmith@gnu.org>
New feature: "load" directive for dynamically-loaded objects.
* NEWS: Document new "load" directive.
* doc/make.texi (Extending make): New chapter on extensions to make.
* configure.in: Check for dlopen/dlsym/dlerror and -ldl.
* Makefile.am (make_SOURCES): Add new file load.c.
* make.h: Prototype for load_file().
* main.c (main): Add "load" to .FEATURES if it's available.
* read.c (eval): Parse "load" and "-load" directives.
2012-09-29 Paul Smith <psmith@gnu.org>
* configure.in: Require a new version of gettext (1.18.1).
Fixes Savannah bug #37307.
2012-09-09 Paul Smith <psmith@gnu.org>
* configure.in (bsd_signal): Define _GNU_SOURCE, a la make.h.
Fixes Savannah bug #32247.
* remake.c (update_file_1): Force intermediate files to be
considered, not pruned, if their non-intermediate parent needs to
be remade. Fixes Savannah bug #30653.
* job.c (construct_command_argv_internal): Keep the command line
on the heap for very long lines. Fixes Savannah bug #36451.
* function.c (func_realpath): BSD realpath(3) doesn't fail if the
file does not exist: use stat. Fixes Savannah bug #35919.
* file.c (expand_deps): Duplicate the current variable buffer, not
the old pointer. Fixes Savannah bug #36925.
* read.c (eval): If we detect an initial UTF-8 BOM, skip it.
Fixes Savannah bug #36529.
(record_target_var): Remove unused variable "fname".
(eval): Use the correct pointer when adding to the variable buffer.
Fixes Savannah bug #36106.
2012-09-09 Eli Zaretskii <eliz@gnu.org>
* read.c (unescape_char): Fix a thinko in the last change.
2012-09-09 Paul Smith <psmith@gnu.org>
* default.c (default_variables): Use a correct default LIBPPATERNS
for MacOS. Fixes Savannah bug #37197.
* read.c (record_files): Reset the default macro values if .POSIX
is set. Fixes Savannah bug #37069.
(parse_file_seq): Break out of an infinite loop if we're not
making progress when parsing archive references.
2012-09-01 Eli Zaretskii <eliz@gnu.org>
* README.W32.template: Update for job-server and Guile support.
* read.c (unescape_char): Advance 'p' after copying the unescaped
characters. Otherwise the backslashes are incorrectly erased from
the original string.
2012-03-05 Paul Smith <psmith@gnu.org>
Update copyright notices to use year ranges, as allowed by
clarifications in the GNU Maintainer's Manual.
2012-03-04 Paul Smith <psmith@gnu.org>
* read.c (unescape_char): New function to remove escapes from a char.
(record_files): Call it on the dependency string to unescape ":".
Fixes Savannah bug #12126 and bug #16545.
* make.h (CSTRLEN): Determine the length of a constant string.
* main.c: Use the new macro.
* read.c: Ditto.
* variable.h: Ditto.
* function.c: Simplify checks for function alternatives.
* expand.c (variable_append): If the current set is local and the
next one is not a parent, then treat the next set as
local as well. Fixes Savannah bug #35468.
2012-03-03 Paul Smith <psmith@gnu.org>
* acinclude.m4 (AC_STRUCT_ST_MTIM_NSEC): Add support for AIX 5.2+
nanosecond timestamps. Fixes Savannah bug #32485.
Convert uses of `foo' for quoting to 'foo' to reflect changes in
the GNU Coding Standards. Fixes Savannah bug #34530.
* job.c (construct_command_argv_internal): In oneshell we need to
break the SHELLFLAGS up for argv. Fixes Savannah bug #35397.
* function.c (func_filter_filterout): Recompute the length of each
filter word in case it was compressed due to escape chars. Don't
reset the string as it's freed. Fixes Savannah bug #35410.
* misc.c (collapse_continuations): Only use POSIX-style
backslash/newline handling if the .POSIX target is set.
Addresses Savannah bug #16670 without backward-incompatibility.
* NEWS: Document behavior change.
* doc/make.texi (Splitting Lines): New section describing how to
use backslash/newline to split long lines.
2012-02-26 Paul Smith <psmith@gnu.org>
* implicit.c (pattern_search): Check the stem length to avoid
stack overflows in stem_str. Fixes Savannah bug #35525.
2012-02-03 Eli Zaretskii <eliz@gnu.org>
* w32/subproc/sub_proc.c (proc_stdin_thread, proc_stdout_thread)
(proc_stderr_thread, process_pipe_io): Ifdef away unused
functions.
* w32/subproc/w32err.c (map_windows32_error_to_string) [_MSC_VER]:
Don't use TLS storage for szMessageBuffer. Ifdef away special
code for handling Winsock error codes. Make the function return a
`const char *'. Suggested by Ozkan Sezer. Fixes Savannah bug #34832.
2012-01-29 Paul Smith <psmith@gnu.org>
* gmk-default.scm (to-string-maybe): Variables map to empty strings.
In Guile 2.0, (define ...) results in a variable object so make
sure that maps to an empty string in make.
* variable.c (parse_variable_definition): New POSIX assignment ::=
Take a struct variable to return more information after parsing.
(assign_variable_definition): New parse_variable_definition() call.
* variable.h: New declaration of parse_variable_definition().
* read.c (do_define): New parse_variable_definition() call.
(parse_var_assignment): Ditto.
(get_next_mword): Parse ::= as a variable assignment.
* doc/make.texi (Flavors): Describe the new ::= syntax.
* NEWS: Mention the ::= operator.
* variable.h (struct variable): Rearrange elts to reduce struct size.
* function.c (func_file): Create a new function, $(file ...)
* doc/make.texi (File Function): Document the $(file ..) function.
* NEWS: Announce it.
* gmk-default.scm (to-string-maybe): Use a more portable way to
test for unprintable characters.
* configure.in [GUILE]: Guile 1.6 doesn't have pkg-config
* build_w32.bat: Ditto.
2012-01-28 Eli Zaretskii <eliz@gnu.org>
* config.h.W32.template: Update from config.h.in.
Support a Windows build with Guile.
* README.W32.template: Update with instructions for building with
Guile.
* build_w32.bat: Support building with Guile.
* make.h [HAVE_STDINT_H]: Include stdint.h.
* main.c (main, clean_jobserver): Move declarations of variables
not used in the WINDOWS32 build to the #else branch, to avoid
compiler warnings.
Fix failures on MS-Windows when Make's standard handles are invalid.
This can happen when Make is invoked from a GUI application.
* w32/subproc/sub_proc.c (process_init_fd): Don't dereference
pproc if it is a NULL pointer.
(process_begin, process_cleanup): Don't try to close pipe handles
whose value is INVALID_HANDLE_VALUE.
(process_easy): Initialize hIn, hOut, and hErr to
INVALID_HANDLE_VALUE. If DuplicateHandle fails with
ERROR_INVALID_HANDLE, duplicate a handle for the null device
instead of STD_INPUT_HANDLE, STD_OUTPUT_HANDLE or
STD_ERROR_HANDLE. Don't try to close pipe handles whose value is
INVALID_HANDLE_VALUE.
* function.c (windows32_openpipe): Initialize hIn and hErr to
INVALID_HANDLE_VALUE. If DuplicateHandle fails with
ERROR_INVALID_HANDLE, duplicate a handle for the null device
instead of STD_INPUT_HANDLE or STD_ERROR_HANDLE. Fix indentation.
Don't try to close handles whose value is INVALID_HANDLE_VALUE.
2012-01-25 Eli Zaretskii <eliz@gnu.org>
* function.c (define_new_function): Fix format strings in calls to
`fatal'.
2012-01-17 Paul Smith <psmith@gnu.org>
* guile.c (func_guile): Handle NULL returns from Guile.
2012-01-16 Paul Smith <psmith@gnu.org>
* make.h (PATH_SEPARATOR_CHAR): Allow resetting for crosscompiling
for Windows. Patch by Chris Sutcliffe <ir0nh34d@gmail.com>
Fixes Savannah bug #34818.
2012-01-15 Paul Smith <psmith@gnu.org>
* variable.h: Prototype an interface for defining new make functions.
* function.c (define_new_function): Define it.
(func_guile): Remove the "guile" function.
(function_table_init): Ditto.
* guile.c (func_guile): Add the "guile" function here.
(setup_guile): Call define_new_function() to define it.
(guile_eval_string): Obsolete.
* all: Update copyright notices.
2012-01-12 Paul Smith <psmith@gnu.org>
Support GNU Guile as an embedded extension language for GNU make.
* NEWS: Note the new Guile capability.
* Makefile.am (EXTRA_DIST, make_SOURCES): Add new guile source files.
(AM_CFLAGS): Add Guile compiler flags.
(guile): Add a rule for converting default SCM into a C header.
* configure.in: Add support for --with-guile.
Also, convert the entire file to properly escaped autoconf m4, and
utilize newer features such as AS_IF() and AS_CASE().
* doc/make.texi (Guile Function): Document the GNU guile integration.
* make.h (guile_eval_string, guile_boot): Prototypes for Guile.
* main.c (main): Run guile_boot() to handle main().
(real_main): All the previous content of main() is here.
(real_main): Add "guile" to the .FEATURES variable.
* function.c (func_guile): Call Guile.
* guile.c: New file implementing GNU make integration with GNU Guile.
* gmk-default.scm: The integration of GNU make with Guile uses
Guile itself for much of the parsing and conversion of return
types, etc. This implementation is embedded into GNU make.
* config.h-vms.template: Disable Guile support.
* config.h.W32.template: Ditto.
* configh.dos.template: Ditto.
* config.ami.template: Ditto.
* makefile.vms: Add new Guile files.
* Makefile.DOS.template: Ditto.
* Makefile.ami: Ditto.
* NMakefile.template: Ditto.
* SMakefile.template: Ditto.
* build_w32.bat: Ditto.
* dosbuild.bat: Ditto.
* make_msvc_net2001.vcproj: Ditto.
2011-11-15 Paul Smith <psmith@gnu.org>
* main.c (main): Use %ld when printing DWORD values.
* job.c (new_job): Ditto.
* w32/include/sub_proc.h: Use const.
* w32/subproc/sub_proc.c (open_jobserver_semaphore): Use const.
Fixes Savannah bug #34830. Changes suggested by Ozkan Sezer.
* configure.in (MAKE_JOBSERVER): Enable jobserver on W32 systems.
* config.h.W32.template (MAKE_JOBSERVER): Ditto.
2011-11-14 Paul Smith <psmith@gnu.org>
* read.c (eval): parse_file_seq() might shorten the string due to
backslash removal. Start parsing again at the colon.
Fixes Savannah bug #33399.
2011-11-13 Paul Smith <psmith@gnu.org>
* file.c (file_timestamp_cons): Match up data types to avoid warnings.
* filedef.h: Ditto.
* misc.c (concat): Ditto.
* read.c (eval): Assign value to avoid warnings.
* function.c (func_shell_base): Use fork() instead of vfork() to
avoid warnings.
* make.h (INTEGER_TYPE_SIGNED): Use <=0 to avoid warnings.
Fixes Savannah bug #34608.
* job.c (construct_command_argv): Remove _p.
(construct_command_argv_internal): Remove _ptr.
Fixes Savannah bug #32567.
* main.c (clean_jobserver): Don't write the free token to the pipe.
Change suggested by Tim Newsome <tnewsome@aristanetworks.com>
* acinclude.m4 (AC_STRUCT_ST_MTIM_NSEC): Add support for Darwin.
* filedef.h (FILE_TIMESTAMP_STAT_MODTIME): Ditto.
Patch provided by Troy Runkel <Troy.Runkel@mathworks.com>
2011-10-11 Troy Runkel <Troy.Runkel@mathworks.com>
* config.h.W32: Enable job server support for Windows.
* main.c [WINDOWS32]: Include sub_proc.h
(main): Create a named semaphore to implement the job server.
(clean_jobserver): Free the job server semaphore when make is finished.
* job.c [WINDOWS32]: Define WAIT_NOHANG
(reap_children): Support non-blocking wait for child processes.
(free_child): Release job server semaphore when child process finished.
(job_noop): Don't define function on Windows.
(set_child_handler_action_flags): Don't define function on Windows.
(new_job): Wait for job server semaphore or child process termination.
(exec_command): Pass new parameters to process_wait_for_any.
* w32/include/sub_proc.h [WINDOWS32]: New/updated EXTERN_DECL entries.
* w32/subproc/sub_proc.c [WINDOWS32]: Added job server implementation.
(open_jobserver_semaphore): Open existing job server semaphore by name.
(create_jobserver_semaphore): Create new job server named semaphore.
(free_jobserver_semaphore): Close existing job server semaphore.
(acquire_jobserver_semaphore): Decrement job server semaphore count.
(release_jobserver_semaphore): Increment job server semaphore count.
(has_jobserver_semaphore): Returns whether job server semaphore exists.
(get_jobserver_semaphore_name): Returns name of job server semaphore.
(wait_for_semaphore_or_child_process): Wait for either the job server
semaphore to become signalled or a child process to terminate.
(process_wait_for_any_private): Support for non-blocking wait for child.
(process_wait_for_any): Added support for non-blocking wait for child.
(process_file_io): Pass new parameters to process_wait_for_any_private.
2011-09-18 Paul Smith <psmith@gnu.org>
* main.c (main): If we're re-exec'ing and we're the master make,
then restore the job_slots value so it goes back into MAKEFLAGS
properly. See Savannah bug #33873.
* remake.c (library_search): STD_DIRS is computed when other
static vars like buflen etc. are computed, so it must be static
as well. See Savannah bug #32511.
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.
2011-09-12 Paul Smith <psmith@gnu.org>
* read.c (eval): Ensure exported variables are defined in the
global scope. Fixes Savannah bug #32498.
2011-09-11 Paul Smith <psmith@gnu.org>
* Makefile.am (dist-hook): Remove w32/Makefile and .deps/ from the
dist file. Fixes Savannah bug #31489.
* doc/make.texi (Complex Makefile): Add a hint about using
#!/usr/bin/make (for Savannah support request #106459)
2011-09-02 Paul Smith <psmith@gnu.org>
* remake.c (touch_file): If we have both -n and -t, -n takes
precedence. Patch from Michael Witten <mfwitten@gmail.com>
2011-08-29 Paul Smith <psmith@gnu.org>
* expand.c (variable_expand_string): Always allocate a new buffer
for a string we're expanding. The string we're working on can get
freed while we work on it (for example if it's the value of a
variable which modifies itself using an eval operation).
See Savannah patch #7534 for the original report by Lubomir Rintel.
2011-06-12 Paul Smith <psmith@gnu.org>
* read.c (parse_file_seq): Move the check for empty members out of
the loop so we can go to the next member properly.
Another fix for Savannah bug #30612.
* config.h-vms.template: Newer versions of VMS have strncasecmp()
Patch provided by: Hartmut Becker <becker.ismaning@freenet.de>
2011-05-07 Paul Smith <psmith@gnu.org>
* expand.c (variable_append): Add a LOCAL argument to track
whether this is the first invocation or not. If it's not and
private_var is set, then skip this variable and try the next one.
Fixes Savannah bug #32872.
* read.c (parse_file_seq): Ensure existence checks use glob().
2011-05-07 Eli Zaretskii <eliz@gnu.org>
* job.c (construct_command_argv_internal): Don't assume shellflags
is always non-NULL. Escape-protect characters special to the
shell when copying the value of SHELL into new_line. Fixes
Savannah bug #23922.
2011-05-02 Paul Smith <psmith@gnu.org>
* doc/make.texi (Special Variables): Add documentation for the new
words in .FEATURES. Fixes Savannah bug #32058.
(Flavor Function): Rewrite the section on the flavor function.
Fixes Savannah bug #31582.
* function.c (func_sort): Use the same algorithm to count the
number of words we will get after the split, as we use to split.
Based on a patch from Matthias Hopf. Fixes Savannah bug #33125.
* make.h: Make global variable stack_limit extern.
Fixes Savannah bug #32753.
2011-05-01 Paul Smith <psmith@gnu.org>
* read.c (parse_file_seq): Don't try to invoke glob() unless there
are potential wildcard characters in the filename. Performance
enhancement suggested by Michael Meeks <michael.meeks@novell.com>
2011-04-29 Boris Kolpackov <boris@codesynthesis.com>
* read.c (eval_makefile): Delay caching of the file name until after
all the expansions and searches.
2011-04-17 David A. Wheeler <dwheeler@dwheeler.com>
* doc/make.texi (Reading Makefiles): Document "!=".
(Setting): Ditto.
(Features): Ditto.
* variable.h (enum variable_flavor): New type "f_shell".
* variable.c (shell_result): Send a string to the shell and store
the output.
(do_variable_definition): Handle f_shell variables: expand the
value, then send it to the shell and store the result.
(parse_variable_definition): Parse "!=" shell assignments.
* read.c (get_next_mword): Treat "!=" as a varassign word.
* function.c (fold_newlines): If trim_newlines is set remove all
trailing newlines; otherwise remove only the last newline.
(func_shell_base): Move the guts of the shell function here.
(func_shell): Call func_shell_base().
2011-02-21 Paul Smith <psmith@gnu.org>
* strcache.c (various): Increase performance based on comments
from Ralf Wildenhues <Ralf.Wildenhues@gmx.de>. Stop looking for
a buffer when we find the first one that fits, not the best fit.
If there is not enough free space in a buffer move it to a
separate list so we don't have to walk it again.
* make.h (NDEBUG): Turn off asserts unless maintainer mode is set.
(strcache_add_len, strcache_setbufsize): Use unsigned length/size.
* maintMakefile (AM_CPPFLAGS): Enable MAKE_MAINTAINER_MODE.
* remake.c (complain): Move translation lookups closer to use.
2011-02-13 Paul Smith <psmith@gnu.org>
* doc/make.texi: Clean up references to "static" variables and
semicolon errors. Patch from Michael Witten <mfwitten@gmail.com>.
2010-12-27 Paul Smith <psmith@gnu.org>
* make.1: Update the header/footer info in the man page.
2010-11-28 Paul Smith <psmith@gnu.org>
* read.c (record_target_var): Don't reset v if it's the same as
the global version. Fixes Savannah bug #31743.
2010-11-06 Paul Smith <psmith@gnu.org>
* variable.c (print_auto_variable): Print auto variables; ignore others.
(print_noauto_variable): Print non-auto variables; ignore others.
(print_variable_set): Allow the caller to select which type to print.
(print_target_variables): Show all the non-auto variables for a target.
* default.c (install_default_suffix_rules): Initialize recipe_prefix.
* rule.c (install_pattern_rule): Ditto.
* read.c (record_files): Pass in the current recipe prefix. Remember
it in the struct command for these targets.
(eval): Remember the value of RECIPEPREFIX when we start parsing.
Do not remove recipe prefixes from the recipe here: we'll do it later.
* job.c (start_job_command): Remove recipe prefix characters early,
before we print the output or chop it up.
* file.c (print_file): If recipe_prefix is not standard, reset it
in -p output. Assign target variables in -p output as well.
* commands.c (chop_commands): Max command lines is USHRT_MAX.
Set any_recurse as a bitfield.
* make.h (USHRT_MAX): Define if not set.
2010-10-27 Paul Smith <psmith@gnu.org>
* commands.h (struct commands): Rearrange to make better use of
memory. Add new recipe_prefix value.
2010-10-26 Paul Smith <psmith@gnu.org>
* doc/make.texi (Setting): Document the treatment of
backslash-newline in variable values.
* misc.c (collapse_continuations): Do not collapse multiple
backslash-newlines into a single space. Fixes Savannah bug #16670.
2010-08-29 Paul Smith <psmith@gnu.org>
* doc/make.texi (Implicit Variables): Document LDLIBS and LOADLIBES.
Fixes Savannah bug #30807.
(Instead of Execution): Mention that included makefiles are still
rebuilt even with -n. Fixes Savannah bug #30762.
* configure.in: Bump to 3.82.90.
* make.h: Add trace_flag variable.
* main.c (switches): Add --trace option.
(trace_flag): Declare variable.
* job.c (start_job_command): Show recipe if trace_flag is set.
(new_job): Show trace messages if trace_flag is set.
* doc/make.texi (Options Summary): Document the new --trace option.
* make.1: Add --trace documentation.
* NEWS: Mention --trace.
* job.c (child_error): Show recipe filename/linenumber on error.
Also show "(ignored)" when appropriate even for signals/coredumps.
* NEWS: Mention file/linenumber change.
* main.c (main): Print version info when DB_BASIC is set.
* job.c (construct_command_argv_internal): If shellflags is not
set, choose an appropriate default value. Fixes Savannah bug #30748.
2010-08-27 Eli Zaretskii <eliz@gnu.org>
* variable.c (define_automatic_variables) [__MSDOS__ || WINDOWS32]:
Remove trailing backslashes in $(@D), $(<D), etc., for consistency
with forward slashes. Fixes Savannah bug #30795.
2010-08-13 Paul Smith <psmith@gnu.org>
* NEWS: Accidentally forgot to back out the sorted wildcard
enhancement in 3.82, so update NEWS.
Also add NEWS about the error check for explicit and pattern
targets in the same rule, added to 3.82.
* main.c (main): Add "oneshell" to $(.FEATURES) (forgot to add
this in 3.82!)
* read.c (parse_file_seq): Fix various errors parsing archives
with multiple objects in the parenthesis, as well as wildcards.
Fixes Savannah bug #30612.
2010-08-10 Paul Smith <psmith@gnu.org>
* main.c (main): Expand MAKEFLAGS before adding it to the
environment when re-exec'ing. Fixes Savannah bug #30723.
2010-08-07 Eli Zaretskii <eliz@gnu.org>
* w32/subproc/build.bat: Make all 3 cl.exe compile command lines
use the same /I switches. Fixes Savannah bug #30662.
* function.c (func_shell) [WINDOWS32]: Reset just_print_flag
around the call to construct_command_argv, so that a temporary
batch file _is_ created when needed for $(shell).
Fixes Savannah bug #16362.
2010-08-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
* configh.dos.template (HAVE_STRNCASECMP): Define.
2010-07-28 Paul Smith <psmith@gnu.org>
Version 3.82 released.
@@ -4001,8 +4573,7 @@ See ChangeLog.2, available in the CVS repository at:
for earlier changes.
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free
Software Foundation, Inc.
Copyright (C) 2000-2012 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

View File

@@ -4981,9 +4981,7 @@ Fri Jul 15 21:01:44 1988 Roland McGrath (mcgrath at tully.Berkeley.EDU)
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009 Free
Software Foundation, Inc.
Copyright (C) 1988-2009 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

View File

@@ -6637,8 +6637,7 @@ See ChangeLog.1, available in the CVS repository at:
for earlier changes.
Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
Copyright (C) 1991-2007 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

View File

@@ -1,8 +1,7 @@
# -*-Makefile-*- template for DJGPP
# Makefile.in generated automatically by automake 1.2 from Makefile.am
#
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
# 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
# Copyright (C) 1994-2012 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
@@ -89,7 +88,7 @@ INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"$(prefix)$(libdir)\" -DINCLUDEDIR=\"$(pre
BUILT_SOURCES = README build.sh-in
EXTRA_DIST = $(BUILT_SOURCES) $(man_MANS) README.customs remote-cstms.c make-stds.texi texinfo.tex SCOPTIONS SMakefile Makefile.ami README.Amiga config.ami amiga.c amiga.h NMakefile README.DOS configh.dos configure.bat makefile.com README.W32 build_w32.bat config.h-W32 subproc.bat make.lnk config.h-vms makefile.vms readme.vms vmsdir.h vmsfunctions.c vmsify.c
EXTRA_DIST = $(BUILT_SOURCES) $(man_MANS) README.customs remote-cstms.c make-stds.texi texinfo.tex SCOPTIONS SMakefile Makefile.ami README.Amiga config.ami amiga.c amiga.h NMakefile README.DOS configh.dos configure.bat makefile.com README.W32 build_w32.bat config.h-W32 subproc.bat make.lnk config.h-vms makefile.vms readme.vms vmsdir.h vmsfunctions.c vmsify.c gmk-default.scm gmk-default.h
SUBDIRS = glob doc
mkinstalldirs = ${exec_prefix}/bin/gmkdir -p

View File

@@ -1,7 +1,6 @@
# This is a -*-Makefile-*-, or close enough
#
# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
# Copyright (C) 1997-2012 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
@@ -39,18 +38,23 @@ else
remote = remote-stub.c
endif
make_SOURCES = ar.c arscan.c commands.c default.c dir.c expand.c file.c \
function.c getopt.c getopt1.c implicit.c job.c main.c \
misc.c read.c remake.c $(remote) rule.c signame.c \
strcache.c variable.c version.c vpath.c hash.c
function.c getopt.c getopt1.c implicit.c job.c load.c main.c \
misc.c read.c remake.c rule.c signame.c \
strcache.c variable.c version.c vpath.c hash.c \
$(remote)
if HAVE_GUILE
make_SOURCES += guile.c
endif
EXTRA_make_SOURCES = vmsjobs.c remote-stub.c remote-cstms.c
noinst_HEADERS = commands.h dep.h filedef.h job.h make.h rule.h variable.h \
debug.h getopt.h gettext.h hash.h
make_LDADD = @LIBOBJS@ @ALLOCA@ $(GLOBLIB) @GETLOADAVG_LIBS@ @LIBINTL@
make_LDADD = @LIBOBJS@ @ALLOCA@ $(GLOBLIB) @GETLOADAVG_LIBS@ @LIBINTL@ \
$(GUILE_LIBS)
# Only process if target is MS-Windows
if WINDOWSENV
make_LDADD += $(W32LIB)
@@ -61,6 +65,7 @@ man_MANS = make.1
DEFS = -DLOCALEDIR=\"$(localedir)\" -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\" @DEFS@
AM_CPPFLAGS = $(GLOBINC)
AM_CFLAGS = $(GUILE_CFLAGS)
# Only process if target is MS-Windows
if WINDOWSENV
AM_CPPFLAGS += $(W32INC)
@@ -77,7 +82,8 @@ EXTRA_DIST = README build.sh.in $(man_MANS) \
README.W32 NMakefile config.h.W32 build_w32.bat subproc.bat \
make_msvc_net2003.sln make_msvc_net2003.vcproj \
readme.vms makefile.vms makefile.com config.h-vms \
vmsdir.h vmsfunctions.c vmsify.c
vmsdir.h vmsfunctions.c vmsify.c \
gmk-default.scm gmk-default.h
# This is built during configure, but behind configure's back
@@ -100,8 +106,8 @@ localedir = $(datadir)/locale
#
# Whether or not make needs to be installed setgid.
# The value should be either `true' or `false'.
# On many systems, the getloadavg function (used to implement the `-l'
# The value should be either 'true' or 'false'.
# On many systems, the getloadavg function (used to implement the '-l'
# switch) will not work unless make is installed setgid kmem.
#
inst_setgid = @NEED_SETGID@
@@ -117,19 +123,28 @@ install-exec-local:
echo "chgrp $(inst_group) $$app && chmod g+s $$app"; \
else \
echo "$$app needs to be owned by group $(inst_group) and setgid;"; \
echo "otherwise the \`-l' option will probably not work."; \
echo "otherwise the '-l' option will probably not work."; \
echo "You may need special privileges to complete the installation"; \
echo "of $$app."; \
fi; \
else true; fi
# --------------- Generate the Guile default module content
guile.$(OBJEXT): gmk-default.h
gmk-default.h: $(srcdir)/gmk-default.scm
(echo 'static const char *const GUILE_module_defn = " '\\ \
&& sed -e 's/;.*//' -e '/^[ \t]*$$/d' -e 's/"/\\"/g' -e 's/$$/ \\/' \
$(srcdir)/gmk-default.scm \
&& echo '";') > $@
# --------------- Local DIST Section
# Install the w32 and tests subdirectories
#
dist-hook:
(cd $(srcdir); \
sub=`find w32 tests -follow \( -name CVS -prune -o -name .cvsignore -o -name work -prune \) -o \( -name \*.orig -o -name \*.rej -o -name \*~ -prune \) -o -type f -print`; \
sub=`find w32 tests -follow \( -name CVS -o -name .deps -o -name work -o -name .cvsignore -o -name \*.orig -o -name \*.rej -o -name \*~ -o -name Makefile \) -prune -o -type f -print`; \
tar chf - $$sub) \
| (cd $(distdir); tar xfBp -)

View File

@@ -1,10 +1,9 @@
# -*-Makefile-*- for GNU make on Amiga
#
# NOTE: If you have no `make' program at all to process this makefile, run
# `build.sh' instead.
# NOTE: If you have no 'make' program at all to process this makefile, run
# 'build.sh' instead.
#
# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
# Copyright (C) 1995-2012 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
@@ -32,18 +31,18 @@ CPPFLAGS =
LDFLAGS =
# Define these for your system as follows:
# -DNO_ARCHIVES To disable `ar' archive support.
# -DNO_ARCHIVES To disable 'ar' archive support.
# -DNO_FLOAT To avoid using floating-point numbers.
# -DENUM_BITFIELDS If the compiler isn't GCC but groks enum foo:2.
# Some compilers apparently accept this
# without complaint but produce losing code,
# so beware.
# NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
# See also `config.h'.
# See also 'config.h'.
defines =
# Which flavor of remote job execution support to use.
# The code is found in `remote-$(REMOTE).c'.
# The code is found in 'remote-$(REMOTE).c'.
REMOTE = stub
# If you are using the GNU C library, or have the GNU getopt functions in
@@ -77,9 +76,9 @@ prefix =
# Common prefix for machine-dependent installed files.
exec_prefix =
# Directory to install `make' in.
# Directory to install 'make' in.
bindir = sc:c
# Directory to find libraries in for `-lXXX'.
# Directory to find libraries in for '-lXXX'.
libdir = lib:
# Directory to search by default for included makefiles.
includedir = include:
@@ -89,20 +88,20 @@ infodir = doc:
mandir = t:
# Number to put on the man page filename.
manext = 1
# Prefix to put on installed `make' binary file name.
# Prefix to put on installed 'make' binary file name.
binprefix =
# Prefix to put on installed `make' man page file name.
# Prefix to put on installed 'make' man page file name.
manprefix = $(binprefix)
# Whether or not make needs to be installed setgid.
# The value should be either `true' or `false'.
# On many systems, the getloadavg function (used to implement the `-l'
# The value should be either 'true' or 'false'.
# On many systems, the getloadavg function (used to implement the '-l'
# switch) will not work unless make is installed setgid kmem.
install_setgid = false
# Install make setgid to this group so it can read /dev/kmem.
group = sys
# Program to install `make'.
# Program to install 'make'.
INSTALL_PROGRAM = copy
# Program to install the man page.
INSTALL_DATA = copy
@@ -118,20 +117,23 @@ TEXI2DVI = texi2dvi
ETAGS = etags -w
CTAGS = ctags -w
objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
rule.o implicit.o default.o variable.o expand.o function.o \
vpath.o version.o ar.o arscan.o signame.o strcache.o hash.o \
remote-$(REMOTE).o $(GETOPT) $(ALLOCA) $(extras)
#guile = guile.o
objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
rule.o implicit.o default.o variable.o expand.o function.o \
vpath.o version.o ar.o arscan.o signame.o strcache.o hash.o \
remote-$(REMOTE).o $(GETOPT) $(ALLOCA) $(extras) $(guile)
srcs = $(srcdir)commands.c $(srcdir)job.c $(srcdir)dir.c \
$(srcdir)file.c $(srcdir)getloadavg.c $(srcdir)misc.c \
$(srcdir)main.c $(srcdir)read.c $(srcdir)remake.c \
$(srcdir)rule.c $(srcdir)implicit.c $(srcdir)default.c \
$(srcdir)variable.c $(srcdir)expand.c $(srcdir)function.c \
$(srcdir)vpath.c $(srcdir)version.c $(srcdir)hash.c \
$(srcdir)remote-$(REMOTE).c \
$(srcdir)ar.c $(srcdir)arscan.c $(srcdir)strcache.c \
$(srcdir)signame.c $(srcdir)signame.h $(GETOPT_SRC) \
$(srcdir)commands.h $(srcdir)dep.h $(srcdir)filedep.h \
$(srcdir)guile.c $(srcdir)remote-$(REMOTE).c \
$(srcdir)ar.c $(srcdir)arscan.c $(srcdir)strcache.c \
$(srcdir)signame.c $(srcdir)signame.h $(GETOPT_SRC) \
$(srcdir)commands.h $(srcdir)dep.h $(srcdir)filedep.h \
$(srcdir)job.h $(srcdir)make.h $(srcdir)rule.h \
$(srcdir)variable.h $(ALLOCA_SRC) $(srcdir)config.h.in
@@ -142,7 +144,7 @@ srcs = $(srcdir)commands.c $(srcdir)job.c $(srcdir)dir.c \
all: make
info: make.info
dvi: make.dvi
# Some makes apparently use .PHONY as the default goal if it is before `all'.
# Some makes apparently use .PHONY as the default goal if it is before 'all'.
.PHONY: all check info dvi
make.info: make.texinfo
@@ -179,8 +181,6 @@ glob/libglob.a: FORCE config.h
cd glob; $(MAKE) libglob.a
FORCE:
tagsrcs = $(srcs) $(srcdir)remote-*.c
.PHONY: install installdirs
install: installdirs \
$(bindir)$(binprefix)make $(infodir)make.info \
@@ -196,7 +196,7 @@ $(bindir)$(binprefix)make: make
echo "chgrp $(group) $@.new && chmod g+s $@.new"; \
else \
echo "$@ needs to be owned by group $(group) and setgid;"; \
echo "otherwise the \`-l' option will probably not work."; \
echo "otherwise the '-l' option will probably not work."; \
echo "You may need special privileges to install $@."; \
fi; \
else true; fi
@@ -213,9 +213,9 @@ $(infodir)make.info: make.info
`echo $@ | sed "s,make.info\$$,$$name,"`; \
done
# Run install-info only if it exists.
# Use `if' instead of just prepending `-' to the
# Use 'if' instead of just prepending '-' to the
# line so we notice real errors from install-info.
# We use `$(SHELL) -c' because some shells do not
# We use '$(SHELL) -c' because some shells do not
# fail gracefully when there is an unknown command.
if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
if [ -r ./make.info ]; then dir=.; else dir=$(srcdir); fi; \
@@ -266,8 +266,8 @@ glob-clean glob-realclean:
.NOEXPORT:
# The automatically generated dependencies below may omit config.h
# because it is included with ``#include <config.h>'' rather than
# ``#include "config.h"''. So we add the explicit dependency to make sure.
# because it is included with '#include <config.h>' rather than
# '#include "config.h"'. So we add the explicit dependency to make sure.
$(objs): config.h
# Automatically generated dependencies will be put at the end of the file.
@@ -281,6 +281,7 @@ file.o: file.c make.h dep.h filedef.h job.h commands.h variable.h
misc.o: misc.c make.h dep.h
main.o: main.c make.h dep.h filedef.h variable.h job.h commands.h \
getopt.h
guile.o: guile.c make.h dep.h debug.h variable.h gmk-default.h
read.o: read.c make.h dep.h filedef.h job.h commands.h variable.h \
glob/glob.h
remake.o: remake.c make.h filedef.h job.h commands.h dep.h

88
NEWS
View File

@@ -1,6 +1,6 @@
GNU make NEWS -*-indented-text-*-
History of user-visible changes.
28 July 2010
05 March 2012
See the end of this file for copyrights and conditions.
@@ -8,6 +8,64 @@ All changes mentioned here 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
reporting bugs.
Version 3.99.90
A complete list of bugs fixed in this version is available here:
http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=101&set=custom
* WARNING: Backward-incompatibility!
If .POSIX is specified, then make adheres to the POSIX backslash/newline
handling requirements, which introduces the following changes to the
standard backslash/newline handling in non-recipe lines:
* Any trailing space before the backslash is preserved
* Each backslash/newline (plus subsequent whitespace) is converted to a
single space
* New command line option: --trace enables tracing of targets. When enabled
the recipe to be invoked is printed even if it would otherwise be suppressed
by .SILENT or a "@" prefix character. Also before each recipe is run the
makefile name and linenumber where it was defined are shown as well as the
prerequisites that caused the target to be considered out of date.
* New feature: The "job server" capability is now supported on Windows.
Implementation contributed by Troy Runkel <Troy.Runkel@mathworks.com>
* New feature: "!=" shell assignment operator as an alternative to the
$(shell ...) function. Implemented for compatibility with BSD makefiles.
WARNING: Backward-incompatibility!
Variables ending in "!" previously defined as "variable!= value" will now be
interpreted as shell assignment. Change your assignment to add whitespace
between the "!" and "=": "variable! = value"
* 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
not necessary to define the .POSIX target to access this operator.
* New feature: GNU Guile integration
This version of GNU make can be compiled with GNU Guile integration.
GNU Guile serves as an embedded extension language for make.
See the "Guile Function" section in the GNU Make manual for details.
* New feature: Loadable objects
This version of GNU make contains a "technology preview": the ability to
load dynamic objects into the make runtime. These objects can be created by
the user and can add extended functionality, usable by makefiles.
* New function: $(file ...) writes to a file.
* On failure, the makefile name and linenumber of the recipe that failed are
shown.
* A .RECIPEPREFIX setting is remembered per-recipe and variables expanded
in that recipe also use that recipe prefix setting.
* In -p output, .RECIPEPREFIX settings are shown and all target-specific
variables are output as if in a makefile, instead of as comments.
Version 3.82
@@ -18,14 +76,6 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=104&set
* Compiling GNU make now requires a conforming ISO C 1989 compiler and
standard runtime library.
* WARNING: Future backward-incompatibility!
Wildcards are not documented as returning sorted values, but up to and
including this release the results have been sorted and some makefiles are
apparently depending on that. In the next release of GNU make, for
performance reasons, we may remove that sorting. If your makefiles
require sorted results from wildcard expansions, use the $(sort ...)
function to request it explicitly.
* WARNING: Backward-incompatibility!
The POSIX standard for make was changed in the 2008 version in a
fundamentally incompatible way: make is required to invoke the shell as if
@@ -41,6 +91,21 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=104&set
be considered out of date, even if they do not exist (previously only
existing targets were provided in $?).
* WARNING: Backward-incompatibility!
Wildcards were not documented as returning sorted values, but the results
have been sorted up until this release.. If your makefiles require sorted
results from wildcard expansions, use the $(sort ...) function to request
it explicitly.
* WARNING: Backward-incompatibility!
In previous versions of make it was acceptable to list one or more explicit
targets followed by one or more pattern targets in the same rule and it
worked "as expected". However, this was not documented as acceptable and if
you listed any explicit targets AFTER the pattern targets, the entire rule
would be mis-parsed. This release removes this ability completely: make
will generate an error message if you mix explicit and pattern targets in
the same rule.
* WARNING: Backward-incompatibility!
As a result of parser enhancements, three backward-compatibility issues
exist: first, a prerequisite containing an "=" cannot be escaped with a
@@ -1096,9 +1161,8 @@ Version 3.05
(Changes from versions 1 through 3.05 were never recorded. Sorry.)
-------------------------------------------------------------------------------
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc. This file is part of GNU Make.
Copyright (C) 1988-2012 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

View File

@@ -3,8 +3,7 @@
# NOTE: If you have no 'make' program at all to process this makefile,
# run 'build_w32.bat' instead.
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
# Copyright (C) 1996-2012 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
@@ -73,6 +72,8 @@ $(OUTDIR):
LIBS = kernel32.lib user32.lib advapi32.lib
#guile = $(OUTDIR)/guile.obj
OBJS = \
$(OUTDIR)/ar.obj \
$(OUTDIR)/arscan.obj \
@@ -102,7 +103,8 @@ OBJS = \
$(OUTDIR)/glob.obj \
$(OUTDIR)/fnmatch.obj \
$(OUTDIR)/dirent.obj \
$(OUTDIR)/pathstuff.obj
$(OUTDIR)/pathstuff.obj \
$(guile)
$(OUTDIR)/make.exe: $(OUTDIR) $(OBJS)
$(LINK) @<<

View File

@@ -61,8 +61,7 @@ If you plan to use recursive makes, install make resident:
-------------------------------------------------------------------------------
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 1995-2012 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

View File

@@ -8,12 +8,12 @@ New (since 3.74) DOS-specific features:
1. Supports long filenames when run from DOS box on Windows 9x.
2. Supports both stock DOS COMMAND.COM and Unix-style shells
(details in ``Notes'' below).
(details in 'Notes' below).
3. Supports DOS drive letters in dependencies and pattern rules.
4. Better support for DOS-style backslashes in pathnames (but see
``Notes'' below).
'Notes' below).
5. The $(shell) built-in can run arbitrary complex commands,
including pipes and redirection, even when COMMAND.COM is your
@@ -55,7 +55,7 @@ To build from sources:
either DJTAR (which is part of the DJGPP development
environment), or the DJGPP port of GNU Tar.
2. Invoke the `configure.bat' batch file.
2. Invoke the 'configure.bat' batch file.
If you are building Make in-place, i.e. in the same directory
where its sources are kept, just type "configure.bat" and press
@@ -68,7 +68,7 @@ To build from sources:
use them here.
3. If configure.bat doesn't find a working Make, it will suggest to
use the `dosbuild.bat' batch file to build Make. Either do as it
use the 'dosbuild.bat' batch file to build Make. Either do as it
suggests or install another Make program (a pre-compiled binary
should be available from the usual DJGPP sites) and rerun
configure.bat.
@@ -91,7 +91,7 @@ To build from sources:
else Make might fail.
6. After Make finishes, if you have a Unix-style shell installed,
you can use the `install' target to install the package. You
you can use the 'install' target to install the package. You
will also need GNU Fileutils and GNU Sed for this (they should
be available from the DJGPP sites).
@@ -107,12 +107,12 @@ To build from sources:
Without a Unix-style shell, you will have to install programs
and the docs manually. Copy make.exe to a directory on your
PATH, make.i* info files to your Info directory, and update the
file `dir' in your Info directory by adding the following item
file 'dir' in your Info directory by adding the following item
to the main menu:
* Make: (make.info). The GNU make utility.
If you have the `install-info' program (from the GNU Texinfo
If you have the 'install-info' program (from the GNU Texinfo
package), it will do that for you if you invoke it like this:
install-info --info-dir=c:/djgpp/info c:/djgpp/info/make.info
@@ -120,8 +120,8 @@ To build from sources:
(If your Info directory is other than C:\DJGPP\INFO, change this
command accordingly.)
7. The `clean' targets also require Unix-style shell, and GNU Sed
and `rm' programs (the latter from Fileutils).
7. The 'clean' targets also require Unix-style shell, and GNU Sed
and 'rm' programs (the latter from Fileutils).
8. To run the test suite, type "make check". This requires a Unix
shell (I used the DJGPP port of Bash 2.03), Perl, Sed, Fileutils
@@ -144,7 +144,7 @@ Notes:
This port supports both DOS shells (the stock COMMAND.COM and its
4DOS/NDOS replacements), and Unix-style shells (tested with the
venerable Stewartson's `ms_sh' 2.3 and the DJGPP port of `bash' by
venerable Stewartson's 'ms_sh' 2.3 and the DJGPP port of 'bash' by
Daisuke Aoyama <jack@st.rim.or.jp>).
When the $SHELL variable points to a Unix-style shell, Make
@@ -166,17 +166,17 @@ Notes:
redirection and pipes, and shall only call the shell when a
batch file or a command internal to the shell is invoked. (Even
when a command is an internal shell command, Make will first
search the $PATH for it, so that if a Makefile calls `mkdir',
you can install, say, a port of GNU `mkdir' and have it called
search the $PATH for it, so that if a Makefile calls 'mkdir',
you can install, say, a port of GNU 'mkdir' and have it called
in that case.)
The key to all this is the extended functionality of `spawn' and
`system' functions from the DJGPP library; this port just calls
`system' where it would invoke the shell on Unix. The most
The key to all this is the extended functionality of 'spawn' and
'system' functions from the DJGPP library; this port just calls
'system' where it would invoke the shell on Unix. The most
important aspect of these functions is that they use a special
mechanism to pass long (up to 16KB) command lines to DJGPP
programs. In addition, `system' emulates some internal
commands, like `cd' (so that you can now use forward slashes
programs. In addition, 'system' emulates some internal
commands, like 'cd' (so that you can now use forward slashes
with it, and can also change the drive if the directory is on
another drive). Another aspect worth mentioning is that you can
call Unix shell scripts directly, provided that the shell whose
@@ -186,7 +186,7 @@ Notes:
reference for more details.
The $(shell) built-in is implemented in this port by calling
`popen'. Since `popen' calls `system', the above considerations
'popen'. Since 'popen' calls 'system', the above considerations
are valid for $(shell) as well. In particular, you can put
arbitrary complex commands, including pipes and redirection,
inside $(shell), which is in many cases a valid substitute for
@@ -197,12 +197,12 @@ Notes:
Many Unix Makefiles include a line which sets the SHELL, for
those versions of Make which don't have this as the default.
Since many DOS systems don't have `sh' installed (in fact, most
of them don't even have a `/bin' directory), this port takes
Since many DOS systems don't have 'sh' installed (in fact, most
of them don't even have a '/bin' directory), this port takes
such directives with a grain of salt. It will only honor such a
directive if the basename of the shell name (like `sh' in the
directive if the basename of the shell name (like 'sh' in the
above example) can indeed be found in the directory that is
mentioned in the SHELL= line (`/bin' in the above example), or
mentioned in the SHELL= line ('/bin' in the above example), or
in the current working directory, or anywhere on the $PATH (in
that order). If the basename doesn't include a filename
extension, Make will look for any known extension that indicates
@@ -237,8 +237,8 @@ Notes:
require such a shell). More important, you can convert Unix
Makefiles to MSDOS and leave the line which sets the shell
intact, so that people who do have Unixy shell could use it for
targets which aren't converted to DOS (like `install' and
`uninstall', for example).
targets which aren't converted to DOS (like 'install' and
'uninstall', for example).
3. Default directories.
@@ -258,14 +258,14 @@ Notes:
If you run Make on Windows 9x, you should be aware of the
letter-case issue. Make is internally case-sensitive, but all
file operations are case-insensitive on Windows 9x, so
e.g. files `FAQ', `faq' and `Faq' all refer to the same file, as
e.g. files 'FAQ', 'faq' and 'Faq' all refer to the same file, as
far as Windows is concerned. The underlying DJGPP C library
functions honor the letter-case of the filenames they get from
the OS, except that by default, they down-case 8+3 DOS filenames
which are stored in upper case in the directory and would break
many Makefiles otherwise. (The details of which filenames are
converted to lower case are explained in the DJGPP libc docs,
under the `_preserve_fncase' and `_lfn_gen_short_fname'
under the '_preserve_fncase' and '_lfn_gen_short_fname'
functions, but as a thumb rule, any filename that is stored in
upper case in the directory, is a valid DOS 8+3 filename and
doesn't include characters invalid on MSDOS FAT filesystems,
@@ -282,8 +282,8 @@ Notes:
There are a lot of places throughout the program sources which
make implicit assumptions about the pathname syntax. In
particular, the directories are assumed to be separated by `/',
and any pathname which doesn't begin with a `/' is assumed to be
particular, the directories are assumed to be separated by '/',
and any pathname which doesn't begin with a '/' is assumed to be
relative to the current directory. This port attempts to
support DOS-style pathnames which might include the drive letter
and use backslashes instead of forward slashes. However, this
@@ -296,7 +296,7 @@ Notes:
is the standard programs which come with MSDOS. Otherwise, you
are advised to stay away from backslashes whenever possible. In
particular, filename globbing won't work on pathnames with
backslashes, because the GNU `glob' library doesn't support them
backslashes, because the GNU 'glob' library doesn't support them
(backslash is special in filename wildcards, and I didn't want
to break that).
@@ -315,7 +315,7 @@ Bug reports:
<djgpp@delorie.com>, which is an email gateway into the above news
group). For other bugs, please follow the procedure explained in
the "Bugs" chapter of the Info docs. If you don't have an Info
reader, look up that chapter in the `make.i1' file with any text
reader, look up that chapter in the 'make.i1' file with any text
browser/editor.
@@ -324,8 +324,7 @@ Bug reports:
-------------------------------------------------------------------------------
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 1996-2012 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

View File

@@ -140,7 +140,7 @@ to do this but the testsuite ignores the environment. -DNO_CHDIR2 causes
make not to use drive letters for directory names (i.e. _chdir2() and
_getcwd2() are NOT used). The testsuite interpretes the whole output of
make, especially statements like make[1]: Entering directory
`C:/somewhere/make-3.79.1/tests' where the testsuite does not expect the
'C:/somewhere/make-3.79.1/tests' where the testsuite does not expect the
drive letter. This would be interpreted as an error even if there is
none.
@@ -160,8 +160,7 @@ from the make source tree.
-------------------------------------------------------------------------------
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
Foundation, Inc.
Copyright (C) 2003-2012 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

View File

@@ -1,4 +1,5 @@
This version of GNU make has been tested on Microsoft Windows 2000/XP/2003.
This version of GNU make has been tested on
Microsoft Windows 2000/XP/2003/Vista/7/2008.
It has also been used on Windows 95/98/NT, and on OS/2.
It builds with the MinGW port of GCC (tested with GCC 3.4.2).
@@ -6,6 +7,23 @@ It builds with the MinGW port of GCC (tested with GCC 3.4.2).
It also builds with MSVC 2.x, 4.x, 5.x, 6.x, and 2003 as well as
with .NET 7.x and .NET 2003.
As of version 3.83, a build with Guile is supported (tested with Guile
2.0.3). To build with Guile, you will need, in addition to Guile
itself, its dependency libraries and the pkg-config program. The
latter is used to figure out which compilation and link switches and
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 the Windows download page of the GTK+ project:
http://www.gtk.org/download/win32.php
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
will be needed, and typically also GNU MP, libffi, libunistring, and
libtool's libltdl. Whoever built the port of Guile you have should
also provide you with these dependencies or a URL where to download
them.
The Windows 32-bit port of GNU make is maintained jointly by various
people. It was originally made by Rob Tulloh.
@@ -41,6 +59,12 @@ Building with (MinGW-)GCC using build_w32.bat
This produces gnumake.exe in the current directory.
The batch file will probe for Guile installation, and will build
gnumake.exe with Guile if it finds it. If you have Guile
installed, but want to build Make without Guile support, type
build_w32.bat --without-guile gcc
Building with (MSVC++-)cl using build_w32.bat or NMakefile
----------------------------------------------------------
@@ -61,6 +85,11 @@ Building with (MSVC++-)cl using build_w32.bat or NMakefile
(this produces WinDebug/make.exe and WinRel/make.exe).
The batch file will probe for Guile installation, and will build
gnumake.exe with Guile if it finds it. If you have Guile
installed, but want to build Make without Guile support, type
build_w32.bat --without-guile
-------------------
-- Notes/Caveats --
@@ -118,18 +147,10 @@ GNU make and brain-dead shells (BATCH_MODE_ONLY_SHELL):
Support for parallel builds
Parallel builds (-jN) are supported in this port, with 2
limitations:
- The number of concurrent processes has a hard limit of 64,
due to the way this port implements waiting for its
subprocesses;
- The job server method (available when Make runs on Posix
platforms) is not supported, which means you must pass an
explicit -jN switch to sub-Make's in a recursive Makefile.
If a sub-Make does not receive an explicit -jN switch, it
will default to -j1, i.e. no parallelism in sub-Make's.
Parallel builds (-jN) are supported in this port, with 1
limitation: The number of concurrent processes has a hard
limit of 64, due to the way this port implements waiting for
its subprocesses.
GNU make and Cygnus GNU Windows32 tools:
@@ -272,8 +293,7 @@ Bug reports:
is described in the GNU make manual and the base README.
-------------------------------------------------------------------------------
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 1996-2012 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

View File

@@ -35,19 +35,19 @@ you'll need to re-apply them by hand.
Install the Customs library and header files according to the
documentation. You should also install the man pages (contrary to
comments in the documentation, they weren't installed automatically for
me; I had to cd to the ``pmake-2.1.33/doc'' directory and run ``pmake
install'' there directly).
me; I had to cd to the 'pmake-2.1.33/doc' directory and run 'pmake
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.
Provide the directory containing the ``lib'' and ``include/customs''
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.
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
the INSTALL file.
@@ -96,8 +96,7 @@ SunOS 4.1.x:
-------------------------------------------------------------------------------
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
2009, 2010 Free Software Foundation, Inc.
Copyright (C) 1998-2012 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

View File

@@ -1,8 +1,8 @@
-*-text-*-
-------------------------------------------------------------------------------
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
Software Foundation, Inc. This file is part of GNU Make.
Copyright (C) 2002-2012 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

View File

@@ -8,20 +8,22 @@ your operating system.
For general building and installation instructions, see the file 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
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 whatever else.
use for './make install', or whatever else.
Some systems' Make programs are broken and 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.
Make, try using 'build.sh' instead.
GNU Make is free software. See the file COPYING for copying conditions.
GNU Make is copyright by the Free Software Foundation. Copyright notices
condense sequential years into a range; e.g. "1987-1994" means all years
from 1987 to 1994 inclusive.
Downloading
-----------
@@ -64,7 +66,7 @@ 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
section of the GNU make manual entitled 'Problems and Bugs' for
information on submitting useful and complete bug reports.
You can also use the online bug tracking system in the Savannah GNU Make
@@ -79,17 +81,6 @@ If you need help using GNU make, try these forums:
news:gnu.utils.help
news:gnu.utils.bug
http://savannah.gnu.org/support/?group=make
You may also find interesting patches to GNU Make available here:
http://savannah.gnu.org/patch/?group=make
Note these patches are provided by our users as a service and we make no
statements regarding their correctness. Please contact the authors
directly if you have a problem or suggestion for a patch available on
this page.
CVS Access
----------
@@ -112,8 +103,8 @@ System-specific Notes
---------------------
It has been reported that the XLC 1.2 compiler on AIX 3.2 is buggy such
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.
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
@@ -123,15 +114,15 @@ information:
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
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.)
Another potential source of porting problems is the support for large
files (LFS) in configure for those operating systems that provide it.
Please report any bugs that you find in this area. If you run into
difficulties, then as a workaround you should be able to disable LFS by
adding the `--disable-largefile' option to the `configure' script.
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
@@ -171,9 +162,7 @@ at the right README!
-------------------------------------------------------------------------------
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
Copyright (C) 1988-2012 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

View File

@@ -3,8 +3,7 @@
# NOTE: If you have no 'make' program at all to process this makefile,
# run 'build.sh' instead.
#
# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
# Copyright (C) 1995-2012 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
@@ -26,7 +25,7 @@
# Ultrix 2.2 make doesn't expand the value of VPATH.
VPATH = /make-%VERSION%/
# This must repeat the value, because configure will remove `VPATH = .'.
# This must repeat the value, because configure will remove 'VPATH = .'.
srcdir = /make-%VERSION%/
CC = sc
@@ -38,18 +37,18 @@ CPPFLAGS =
LDFLAGS =
# Define these for your system as follows:
# -DNO_ARCHIVES To disable `ar' archive support.
# -DNO_ARCHIVES To disable 'ar' archive support.
# -DNO_FLOAT To avoid using floating-point numbers.
# -DENUM_BITFIELDS If the compiler isn't GCC but groks enum foo:2.
# Some compilers apparently accept this
# without complaint but produce losing code,
# so beware.
# NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
# See also `config.h'.
# See also 'config.h'.
defines =
# Which flavor of remote job execution support to use.
# The code is found in `remote-$(REMOTE).c'.
# The code is found in 'remote-$(REMOTE).c'.
REMOTE = stub
# If you are using the GNU C library, or have the GNU getopt functions in
@@ -83,9 +82,9 @@ prefix =
# Common prefix for machine-dependent installed files.
exec_prefix =
# Directory to install `make' in.
# Directory to install 'make' in.
bindir = sc:c
# Directory to find libraries in for `-lXXX'.
# Directory to find libraries in for '-lXXX'.
libdir = lib:
# Directory to search by default for included makefiles.
includedir = include:
@@ -95,20 +94,20 @@ infodir = doc:
mandir = t:
# Number to put on the man page filename.
manext = 1
# Prefix to put on installed `make' binary file name.
# Prefix to put on installed 'make' binary file name.
binprefix =
# Prefix to put on installed `make' man page file name.
# Prefix to put on installed 'make' man page file name.
manprefix = $(binprefix)
# Whether or not make needs to be installed setgid.
# The value should be either `true' or `false'.
# On many systems, the getloadavg function (used to implement the `-l'
# The value should be either 'true' or 'false'.
# On many systems, the getloadavg function (used to implement the '-l'
# switch) will not work unless make is installed setgid kmem.
install_setgid = false
# Install make setgid to this group so it can read /dev/kmem.
group = sys
# Program to install `make'.
# Program to install 'make'.
INSTALL_PROGRAM = copy
# Program to install the man page.
INSTALL_DATA = copy
@@ -124,19 +123,22 @@ TEXI2DVI = texi2dvi
ETAGS = etags -w
CTAGS = ctags -w
objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
rule.o implicit.o default.o variable.o expand.o function.o \
vpath.o version.o ar.o arscan.o signame.o strcache.o hash.o \
remote-$(REMOTE).o $(GLOB) $(GETOPT) $(ALLOCA) $(extras)
#guile = guile.o
objs = commands.o job.o dir.o file.o misc.o main.o read.o remake.o \
rule.o implicit.o default.o variable.o expand.o function.o \
vpath.o version.o ar.o arscan.o signame.o strcache.o hash.o \
remote-$(REMOTE).o $(GLOB) $(GETOPT) $(ALLOCA) $(extras) $(guile)
srcs = $(srcdir)commands.c $(srcdir)job.c $(srcdir)dir.c \
$(srcdir)file.c $(srcdir)getloadavg.c $(srcdir)misc.c \
$(srcdir)main.c $(srcdir)read.c $(srcdir)remake.c \
$(srcdir)rule.c $(srcdir)implicit.c $(srcdir)default.c \
$(srcdir)variable.c $(srcdir)expand.c $(srcdir)function.c \
$(srcdir)vpath.c $(srcdir)version.c $(srcdir)hash.c \
$(srcdir)remote-$(REMOTE).c \
$(srcdir)ar.c $(srcdir)arscan.c $(srcdir)strcache.c \
$(srcdir)signame.c $(srcdir)signame.h $(GETOPT_SRC) \
$(srcdir)guile.c $(srcdir)remote-$(REMOTE).c \
$(srcdir)ar.c $(srcdir)arscan.c $(srcdir)strcache.c \
$(srcdir)signame.c $(srcdir)signame.h $(GETOPT_SRC) \
$(srcdir)commands.h $(srcdir)dep.h $(srcdir)file.h \
$(srcdir)job.h $(srcdir)make.h $(srcdir)rule.h \
$(srcdir)variable.h $(ALLOCA_SRC) $(srcdir)config.h.in
@@ -148,7 +150,7 @@ srcs = $(srcdir)commands.c $(srcdir)job.c $(srcdir)dir.c \
all: make
info: make.info
dvi: make.dvi
# Some makes apparently use .PHONY as the default goal if it is before `all'.
# Some makes apparently use .PHONY as the default goal if it is before 'all'.
.PHONY: all check info dvi
make.info: make.texinfo

View File

@@ -125,8 +125,7 @@ The Rest of the List
-------------------------------------------------------------------------------
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 1997-2012 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

View File

@@ -1,8 +1,7 @@
dnl acinclude.m4 -- Extra macros needed for GNU make.
dnl
dnl Automake will incorporate this into its generated aclocal.m4.
dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
dnl 2008, 2009, 2010 Free Software Foundation, Inc.
dnl Copyright (C) 1998-2012 Free Software Foundation, Inc.
dnl This file is part of GNU Make.
dnl
dnl GNU Make is free software; you can redistribute it and/or modify it under
@@ -100,22 +99,26 @@ changequote([,])dnl
dnl ---------------------------------------------------------------------------
dnl From Paul Eggert <eggert@twinsun.com>
dnl Update for Darwin by Troy Runkel <Troy.Runkel@mathworks.com>
dnl Update for AIX by Olexiy Buyanskyy (Savannah bug 32485)
AC_DEFUN([AC_STRUCT_ST_MTIM_NSEC],
[AC_CACHE_CHECK([for nanoseconds field of struct stat.st_mtim],
[AC_CACHE_CHECK([for nanoseconds field of struct stat],
ac_cv_struct_st_mtim_nsec,
[ac_save_CPPFLAGS="$CPPFLAGS"
ac_cv_struct_st_mtim_nsec=no
# tv_nsec -- the usual case
# _tv_nsec -- Solaris 2.6, if
# st_mtim.tv_nsec -- the usual case
# st_mtim._tv_nsec -- Solaris 2.6, if
# (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
# && !defined __EXTENSIONS__)
# st__tim.tv_nsec -- UnixWare 2.1.2
for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do
# st_mtim.st__tim.tv_nsec -- UnixWare 2.1.2
# st_mtime_n -- AIX 5.2 and above
# st_mtimespec.tv_nsec -- Darwin (Mac OSX)
for ac_val in st_mtim.tv_nsec st_mtim._tv_nsec st_mtim.st__tim.tv_nsec st_mtime_n st_mtimespec.tv_nsec; do
CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/stat.h>
], [struct stat s; s.st_mtim.ST_MTIM_NSEC;],
], [struct stat s; s.ST_MTIM_NSEC;],
[ac_cv_struct_st_mtim_nsec=$ac_val; break])
done
CPPFLAGS="$ac_save_CPPFLAGS"

View File

@@ -116,7 +116,7 @@ static int stack_dir; /* 1 or -1 once known. */
static void
find_stack_direction (void)
{
static char *addr = NULL; /* Address of first `dummy', once known. */
static char *addr = NULL; /* Address of first 'dummy', once known. */
auto char dummy; /* To get stack address. */
if (addr == NULL)

View File

@@ -1,6 +1,5 @@
/* Running commands on Amiga
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 1995-2012 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

View File

@@ -1,6 +1,5 @@
/* Definitions for amiga specific things
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the

26
ar.c
View File

@@ -1,7 +1,5 @@
/* Interface to `ar' archives for GNU Make.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
/* Interface to 'ar' archives for GNU Make.
Copyright (C) 1988-2012 Free Software Foundation, Inc.
This file is part of GNU Make.
@@ -26,9 +24,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include <fnmatch.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
archive-member reference is a name like 'lib(member)' where member is a
non-empty string.
If a name like `lib((entry))' is used, a fatal error is signaled at
If a name like 'lib((entry))' is used, a fatal error is signaled at
the attempt to use this unsupported feature. */
int
@@ -45,7 +43,7 @@ ar_name (const char *name)
return 0;
if (p[1] == '(' && end[-1] == ')')
fatal (NILF, _("attempt to use unsupported feature: `%s'"), name);
fatal (NILF, _("attempt to use unsupported feature: '%s'"), name);
return 1;
}
@@ -68,7 +66,7 @@ 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. */
/* This function is called by 'ar_scan' to find which member to look at. */
/* ARGSUSED */
static long int
@@ -146,24 +144,24 @@ ar_touch (const char *name)
switch (ar_member_touch (arname, memname))
{
case -1:
error (NILF, _("touch: Archive `%s' does not exist"), arname);
error (NILF, _("touch: Archive '%s' does not exist"), arname);
break;
case -2:
error (NILF, _("touch: `%s' is not a valid archive"), arname);
error (NILF, _("touch: '%s' is not a valid archive"), arname);
break;
case -3:
perror_with_name ("touch: ", arname);
break;
case 1:
error (NILF,
_("touch: Member `%s' does not exist in `%s'"), memname, arname);
_("touch: Member '%s' does not exist in '%s'"), memname, arname);
break;
case 0:
val = 0;
break;
default:
error (NILF,
_("touch: Bad return code from ar_member_touch on `%s'"), name);
_("touch: Bad return code from ar_member_touch on '%s'"), name);
}
free (arname);
@@ -172,7 +170,7 @@ ar_touch (const char *name)
}
#endif /* !VMS */
/* State of an `ar_glob' run, passed to `ar_glob_match'. */
/* State of an 'ar_glob' run, passed to 'ar_glob_match'. */
struct ar_glob_state
{
@@ -183,7 +181,7 @@ struct ar_glob_state
unsigned int n;
};
/* This function is called by `ar_scan' to match one archive
/* This function is called by 'ar_scan' to match one archive
element against the pattern in STATE. */
static long int

View File

@@ -1,7 +1,5 @@
/* Library function for scanning an archive file.
Copyright (C) 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
Copyright (C) 1987-2012 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
@@ -184,7 +182,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
if (! (status & 1))
{
error (NILF, _("unable to open library `%s' to lookup member `%s'"),
error (NILF, _("unable to open library '%s' to lookup member '%s'"),
archive, (char *)arg);
return -1;
}
@@ -847,7 +845,7 @@ describe_member (int desc, const char *name, int truncated,
{
extern char *ctime ();
printf (_("Member `%s'%s: %ld bytes at %ld (%ld).\n"),
printf (_("Member '%s'%s: %ld bytes at %ld (%ld).\n"),
name, truncated ? _(" (name might be truncated)") : "",
size, hdrpos, datapos);
printf (_(" Date %s"), ctime (&date));

View File

@@ -1,9 +1,8 @@
#!/bin/sh
# Shell script to build GNU Make in the absence of any `make' program.
# Shell script to build GNU Make in the absence of any 'make' program.
# @configure_input@
# Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
# Copyright (C) 1993-2012 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
@@ -39,7 +38,7 @@ EXEEXT='@EXEEXT@'
prefix='@prefix@'
# Common prefix for machine-dependent installed files.
exec_prefix=`eval echo @exec_prefix@`
# Directory to find libraries in for `-lXXX'.
# Directory to find libraries in for '-lXXX'.
libdir=${exec_prefix}/lib
# Directory to search by default for included makefiles.
includedir=${prefix}/include

View File

@@ -1,6 +1,5 @@
@echo off
rem Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
rem 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
rem Copyright (C) 1996-2012 Free Software Foundation, Inc.
rem This file is part of GNU Make.
rem
rem GNU Make is free software; you can redistribute it and/or modify it under
@@ -22,6 +21,41 @@ echo s,%%PACKAGE%%,make,g >> config.h.W32.sed
sed -f config.h.W32.sed config.h.W32.template > config.h.W32
:NotCVS
if not exist config.h copy config.h.W32 config.h
rem Guile configuration
set GUILECFLAGS=
set GUILELIBS=
set GUILESRC=
set PKGMSC=
if "%1" == "--without-guile" GoTo NoGuile
if "%2" == "--without-guile" GoTo NoGuile
rem Build with Guile is supported only on NT and later versions
if not "%OS%" == "Windows_NT" GoTo NoGuile
pkg-config --help > guile.tmp 2> NUL
if ERRORLEVEL 1 GoTo NoPkgCfg
echo "Checking for Guile 2.0"
if not "%1" == "gcc" set PKGMSC=--msvc-syntax
pkg-config --cflags --short-errors "guile-2.0" > guile.tmp
if not ERRORLEVEL 1 set /P GUILECFLAGS= < guile.tmp
pkg-config --libs --static --short-errors %PKGMSC% "guile-2.0" > guile.tmp
if not ERRORLEVEL 1 set /P GUILELIBS= < guile.tmp
if not "%GUILECFLAGS%" == "" GoTo GuileDone
echo "Checking for Guile 1.8"
pkg-config --cflags --short-errors "guile-1.8" > guile.tmp
if not ERRORLEVEL 1 set /P GUILECFLAGS= < guile.tmp
pkg-config --libs --static --short-errors %PKGMSC% "guile-1.8" > guile.tmp
if not ERRORLEVEL 1 set /P GUILELIBS= < guile.tmp
if not "%GUILECFLAGS%" == "" GoTo GuileDone
echo "No Guile found, building without Guile"
GoTo NoGuile
:NoPkgCfg
echo "pkg-config not found, building without Guile"
:NoGuile
:GuileDone
if not "%GUILECFLAGS%" == "" echo "Guile found, building with Guile"
if not "%GUILECFLAGS%" == "" set GUILESRC=guile.c
if not "%GUILECFLAGS%" == "" set GUILECFLAGS=%GUILECFLAGS% -DHAVE_GUILE
if "%1" == "--without-guile" shift
cd w32\subproc
echo "Creating the subproc library"
%ComSpec% /c build.bat %1
@@ -54,7 +88,7 @@ cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D
echo WinDebug\expand.obj >>link.dbg
cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c dir.c
echo WinDebug\dir.obj >>link.dbg
cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c main.c
cl.exe /nologo /MT /W4 /GX /Zi /YX /Od %GUILECFLAGS% /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c main.c
echo WinDebug\main.obj >>link.dbg
cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c getopt1.c
echo WinDebug\getopt1.obj >>link.dbg
@@ -92,10 +126,14 @@ cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D
echo WinDebug\fnmatch.obj >>link.dbg
cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c .\w32\pathstuff.c
echo WinDebug\pathstuff.obj >>link.dbg
if "%GUILESRC%" == "" GoTo LinkDbg
cl.exe /nologo /MT /W4 /GX /Zi /YX /Od %GUILECFLAGS%% /I . /I glob /I w32/include /D _DEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinDebug/ /Fp.\WinDebug/%make%.pch /Fo.\WinDebug/ /Fd.\WinDebug/%make%.pdb /c guile.c
echo WinDebug\guile.obj >>link.dbg
:LinkDbg
echo off
echo "Linking WinDebug/%make%.exe"
rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/%make%.pdb /DEBUG /OUT:.\WinDebug/%make%.exe .\WinDebug/variable.obj .\WinDebug/rule.obj .\WinDebug/remote-stub.obj .\WinDebug/commands.obj .\WinDebug/file.obj .\WinDebug/getloadavg.obj .\WinDebug/default.obj .\WinDebug/signame.obj .\WinDebug/expand.obj .\WinDebug/dir.obj .\WinDebug/main.obj .\WinDebug/getopt1.obj .\WinDebug/job.obj .\WinDebug/read.obj .\WinDebug/version.obj .\WinDebug/getopt.obj .\WinDebug/arscan.obj .\WinDebug/remake.obj .\WinDebug/hash.obj .\WinDebug/strcache.obj .\WinDebug/misc.obj .\WinDebug/ar.obj .\WinDebug/function.obj .\WinDebug/vpath.obj .\WinDebug/implicit.obj .\WinDebug/dirent.obj .\WinDebug/glob.obj .\WinDebug/fnmatch.obj .\WinDebug/pathstuff.obj
echo kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib >>link.dbg
rem link.exe %GUILELIBS% kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/%make%.pdb /DEBUG /OUT:.\WinDebug/%make%.exe .\WinDebug/variable.obj .\WinDebug/rule.obj .\WinDebug/remote-stub.obj .\WinDebug/commands.obj .\WinDebug/file.obj .\WinDebug/getloadavg.obj .\WinDebug/default.obj .\WinDebug/signame.obj .\WinDebug/expand.obj .\WinDebug/dir.obj .\WinDebug/main.obj .\WinDebug/getopt1.obj .\WinDebug/job.obj .\WinDebug/read.obj .\WinDebug/version.obj .\WinDebug/getopt.obj .\WinDebug/arscan.obj .\WinDebug/remake.obj .\WinDebug/hash.obj .\WinDebug/strcache.obj .\WinDebug/misc.obj .\WinDebug/ar.obj .\WinDebug/function.obj .\WinDebug/vpath.obj .\WinDebug/implicit.obj .\WinDebug/dirent.obj .\WinDebug/glob.obj .\WinDebug/fnmatch.obj .\WinDebug/pathstuff.obj
echo %GUILELIBS% kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\windebug\subproc.lib >>link.dbg
link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/%make%.pdb /DEBUG /OUT:.\WinDebug/%make%.exe @link.dbg
if not exist .\WinDebug/%make%.exe echo "WinDebug build failed"
if exist .\WinDebug/%make%.exe echo "WinDebug build succeeded!"
@@ -121,7 +159,7 @@ cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIND
echo WinRel\expand.obj >>link.rel
cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c dir.c
echo WinRel\dir.obj >>link.rel
cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c main.c
cl.exe /nologo /MT /W4 /GX /YX /O2 %GUILECFLAGS% /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c main.c
echo WinRel\main.obj >>link.rel
cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c getopt1.c
echo WinRel\getopt1.obj >>link.rel
@@ -159,10 +197,14 @@ cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIND
echo WinRel\fnmatch.obj >>link.rel
cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c .\w32\pathstuff.c
echo WinRel\pathstuff.obj >>link.rel
if "%GUILESRC%" == "" GoTo LinkRel
cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR.\WinRel/ /Fp.\WinRel/%make%.pch /Fo.\WinRel/ /c guile.c
echo WinRel\guile.obj >>link.rel
:LinkRel
echo off
echo "Linking WinRel/%make%.exe"
rem link.exe kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/%make%.pdb /OUT:.\WinRel/%make%.exe .\WinRel/variable.obj .\WinRel/rule.obj .\WinRel/remote-stub.obj .\WinRel/commands.obj .\WinRel/file.obj .\WinRel/getloadavg.obj .\WinRel/default.obj .\WinRel/signame.obj .\WinRel/expand.obj .\WinRel/dir.obj .\WinRel/main.obj .\WinRel/getopt1.obj .\WinRel/job.obj .\WinRel/read.obj .\WinRel/version.obj .\WinRel/getopt.obj .\WinRel/arscan.obj .\WinRel/remake.obj .\WinRel/misc.obj .\WinRel/hash.obj .\WinRel/strcache.obj .\WinRel/ar.obj .\WinRel/function.obj .\WinRel/vpath.obj .\WinRel/implicit.obj .\WinRel/dirent.obj .\WinRel/glob.obj .\WinRel/fnmatch.obj .\WinRel/pathstuff.obj
echo kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib >>link.rel
rem link.exe %GUILELIBS% kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/%make%.pdb /OUT:.\WinRel/%make%.exe .\WinRel/variable.obj .\WinRel/rule.obj .\WinRel/remote-stub.obj .\WinRel/commands.obj .\WinRel/file.obj .\WinRel/getloadavg.obj .\WinRel/default.obj .\WinRel/signame.obj .\WinRel/expand.obj .\WinRel/dir.obj .\WinRel/main.obj .\WinRel/getopt1.obj .\WinRel/job.obj .\WinRel/read.obj .\WinRel/version.obj .\WinRel/getopt.obj .\WinRel/arscan.obj .\WinRel/remake.obj .\WinRel/misc.obj .\WinRel/hash.obj .\WinRel/strcache.obj .\WinRel/ar.obj .\WinRel/function.obj .\WinRel/vpath.obj .\WinRel/implicit.obj .\WinRel/dirent.obj .\WinRel/glob.obj .\WinRel/fnmatch.obj .\WinRel/pathstuff.obj
echo %GUILELIBS% kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib w32\subproc\winrel\subproc.lib >>link.rel
link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/%make%.pdb /OUT:.\WinRel/%make%.exe @link.rel
if not exist .\WinRel/%make%.exe echo "WinRel build failed"
if exist .\WinRel/%make%.exe echo "WinRel build succeeded!"
@@ -180,7 +222,7 @@ gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c signame.c
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c expand.c
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c dir.c
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c main.c
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H %GUILECFLAGS% -c main.c
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c getopt1.c
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c job.c
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c read.c
@@ -198,6 +240,20 @@ gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./glob/glob.c -o glob.o
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./glob/fnmatch.c -o fnmatch.o
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./w32/pathstuff.c -o pathstuff.o
gcc -mthreads -gdwarf-2 -g3 -o gnumake.exe variable.o rule.o remote-stub.o commands.o file.o getloadavg.o default.o signame.o expand.o dir.o main.o getopt1.o job.o read.o version.o getopt.o arscan.o remake.o misc.o hash.o strcache.o ar.o function.o vpath.o implicit.o glob.o fnmatch.o pathstuff.o w32_misc.o sub_proc.o w32err.o -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32
:BuildEnd
@echo off
set GUILEOBJ=
if "%GUILESRC%" == "" GoTo LinkGCC
set GUILEOBJ=guile.o
echo on
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 %GUILECFLAGS% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c guile.c
:LinkGCC
@echo on
gcc -mthreads -gdwarf-2 -g3 -o gnumake.exe variable.o rule.o remote-stub.o commands.o file.o getloadavg.o default.o signame.o expand.o dir.o main.o getopt1.o %GUILEOBJ% job.o read.o version.o getopt.o arscan.o remake.o misc.o hash.o strcache.o ar.o function.o vpath.o implicit.o glob.o fnmatch.o pathstuff.o w32_misc.o sub_proc.o w32err.o %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32
:BuildEnd
@echo off
set GUILEOBJ=
set GUILESRC=
set GUILELIBS=
set GUILECFLAGS=
set PKGMSC=
echo on

View File

@@ -1,7 +1,5 @@
/* Command processing for GNU Make.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
Copyright (C) 1988-2012 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
@@ -71,8 +69,8 @@ set_file_variables (struct file *file)
const char *at, *percent, *star, *less;
#ifndef NO_ARCHIVES
/* If the target is an archive member `lib(member)',
then $@ is `lib' and $% is `member'. */
/* If the target is an archive member 'lib(member)',
then $@ is 'lib' and $% is 'member'. */
if (ar_name (file->name))
{
@@ -103,7 +101,7 @@ set_file_variables (struct file *file)
{
/* In Unix make, $* is set to the target name with
any suffix in the .SUFFIXES list stripped off for
explicit rules. We store this in the `stem' member. */
explicit rules. We store this in the 'stem' member. */
const char *name;
unsigned int len;
@@ -325,7 +323,7 @@ set_file_variables (struct file *file)
}
/* Chop CMDS up into individual command lines if necessary.
Also set the `lines_flags' and `any_recurse' members. */
Also set the 'lines_flags' and 'any_recurse' members. */
void
chop_commands (struct commands *cmds)
@@ -402,6 +400,9 @@ chop_commands (struct commands *cmds)
/* Finally, set the corresponding CMDS->lines_flags elements and the
CMDS->any_recurse flag. */
if (nlines > USHRT_MAX)
fatal (&cmds->fileinfo, _("Recipe has too many lines (%ud)"), nlines);
cmds->ncommand_lines = nlines;
cmds->command_lines = lines;
@@ -433,7 +434,7 @@ chop_commands (struct commands *cmds)
flags |= COMMANDS_RECURSE;
cmds->lines_flags[idx] = flags;
cmds->any_recurse |= flags & COMMANDS_RECURSE;
cmds->any_recurse |= flags & COMMANDS_RECURSE ? 1 : 0;
}
}
@@ -619,10 +620,10 @@ delete_target (struct file *file, const char *on_behalf_of)
if (ar_member_date (file->name) != file_date)
{
if (on_behalf_of)
error (NILF, _("*** [%s] Archive member `%s' may be bogus; not deleted"),
error (NILF, _("*** [%s] Archive member '%s' may be bogus; not deleted"),
on_behalf_of, file->name);
else
error (NILF, _("*** Archive member `%s' may be bogus; not deleted"),
error (NILF, _("*** Archive member '%s' may be bogus; not deleted"),
file->name);
}
return;
@@ -635,9 +636,9 @@ delete_target (struct file *file, const char *on_behalf_of)
&& FILE_TIMESTAMP_STAT_MODTIME (file->name, st) != file->last_mtime)
{
if (on_behalf_of)
error (NILF, _("*** [%s] Deleting file `%s'"), on_behalf_of, file->name);
error (NILF, _("*** [%s] Deleting file '%s'"), on_behalf_of, file->name);
else
error (NILF, _("*** Deleting file `%s'"), file->name);
error (NILF, _("*** Deleting file '%s'"), file->name);
if (unlink (file->name) < 0
&& errno != ENOENT) /* It disappeared; so what. */
perror_with_name ("unlink: ", file->name);
@@ -659,7 +660,7 @@ delete_child_targets (struct child *child)
/* Delete the target file if it changed. */
delete_target (child->file, NULL);
/* Also remove any non-precious targets listed in the `also_make' member. */
/* Also remove any non-precious targets listed in the 'also_make' member. */
for (d = child->file->also_make; d != 0; d = d->next)
delete_target (d->file, child->file->name);
@@ -678,17 +679,23 @@ print_commands (const struct commands *cmds)
if (cmds->fileinfo.filenm == 0)
puts (_(" (built-in):"));
else
printf (_(" (from `%s', line %lu):\n"),
printf (_(" (from '%s', line %lu):\n"),
cmds->fileinfo.filenm, cmds->fileinfo.lineno);
s = cmds->commands;
while (*s != '\0')
{
const char *end;
int bs;
end = strchr (s, '\n');
if (end == 0)
end = s + strlen (s);
/* Print one full logical recipe line: find a non-escaped newline. */
for (end = s, bs = 0; *end != '\0'; ++end)
{
if (*end == '\n' && !bs)
break;
bs = *end == '\\' ? !bs : 0;
}
printf ("%c%.*s\n", cmd_prefix, (int) (end - s), s);

View File

@@ -1,7 +1,5 @@
/* Definition of data structures describing shell commands for GNU Make.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
Copyright (C) 1988-2012 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
@@ -23,14 +21,15 @@ struct commands
{
struct floc fileinfo; /* Where commands were defined. */
char *commands; /* Commands text. */
unsigned int ncommand_lines;/* Number of command lines. */
char **command_lines; /* Commands chopped up into lines. */
char *lines_flags; /* One set of flag bits for each line. */
int any_recurse; /* Nonzero if any `lines_recurse' elt has */
unsigned short ncommand_lines;/* Number of command lines. */
char recipe_prefix; /* Recipe prefix for this command set. */
unsigned int any_recurse:1; /* Nonzero if any 'lines_flags' elt has */
/* the COMMANDS_RECURSE bit set. */
};
/* Bits in `lines_flags'. */
/* Bits in 'lines_flags'. */
#define COMMANDS_RECURSE 1 /* Recurses: + or $(MAKE). */
#define COMMANDS_SILENT 2 /* Silent: @. */
#define COMMANDS_NOERROR 4 /* No errors: -. */

View File

@@ -1,6 +1,5 @@
/* config.h -- hand-massaged for Amiga -*-C-*-
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 1995-2012 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -38,14 +37,14 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define for DGUX with <sys/dg_sys_info.h>. */
/* #undef DGUX */
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
/* Define if the 'getloadavg' function needs to be run setuid or setgid. */
/* #undef GETLOADAVG_PRIVILEGED */
/* Define to `unsigned long' or `unsigned long long'
/* Define to 'unsigned long' or 'unsigned long long'
if <inttypes.h> doesn't define. */
#define uintmax_t unsigned long
/* Define to `int' if <sys/types.h> doesn't define. */
/* Define to 'int' if <sys/types.h> doesn't define. */
#define gid_t int
/* Define if you have alloca, as a function or macro. */
@@ -60,19 +59,22 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define if your system has a working fnmatch function. */
/* #undef HAVE_FNMATCH */
/* Define if your system has its own `getloadavg' function. */
/* Define if your system has its own 'getloadavg' function. */
/* #undef HAVE_GETLOADAVG */
/* Define if you have the getmntent function. */
/* #undef HAVE_GETMNTENT */
/* Define if the `long double' type works. */
/* Embed GNU Guile support */
/* #undef HAVE_GUILE */
/* Define if the 'long double' type works. */
/* #undef HAVE_LONG_DOUBLE */
/* Define if you support file names longer than 14 characters. */
#define HAVE_LONG_FILE_NAMES 1
/* Define if you have a working `mmap' system call. */
/* Define if you have a working 'mmap' system call. */
/* #undef HAVE_MMAP */
/* Define if system calls automatically restart after interruption
@@ -131,7 +133,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define if your C compiler doesn't accept -c and -o together. */
/* #undef NO_MINUS_C_MINUS_O */
/* Define to `int' if <sys/types.h> doesn't define. */
/* Define to 'int' if <sys/types.h> doesn't define. */
#define pid_t int
/* Define if the system does not provide POSIX.1 features except
@@ -158,7 +160,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
*/
#define STACK_DIRECTION -1
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
/* Define if the 'S_IS*' macros in <sys/stat.h> do not work properly. */
/* #undef STAT_MACROS_BROKEN */
/* Define if your compiler conforms to the ANSI C standard. */
@@ -170,10 +172,10 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define on System V Release 4. */
/* #undef SVR4 */
/* Define if `sys_siglist' is declared by <signal.h>. */
/* Define if 'sys_siglist' is declared by <signal.h>. */
/* #undef SYS_SIGLIST_DECLARED */
/* Define to `int' if <sys/types.h> doesn't define. */
/* Define to 'int' if <sys/types.h> doesn't define. */
#define uid_t int
/* Define for Encore UMAX. */
@@ -192,10 +194,10 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Version of this package (needed by automake) */
#define VERSION "%VERSION%"
/* Define to the name of the SCCS `get' command. */
/* Define to the name of the SCCS 'get' command. */
#define SCCS_GET "get"
/* Define this if the SCCS `get' command understands the `-G<file>' option. */
/* Define this if the SCCS 'get' command understands the '-G<file>' option. */
/* #undef SCCS_GET_MINUS_G */
/* Define this to enable job server support in GNU make. */
@@ -205,13 +207,13 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
if it exists. */
/* #undef ST_MTIM_NSEC */
/* Define this if the C library defines the variable `sys_siglist'. */
/* Define this if the C library defines the variable 'sys_siglist'. */
/* #undef HAVE_SYS_SIGLIST */
/* Define this if the C library defines the variable `_sys_siglist'. */
/* Define this if the C library defines the variable '_sys_siglist'. */
/* #undef HAVE__SYS_SIGLIST */
/* Define this if you have the `union wait' type in <sys/wait.h>. */
/* Define this if you have the 'union wait' type in <sys/wait.h>. */
/* #undef HAVE_UNION_WAIT */
/* Define if you have the dup2 function. */

View File

@@ -1,7 +1,6 @@
/* config.h-vms. Generated by hand by Klaus Kämpf <kkaempf@rmi.de> -*-C-*-
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 1996-2012 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
@@ -35,6 +34,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
/* #undef HAVE_GETTEXT */
/* Embed GNU Guile support */
/* #undef HAVE_GUILE */
/* Define to 1 if your locale.h file contains LC_MESSAGES. */
/* #undef HAVE_LC_MESSAGES */
@@ -57,14 +59,14 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define for DGUX with <sys/dg_sys_info.h>. */
/* #undef DGUX */
/* Define to 1 if the `getloadavg' function needs to be run setuid or setgid. */
/* Define to 1 if the 'getloadavg' function needs to be run setuid or setgid. */
/* #undef GETLOADAVG_PRIVILEGED */
/* Define to `unsigned long' or `unsigned long long'
/* Define to 'unsigned long' or 'unsigned long long'
if <inttypes.h> doesn't define. */
#define uintmax_t unsigned long
/* Define to `int' if <sys/types.h> doesn't define. */
/* Define to 'int' if <sys/types.h> doesn't define. */
/* #undef gid_t */
/* Define to 1 if you have alloca, as a function or macro. */
@@ -82,19 +84,19 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if your system has a working fnmatch function. */
/* #undef HAVE_FNMATCH */
/* Define to 1 if your system has its own `getloadavg' function. */
/* Define to 1 if your system has its own 'getloadavg' function. */
/* #undef HAVE_GETLOADAVG */
/* Define to 1 if you have the getmntent function. */
/* #undef HAVE_GETMNTENT */
/* Define to 1 if the `long double' type works. */
/* Define to 1 if the 'long double' type works. */
/* #undef HAVE_LONG_DOUBLE */
/* Define to 1 if you support file names longer than 14 characters. */
#define HAVE_LONG_FILE_NAMES 1
/* Define to 1 if you have a working `mmap' system call. */
/* Define to 1 if you have a working 'mmap' system call. */
/* #undef HAVE_MMAP */
/* Define to 1 if system calls automatically restart after interruption
@@ -110,6 +112,11 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the strcoll function and it is properly defined. */
/* #undef HAVE_STRCOLL */
/* Define to 1 if you have the strncasecmp' function. */
#if __CRTL_VER >= 70000000
#define HAVE_STRNCASECMP 1
#endif
/* Define to 1 if your struct stat has st_rdev. */
/* #undef HAVE_ST_RDEV */
@@ -155,7 +162,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
/* #undef NO_MINUS_C_MINUS_O */
/* Define to `int' if <sys/types.h> doesn't define. */
/* Define to 'int' if <sys/types.h> doesn't define. */
/* I assume types.h is available for all 5.0 cc/cxx compilers */
#if __DECC_VER < 50090000
#define pid_t int
@@ -185,7 +192,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
*/
/* #undef STACK_DIRECTION */
/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
/* Define to 1 if the 'S_IS*' macros in <sys/stat.h> do not work properly. */
/* #undef STAT_MACROS_BROKEN */
/* Define to 1 if you have the ANSI C header files. */
@@ -194,10 +201,10 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define on System V Release 4. */
/* #undef SVR4 */
/* Define to 1 if `sys_siglist' is declared by <signal.h>. */
/* Define to 1 if 'sys_siglist' is declared by <signal.h>. */
/* #undef SYS_SIGLIST_DECLARED */
/* Define to `int' if <sys/types.h> doesn't define. */
/* Define to 'int' if <sys/types.h> doesn't define. */
#if __DECC_VER < 50090000
#define uid_t int
#endif
@@ -218,10 +225,10 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Version of this package (needed by automake) */
#define VERSION "%VERSION%"
/* Define to the name of the SCCS `get' command. */
/* Define to the name of the SCCS 'get' command. */
/* #undef SCCS_GET */
/* Define this if the SCCS `get' command understands the `-G<file>' option. */
/* Define this if the SCCS 'get' command understands the '-G<file>' option. */
/* #undef SCCS_GET_MINUS_G */
/* Define this to enable job server support in GNU make. */
@@ -231,13 +238,13 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
if it exists. */
/* #undef ST_MTIM_NSEC */
/* Define to 1 if the C library defines the variable `sys_siglist'. */
/* Define to 1 if the C library defines the variable 'sys_siglist'. */
/* #undefine HAVE_SYS_SIGLIST */
/* Define to 1 if the C library defines the variable `_sys_siglist'. */
/* Define to 1 if the C library defines the variable '_sys_siglist'. */
/* #undef HAVE__SYS_SIGLIST */
/* Define to 1 if you have the `union wait' type in <sys/wait.h>. */
/* Define to 1 if you have the 'union wait' type in <sys/wait.h>. */
/* #undef HAVE_UNION_WAIT */
/* Define to 1 if you have the dup2 function. */
@@ -255,9 +262,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the gethostname function. */
/* #undef HAVE_GETHOSTNAME */
/* Define to 1 if you have the getloadavg function. */
/* #undef HAVE_GETLOADAVG */
/* Define to 1 if you have the memmove function. */
#define HAVE_MEMMOVE 1

View File

@@ -1,7 +1,6 @@
/* config.h.W32 -- hand-massaged config.h file for Windows builds -*-C-*-
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 1996-2012 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
@@ -28,19 +27,19 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
# define _CRT_NONSTDC_NO_WARNINGS /* functions w/o a leading underscore */
#endif
/* Define to 1 if the `closedir' function returns void instead of `int'. */
/* Define to 1 if the 'closedir' function returns void instead of 'int'. */
/* #undef CLOSEDIR_VOID */
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
systems. This function is required for `alloca.c' support on those systems.
/* Define to one of '_getb67', 'GETB67', 'getb67' for Cray-2 and Cray-YMP
systems. This function is required for 'alloca.c' support on those systems.
*/
/* #undef CRAY_STACKSEG_END */
/* Define to 1 if using `alloca.c'. */
/* Define to 1 if using 'alloca.c'. */
/* #undef C_ALLOCA */
/* Define to 1 if using `getloadavg.c'. */
/*#define C_GETLOADAVG 1*/
/* Define to 1 if using 'getloadavg.c'. */
#define C_GETLOADAVG 1
/* Define to 1 for DGUX with <sys/dg_sys_info.h>. */
/* #undef DGUX */
@@ -52,34 +51,54 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Use high resolution file timestamps if nonzero. */
#define FILE_TIMESTAMP_HI_RES 0
/* Define to 1 if the `getloadavg' function needs to be run setuid or setgid.
/* Define to 1 if the 'getloadavg' function needs to be run setuid or setgid.
*/
/* #undef GETLOADAVG_PRIVILEGED */
/* Define to 1 if you have `alloca', as a function or macro. */
/* Define to 1 if you have 'alloca', as a function or macro. */
#define HAVE_ALLOCA 1
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
*/
/* #undef HAVE_ALLOCA_H */
/* Define if your compiler conforms to the ANSI C standard. */
/* Define to 1 if your compiler conforms to the ANSI C standard. */
#define HAVE_ANSI_COMPILER 1
/* Define to 1 if you have the `bsd_signal' function. */
/* #undef HAVE_BSD_SIGNAL */
/* Define to 1 if you have the 'atexit' function. */
#define HAVE_ATEXIT 1
/* Use case insensitive file names */
/* #undef HAVE_CASE_INSENSITIVE_FS */
/* Define if you have the clock_gettime function. */
/* Define to 1 if you have the clock_gettime function. */
/* #undef HAVE_CLOCK_GETTIME */
/* Embed GNU Guile support. Windows build sets this on the
compilation command line. */
/* #undef HAVE_GUILE */
/* Define if the GNU dcgettext() function is already present or preinstalled.
*/
/* #undef HAVE_DCGETTEXT */
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
/* Define to 1 if you have the declaration of 'bsd_signal', and to 0 if you
don't. */
#define HAVE_DECL_BSD_SIGNAL 0
/* Define to 1 if you have the declaration of 'sys_siglist', and to 0 if you
don't. */
#define HAVE_DECL_SYS_SIGLIST 0
/* Define to 1 if you have the declaration of '_sys_siglist', and to 0 if you
don't. */
#define HAVE_DECL__SYS_SIGLIST 0
/* Define to 1 if you have the declaration of '__sys_siglist', and to 0 if you
don't. */
#define HAVE_DECL___SYS_SIGLIST 0
/* Define to 1 if you have the <dirent.h> header file, and it defines 'DIR'.
*/
#define HAVE_DIRENT_H 1
@@ -90,58 +109,67 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
# define HAVE_DIRECT_H 1
#endif
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
/* Define to 1 if you don't have 'vprintf' but do have '_doprnt.' */
/* #undef HAVE_DOPRNT */
/* Use platform specific coding */
#define HAVE_DOS_PATHS 1
/* Define to 1 if you have the `dup2' function. */
/* Define to 1 if you have the 'dup2' function. */
#define HAVE_DUP2 1
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have the `fdopen' function. */
/*#define HAVE_FDOPEN 1*/
/* Define to 1 if you have the 'fdopen' function. */
#ifdef __MINGW32__
#define HAVE_FDOPEN 1
#endif
/* Define to 1 if you have the `fork' function. */
/* Define to 1 if you have the 'fileno' function. */
#define HAVE_FILENO 1
/* Define to 1 if you have the 'fork' function. */
/* #undef HAVE_FORK */
/* Define to 1 if you have the `getcwd' function. */
/* Define to 1 if you have the 'getcwd' function. */
#define HAVE_GETCWD 1
/* Define to 1 if you have the `getgroups' function. */
/* Define to 1 if you have the 'getgroups' function. */
/* #undef HAVE_GETGROUPS */
/* Define to 1 if you have the `gethostbyname' function. */
/* Define to 1 if you have the 'gethostbyname' function. */
/* #undef HAVE_GETHOSTBYNAME */
/* Define to 1 if you have the `gethostname' function. */
/* Define to 1 if you have the 'gethostname' function. */
/* #undef HAVE_GETHOSTNAME */
/* Define to 1 if you have the `getloadavg' function. */
/* Define to 1 if you have the 'getloadavg' function. */
/* #undef HAVE_GETLOADAVG */
/* Define to 1 if you have the `getrlimit' function. */
/* Define to 1 if you have the 'getrlimit' function. */
/* #undef HAVE_GETRLIMIT */
/* Define if the GNU gettext() function is already present or preinstalled. */
/* #undef HAVE_GETTEXT */
/* Define if you have a standard gettimeofday function */
/* #undef HAVE_GETTIMEOFDAY */
/* Define to 1 if you have a standard gettimeofday function */
#ifdef __MINGW32__
#define HAVE_GETTIMEOFDAY 1
#endif
/* Define if you have the iconv() function. */
/* #undef HAVE_ICONV */
/* Define to 1 if you have the <inttypes.h> header file. */
/*#define HAVE_INTTYPES_H 1*/
#ifdef __MINGW32__
#define HAVE_INTTYPES_H 1
#endif
/* Define to 1 if you have the `dgc' library (-ldgc). */
/* Define to 1 if you have the 'dgc' library (-ldgc). */
/* #undef HAVE_LIBDGC */
/* Define to 1 if you have the `kstat' library (-lkstat). */
/* Define to 1 if you have the 'kstat' library (-lkstat). */
/* #undef HAVE_LIBKSTAT */
/* Define to 1 if you have the <limits.h> header file. */
@@ -150,195 +178,215 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the <locale.h> header file. */
/*#define HAVE_LOCALE_H 1*/
/* Define to 1 if you have the 'lstat' function. */
/* #undef HAVE_LSTAT */
/* Define to 1 if you have the <mach/mach.h> header file. */
/* #undef HAVE_MACH_MACH_H */
/* Define to 1 if you have the `memmove' function. */
#define HAVE_MEMMOVE 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `mkstemp' function. */
/* Define to 1 if you have the 'mkstemp' function. */
/* #undef HAVE_MKSTEMP */
/* Define to 1 if you have the `mktemp' function. */
/* Define to 1 if you have the 'mktemp' function. */
#define HAVE_MKTEMP 1
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
/* Define to 1 if you have the <ndir.h> header file, and it defines 'DIR'. */
/* #undef HAVE_NDIR_H */
/* Define to 1 if you have the <nlist.h> header file. */
/* #undef HAVE_NLIST_H */
/* Define to 1 if you have the `pipe' function. */
/* Define to 1 if you have the 'pipe' function. */
/* #undef HAVE_PIPE */
/* Define to 1 if you have the `pstat_getdynamic' function. */
/* Define to 1 if you have the 'pstat_getdynamic' function. */
/* #undef HAVE_PSTAT_GETDYNAMIC */
/* Define to 1 if you have the `realpath' function. */
/* Define to 1 if you have the 'readlink' function. */
/* #undef HAVE_READLINK */
/* Define to 1 if you have the 'realpath' function. */
/* #undef HAVE_REALPATH */
/* Define if <signal.h> defines the SA_RESTART constant. */
/* Define to 1 if <signal.h> defines the SA_RESTART constant. */
/* #undef HAVE_SA_RESTART */
/* Define to 1 if you have the `setegid' function. */
/* Define to 1 if you have the 'setegid' function. */
/* #undef HAVE_SETEGID */
/* Define to 1 if you have the `seteuid' function. */
/* Define to 1 if you have the 'seteuid' function. */
/* #undef HAVE_SETEUID */
/* Define to 1 if you have the `setlinebuf' function. */
/* Define to 1 if you have the 'setlinebuf' function. */
/* #undef HAVE_SETLINEBUF */
/* Define to 1 if you have the `setlocale' function. */
/* Define to 1 if you have the 'setlocale' function. */
/*#define HAVE_SETLOCALE 1*/
/* Define to 1 if you have the `setregid' function. */
/* Define to 1 if you have the 'setregid' function. */
/* #undef HAVE_SETREGID */
/* Define to 1 if you have the `setreuid' function. */
/* Define to 1 if you have the 'setreuid' function. */
/* #undef HAVE_SETREUID */
/* Define to 1 if you have the `setrlimit' function. */
/* Define to 1 if you have the 'setrlimit' function. */
/* #undef HAVE_SETRLIMIT */
/* Define to 1 if you have the `setvbuf' function. */
/*#define HAVE_SETVBUF 1 */
/* Define to 1 if you have the 'setvbuf' function. */
#define HAVE_SETVBUF 1
/* Define to 1 if you have the `sigaction' function. */
/* Define to 1 if you have the 'sigaction' function. */
/* #undef HAVE_SIGACTION */
/* Define to 1 if you have the `sigsetmask' function. */
/* Define to 1 if you have the 'sigsetmask' function. */
/* #undef HAVE_SIGSETMASK */
/* Define to 1 if you have the `socket' function. */
/* Define to 1 if you have the 'socket' function. */
/* #undef HAVE_SOCKET */
/* Define to 1 if you have the <stdarg.h> header file. */
#define HAVE_STDARG_H 1
/* Define to 1 if you have the <stdint.h> header file. */
/*#define HAVE_STDINT_H 1*/
#ifdef __MINGW32__
#define HAVE_STDINT_H 1
#endif
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strcasecmp' function. */
/* #undef HAVE_STRCASECMP */
/* Define to 1 if you have the 'strcasecmp' function. */
#ifdef __MINGW32__
#define HAVE_STRCASECMP 1
#endif
/* Define to 1 if you have the `strcmpi' function. */
/* #undef HAVE_STRCMPI */
/* Define to 1 if you have the 'strcmpi' function. */
#define HAVE_STRCMPI 1
/* Define to 1 if you have the `stricmp' function. */
#define HAVE_STRICMP 1
/* Define to 1 if you have the `strncasecmp' function. */
/* #undef HAVE_STRNCASECMP */
/* Define to 1 if you have the `strncmpi' function. */
/* #undef HAVE_STRNCMPI */
/* Define to 1 if you have the `strnicmp' function. */
#define HAVE_STRNICMP 1
/* Define to 1 if you have the `strchr' function. */
#define HAVE_STRCHR 1
/* Define to 1 if you have the `strcoll' function and it is properly defined.
/* Define to 1 if you have the 'strcoll' function and it is properly defined.
*/
#define HAVE_STRCOLL 1
/* Define to 1 if you have the `strdup' function. */
/* #define HAVE_STRDUP 1*/
/* Define to 1 if you have the 'strdup' function. */
#define HAVE_STRDUP 1
/* Define to 1 if you have the `strerror' function. */
/* Define to 1 if you have the 'strerror' function. */
#define HAVE_STRERROR 1
/* Define to 1 if you have the 'stricmp' function. */
#define HAVE_STRICMP 1
/* Define to 1 if you have the <strings.h> header file. */
/* #define HAVE_STRINGS_H 1 */
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strsignal' function. */
/* Define to 1 if you have the 'strncasecmp' function. */
#ifdef __MINGW32__
#define HAVE_STRNCASECMP 1
#endif
/* Define to 1 if you have the 'strncmpi' function. */
/* #undef HAVE_STRNCMPI */
/* Define to 1 if you have the 'strndup' function. */
/* #undef HAVE_STRNDUP */
/* Define to 1 if you have the 'strnicmp' function. */
#ifdef __MINGW32__
#define HAVE_STRNICMP 1
#endif
/* Define to 1 if you have the 'strsignal' function. */
/* #undef HAVE_STRSIGNAL */
/* Define to 1 if `n_un.n_name' is member of `struct nlist'. */
/* Define to 1 if 'n_un.n_name' is a member of 'struct nlist'. */
/* #undef HAVE_STRUCT_NLIST_N_UN_N_NAME */
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
/* Define to 1 if you have the <sys/dir.h> header file, and it defines 'DIR'.
*/
/* #undef HAVE_SYS_DIR_H */
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines 'DIR'.
*/
/* #undef HAVE_SYS_NDIR_H */
/* Define to 1 if you have the <sys/param.h> header file. */
/* #define HAVE_SYS_PARAM_H 1 */
#ifdef __MINGW32__
#define HAVE_SYS_PARAM_H 1
#endif
/* Define to 1 if you have the <sys/resource.h> header file. */
/* #undef HAVE_SYS_RESOURCE_H */
/* Define to 1 if you have the <sys/stat.h> header file. */
/* #define HAVE_SYS_STAT_H 1 */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/timeb.h> header file. */
/*#define HAVE_SYS_TIMEB_H 1*/
#define HAVE_SYS_TIMEB_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
/*#define HAVE_SYS_TIME_H 1*/
#ifdef __MINGW32__
#define HAVE_SYS_TIME_H 1
#endif
/* Define to 1 if you have the <sys/types.h> header file. */
/*#define HAVE_SYS_TYPES_H 1*/
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <sys/wait.h> header file. */
/* #undef HAVE_SYS_WAIT_H */
/* Define this if you have the \`union wait' type in <sys/wait.h>. */
/* Define to 1 if you have the \'union wait' type in <sys/wait.h>. */
/* #undef HAVE_UNION_WAIT */
/* Define to 1 if you have the <unistd.h> header file. */
/* #define HAVE_UNISTD_H 1*/
#ifdef __MINGW32__
#define HAVE_UNISTD_H 1
#endif
/* Define to 1 if you have the <varargs.h> header file. */
/* #undef HAVE_VARARGS_H */
/* Define to 1 if you have the `vfork' function. */
/* Define to 1 if you have the 'vfork' function. */
/* #undef HAVE_VFORK */
/* Define to 1 if you have the <vfork.h> header file. */
/* #undef HAVE_VFORK_H */
/* Define to 1 if you have the `vprintf' function. */
/* Define to 1 if you have the 'vprintf' function. */
#define HAVE_VPRINTF 1
/* Define to 1 if you have the `wait3' function. */
/* Define to 1 if you have the 'wait3' function. */
/* #undef HAVE_WAIT3 */
/* Define to 1 if you have the `waitpid' function. */
/* Define to 1 if you have the 'waitpid' function. */
/* #undef HAVE_WAITPID */
/* Define to 1 if `fork' works. */
/* Define to 1 if 'fork' works. */
/* #undef HAVE_WORKING_FORK */
/* Define to 1 if `vfork' works. */
/* Define to 1 if 'vfork' works. */
/* #undef HAVE_WORKING_VFORK */
/* Build host information. */
#define MAKE_HOST "Windows32"
/* Define this to enable job server support in GNU make. */
/* #undef MAKE_JOBSERVER */
/* Define to 1 to enable job server support in GNU make. */
#define MAKE_JOBSERVER 1
/* Define to 1 if your `struct nlist' has an `n_un' member. Obsolete, depend
on `HAVE_STRUCT_NLIST_N_UN_N_NAME */
/* Define to 1 to enable symbolic link timestamp checking. */
/* #undef MAKE_SYMLINKS */
/* Define to 1 if your 'struct nlist' has an 'n_un' member. Obsolete, depend
on 'HAVE_STRUCT_NLIST_N_UN_N_NAME */
/* #undef NLIST_NAME_UNION */
/* Define if struct nlist.n_name is a pointer rather than an array. */
/* Define to 1 if struct nlist.n_name is a pointer rather than an array. */
/* #undef NLIST_STRUCT */
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
@@ -347,10 +395,22 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Name of this package (needed by automake) */
#define PACKAGE "%PACKAGE%"
/* Define to 1 if the C compiler supports function prototypes. */
#define PROTOTYPES 1
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "bug-make@gnu.org"
/* Define as the return type of signal handlers (`int' or `void'). */
/* Define to the full name of this package. */
#define PACKAGE_NAME "GNU make"
/* Define to the home page for this package. */
#define PACKAGE_URL "http://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 ';'
/* Define as the return type of signal handlers ('int' or 'void'). */
#define RETSIGTYPE void
/* Define to the name of the SCCS 'get' command. */
@@ -359,20 +419,20 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define this if the SCCS 'get' command understands the '-G<file>' option. */
/* #undef SCCS_GET_MINUS_G */
/* Define to 1 if the `setvbuf' function takes the buffering type as its
/* Define to 1 if the 'setvbuf' function takes the buffering type as its
second argument and the buffer pointer as the third, as on System V before
release 3. */
/* #undef SETVBUF_REVERSED */
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
automatically deduced at run time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
/* #undef STACK_DIRECTION */
/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
/* Define to 1 if the 'S_IS*' macros in <sys/stat.h> do not work properly. */
/* #undef STAT_MACROS_BROKEN */
/* Define to 1 if you have the ANSI C header files. */
@@ -385,7 +445,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* #undef SVR4 */
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
/* #define TIME_WITH_SYS_TIME 1 */
#ifdef __MINGW32__
#define TIME_WITH_SYS_TIME 1
#endif
/* Define to 1 for Encore UMAX. */
/* #undef UMAX */
@@ -420,21 +482,18 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
this defined. */
/* #undef _POSIX_1_SOURCE */
/* Define to 1 if you need to in order for `stat' and other things to work. */
#define _POSIX_SOURCE 1
/* Define to 1 if you need to in order for 'stat' and other things to work. */
/* #undef _POSIX_SOURCE */
/* Define like PROTOTYPES; this can be used by system headers. */
/*#define __PROTOTYPES 1*/
/* Define to empty if `const' does not conform to ANSI C. */
/* Define to empty if 'const' does not conform to ANSI C. */
/* #undef const */
#include <sys/types.h>
/* Define to `int' if <sys/types.h> doesn't define. */
/* Define to 'int' if <sys/types.h> doesn't define. */
#define gid_t int
/* Define to `int' if <sys/types.h> does not define. */
/* Define to 'int' if <sys/types.h> does not define. */
/* GCC 4.x reportedly defines pid_t. */
#ifndef _PID_T_
#ifdef _WIN64
@@ -444,45 +503,20 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#endif
#endif
/* Define to `int' if <sys/types.h> doesn't define. */
/* 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>. */
#if !HAVE_STDINT_H && !HAVE_INTTYPES_H
#define uintmax_t unsigned long
#endif
/* Define as `fork' if `vfork' does not work. */
/* Define as 'fork' if 'vfork' does not work. */
/*#define vfork fork*/
/* Define to `unsigned long' or `unsigned long long'
if <inttypes.h> doesn't define. */
#define uintmax_t unsigned long
/* Define if you support file names longer than 14 characters. */
#define HAVE_LONG_FILE_NAMES 1
/* Define if your struct stat has st_rdev. */
#undef HAVE_ST_RDEV
#define HAVE_ST_RDEV 1
/* Define if you have the strftime function. */
#undef HAVE_STRFTIME
#define HAVE_STRFTIME 1
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
/* #undef HAVE_SYS_WAIT_H */
/* Define if your struct tm has tm_zone. */
/* #undef HAVE_TM_ZONE */
/* Define if you don't have tm_zone but do have the external array
tzname. */
#undef HAVE_TZNAME
#define HAVE_TZNAME 1
/* Define if utime(file, NULL) sets file's timestamp to the present. */
#undef HAVE_UTIME_NULL
#define HAVE_UTIME_NULL 1
/* Define to the installation directory for locales. */
#define LOCALEDIR ""

View File

@@ -1,3 +1,8 @@
2012-01-15 Paul Smith <psmith@gnu.org>
* dospaths.m4: Use AC_LANG_PROGRAM to encapsulate the test code.
Fixes Savannah bug #35256. Patch from Sebastian Pipping.
2006-03-09 Paul Smith <psmith@gnu.org>
* dospaths.m4: Add MSYS to the list of targets allowing DOS-style
@@ -28,8 +33,7 @@
* Makefile.am: New file.
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
Foundation, Inc.
Copyright (C) 2002-2012 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

View File

@@ -1,6 +1,5 @@
# -*-Makefile-*-, or close enough
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
# Software Foundation, Inc.
# Copyright (C) 2002-2012 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
@@ -16,9 +15,34 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
EXTRA_DIST = codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 nls.m4 \
intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 \
isc-posix.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 \
progtest.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4 longlong.m4 \
dospaths.m4 po.m4 signed.m4 longdouble.m4 wchar_t.m4 \
wint_t.m4 intmax.m4 printf-posix.m4 xsize.m4 size_max.m4
EXTRA_DIST = \
codeset.m4 \
dospaths.m4 \
gettext.m4 \
glibc21.m4 \
iconv.m4 \
intdiv0.m4 \
intmax.m4 \
inttypes-pri.m4 \
inttypes.m4 \
inttypes_h.m4 \
isc-posix.m4 \
isc-posix.m4 \
lcmessage.m4 \
lib-ld.m4 \
lib-link.m4 \
lib-prefix.m4 \
longdouble.m4 \
longlong.m4 \
nls.m4 \
po.m4 \
printf-posix.m4 \
progtest.m4 \
signed.m4 \
size_max.m4 \
stdint_h.m4 \
uintmax_t.m4 \
ulonglong.m4 \
wchar_t.m4 \
wint_t.m4 \
xsize.m4

View File

@@ -1,8 +1,7 @@
# Test if the system uses DOS-style pathnames (drive specs and backslashes)
# By Paul Smith <psmith@gnu.org>. Based on dos.m4 by Jim Meyering.
#
# Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
# Copyright (C) 1993-2012 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
@@ -18,21 +17,17 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
AC_DEFUN([pds_AC_DOS_PATHS],
[
AC_CACHE_CHECK([whether system uses MSDOS-style paths], [ac_cv_dos_paths],
[
AC_COMPILE_IFELSE([
AC_DEFUN([pds_AC_DOS_PATHS], [
AC_CACHE_CHECK([whether system uses MSDOS-style paths], [ac_cv_dos_paths], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ && !defined __EMX__ && !defined __MSYS__ && !defined __CYGWIN__
neither MSDOS nor Windows nor OS2
#endif
],
]])],
[ac_cv_dos_paths=yes],
[ac_cv_dos_paths=no])
])
[ac_cv_dos_paths=no])])
if test x"$ac_cv_dos_paths" = xyes; then
AC_DEFINE_UNQUOTED([HAVE_DOS_PATHS], 1,
[Define if the system uses DOS-style pathnames.])
fi
])
AS_IF([test x"$ac_cv_dos_paths" = xyes],
[ AC_DEFINE_UNQUOTED([HAVE_DOS_PATHS], 1,
[Define if the system uses DOS-style pathnames.])])
])

View File

@@ -1,7 +1,6 @@
/* configh.dos -- hand-massaged config.h file for MS-DOS builds -*-C-*-
Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 1994-2012 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
@@ -25,10 +24,10 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#if __DJGPP__ > 2 || __DJGPP_MINOR__ > 1
/* Define to 1 if `sys_siglist' is declared by <signal.h> or <unistd.h>. */
/* Define to 1 if 'sys_siglist' is declared by <signal.h> or <unistd.h>. */
# define SYS_SIGLIST_DECLARED 1
/* Define to 1 if the C library defines the variable `_sys_siglist'. */
/* Define to 1 if the C library defines the variable '_sys_siglist'. */
# define HAVE_DECL_SYS_SIGLIST 1
#else
@@ -41,13 +40,13 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Use high resolution file timestamps if nonzero. */
#define FILE_TIMESTAMP_HI_RES 0
/* Define to 1 if you have `alloca', as a function or macro. */
/* Define to 1 if you have 'alloca', as a function or macro. */
#define HAVE_ALLOCA 1
/* Define to 1 if you have the fdopen function. */
#define HAVE_FDOPEN 1
/* Define to 1 if you have the `getgroups' function. */
/* Define to 1 if you have the 'getgroups' function. */
#define HAVE_GETGROUPS 1
/* Define to 1 if you have the <memory.h> header file. */
@@ -56,18 +55,18 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the mkstemp function. */
#define HAVE_MKSTEMP 1
/* Define to 1 if you have the `mktemp' function. */
/* Define to 1 if you have the 'mktemp' function. */
#define HAVE_MKTEMP 1
/* Define to 1 if you have the `setlinebuf' function. */
/* Define to 1 if you have the 'setlinebuf' function. */
#define HAVE_SETLINEBUF 1
/* Define to 1 if you have the `setvbuf' function. */
/* Define to 1 if you have the 'setvbuf' function. */
#define HAVE_SETVBUF 1
#define SCCS_GET "get"
/* Define to `unsigned long' or `unsigned long long'
/* Define to 'unsigned long' or 'unsigned long long'
if <inttypes.h> doesn't define. */
#define uintmax_t unsigned long long
@@ -90,6 +89,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the stricmp function. */
#define HAVE_STRICMP 1
/* Define to 1 if you have the 'strncasecmp' function. */
#define HAVE_STRNCASECMP 1
/* Name of the package */
#define PACKAGE "%PACKAGE%"

View File

@@ -1,6 +1,5 @@
@echo off
rem Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
rem 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
rem Copyright (C) 1994-2012 Free Software Foundation, Inc.
rem This file is part of GNU Make.
rem
rem GNU Make is free software; you can redistribute it and/or modify it under

View File

@@ -1,7 +1,6 @@
# Process this file with autoconf to produce a configure script.
#
# Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
# Copyright (C) 1993-2012 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
@@ -17,15 +16,15 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
AC_INIT([GNU make],[3.82],[bug-make@gnu.org])
AC_INIT([GNU make],[3.82.90],[bug-make@gnu.org])
AC_PREREQ(2.59)
AC_REVISION([[$Id$]])
AC_PREREQ([2.59])
AC_REVISION([$Id$])
# Autoconf setup
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR(vpath.c)
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_SRCDIR([vpath.c])
AC_CONFIG_HEADERS([config.h])
# Automake setup
AM_INIT_AUTOMAKE([1.9])
@@ -35,9 +34,9 @@ AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PROG_CPP
AC_CHECK_PROG(AR, ar, ar, ar)
AC_CHECK_PROG([AR], [ar], [ar], [ar])
# Perl is needed for the test suite (only)
AC_CHECK_PROG(PERL, perl, perl, perl)
AC_CHECK_PROG([PERL], [perl], [perl], [perl])
# Specialized system macros
AC_CANONICAL_HOST
@@ -47,7 +46,7 @@ AC_MINIX
# Enable gettext, in "external" mode.
AM_GNU_GETTEXT_VERSION(0.14.1)
AM_GNU_GETTEXT_VERSION([0.18.1])
AM_GNU_GETTEXT([external])
# This test must come as early as possible after the compiler configuration
@@ -56,25 +55,25 @@ AM_GNU_GETTEXT([external])
AC_SYS_LARGEFILE
# Checks for libraries.
AC_SEARCH_LIBS(getpwnam, [sun])
AC_SEARCH_LIBS([getpwnam], [sun])
# Checks for header files.
AC_HEADER_STDC
AC_HEADER_DIRENT
AC_HEADER_STAT
AC_HEADER_TIME
AC_CHECK_HEADERS(stdlib.h locale.h unistd.h limits.h fcntl.h string.h \
memory.h sys/param.h sys/resource.h sys/time.h sys/timeb.h)
AC_CHECK_HEADERS([stdlib.h locale.h unistd.h limits.h fcntl.h string.h \
memory.h sys/param.h sys/resource.h sys/time.h sys/timeb.h])
# Set a flag if we have an ANSI C compiler
if test "$ac_cv_prog_cc_stdc" != no; then
AC_DEFINE(HAVE_ANSI_COMPILER, 1,
[Define to 1 if your compiler conforms to the ANSI C standard.])
fi
AS_IF([test "$ac_cv_prog_cc_stdc" != no],
[ AC_DEFINE([HAVE_ANSI_COMPILER], [1],
[Define to 1 if your compiler conforms to the ANSI C standard.])
])
# Determine what kind of variadic function calls we support
AC_CHECK_HEADERS(stdarg.h varargs.h, break)
AC_CHECK_HEADERS([stdarg.h varargs.h], [break])
AM_PROG_CC_C_O
AC_C_CONST
@@ -84,45 +83,40 @@ AC_TYPE_PID_T
# Find some definition for uintmax_t
AC_CHECK_TYPE(uintmax_t,,[
uintmax_t="unsigned long"
AC_CHECK_TYPE(unsigned long long,[uintmax_t="unsigned long long"])
AC_DEFINE_UNQUOTED(uintmax_t,$uintmax_t,
[Define uintmax_t if not defined in <stdint.h> or <inttypes.h>.])])
AC_CHECK_TYPE([uintmax_t],[],
[ uintmax_t="unsigned long"
AC_CHECK_TYPE([unsigned long long],[uintmax_t="unsigned long long"])
AC_DEFINE_UNQUOTED([uintmax_t], [$uintmax_t],
[Define uintmax_t if not defined in <stdint.h> or <inttypes.h>.])
])
# Find out whether our struct stat returns nanosecond resolution timestamps.
AC_STRUCT_ST_MTIM_NSEC
AC_MSG_CHECKING([whether to use high resolution file timestamps])
AC_CACHE_VAL(make_cv_file_timestamp_hi_res, [
make_cv_file_timestamp_hi_res=no
if test "$ac_cv_struct_st_mtim_nsec" != no; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
# if HAVE_INTTYPES_H
# include <inttypes.h>
# endif]],
AC_CACHE_CHECK([whether to use high resolution file timestamps],
[make_cv_file_timestamp_hi_res],
[ make_cv_file_timestamp_hi_res=no
AS_IF([test "$ac_cv_struct_st_mtim_nsec" != no],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif]],
[[char a[0x7fffffff < (uintmax_t)-1 >> 30 ? 1 : -1];]])],
[make_cv_file_timestamp_hi_res=yes],
[])
fi])
AC_MSG_RESULT($make_cv_file_timestamp_hi_res)
if test "$make_cv_file_timestamp_hi_res" = yes; then
val=1
else
val=0
fi
AC_DEFINE_UNQUOTED(FILE_TIMESTAMP_HI_RES, $val,
[make_cv_file_timestamp_hi_res=yes])
])])
AS_IF([test "$make_cv_file_timestamp_hi_res" = yes], [val=1], [val=0])
AC_DEFINE_UNQUOTED([FILE_TIMESTAMP_HI_RES], [$val],
[Use high resolution file timestamps if nonzero.])
if test "$make_cv_file_timestamp_hi_res" = yes; then
# Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
AS_IF([test "$make_cv_file_timestamp_hi_res" = yes],
[ # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
# Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
AC_SEARCH_LIBS(clock_gettime, [rt posix4])
if test "$ac_cv_search_clock_gettime" != no; then
AC_DEFINE(HAVE_CLOCK_GETTIME, 1,
AC_SEARCH_LIBS([clock_gettime], [rt posix4])
AS_IF([test "$ac_cv_search_clock_gettime" != no],
[ AC_DEFINE([HAVE_CLOCK_GETTIME], [1],
[Define to 1 if you have the clock_gettime function.])
fi
fi
])
])
# Check for DOS-style pathnames.
pds_AC_DOS_PATHS
@@ -130,7 +124,7 @@ pds_AC_DOS_PATHS
# See if we have a standard version of gettimeofday(). Since actual
# implementations can differ, just make sure we have the most common
# one.
AC_CACHE_CHECK([for standard gettimeofday], ac_cv_func_gettimeofday,
AC_CACHE_CHECK([for standard gettimeofday], [ac_cv_func_gettimeofday],
[ac_cv_func_gettimeofday=no
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/time.h>
int main ()
@@ -142,28 +136,29 @@ AC_CACHE_CHECK([for standard gettimeofday], ac_cv_func_gettimeofday,
[ac_cv_func_gettimeofday=yes],
[ac_cv_func_gettimeofday=no],
[ac_cv_func_gettimeofday="no (cross-compiling)"])])
if test "$ac_cv_func_gettimeofday" = yes; then
AC_DEFINE(HAVE_GETTIMEOFDAY, 1,
AS_IF([test "$ac_cv_func_gettimeofday" = yes],
[ AC_DEFINE([HAVE_GETTIMEOFDAY], [1],
[Define to 1 if you have a standard gettimeofday function])
fi
])
AC_CHECK_FUNCS( strdup strndup mkstemp mktemp fdopen fileno \
AC_CHECK_FUNCS([strdup strndup mkstemp mktemp fdopen fileno \
dup2 getcwd realpath sigsetmask sigaction \
getgroups seteuid setegid setlinebuf setreuid setregid \
getrlimit setrlimit setvbuf pipe strerror strsignal \
lstat readlink atexit)
lstat readlink atexit])
# We need to check declarations, not just existence, because on Tru64 this
# function is not declared without special flags, which themselves cause
# other problems. We'll just use our own.
AC_CHECK_DECLS([bsd_signal], [], [], [[#include <signal.h>]])
AC_CHECK_DECLS([bsd_signal], [], [], [[#define _GNU_SOURCE 1
#include <signal.h>]])
AC_FUNC_SETVBUF_REVERSED
# Rumor has it that strcasecmp lives in -lresolv on some odd systems.
# It doesn't hurt much to use our own if we can't find it so I don't
# make the effort here.
AC_CHECK_FUNCS(strcasecmp strncasecmp strcmpi strncmpi stricmp strnicmp)
AC_CHECK_FUNCS([strcasecmp strncasecmp strcmpi strncmpi stricmp strnicmp])
# strcoll() is used by the GNU glob library
AC_FUNC_STRCOLL
@@ -173,23 +168,42 @@ AC_FUNC_FORK([])
AC_FUNC_VPRINTF
AC_FUNC_CLOSEDIR_VOID
# See if the user wants to add (or not) GNU Guile support
PKG_PROG_PKG_CONFIG
AC_ARG_WITH([guile], [AS_HELP_STRING([--with-guile],
[Support GNU Guile for embedded scripting])])
# For some strange reason, at least on Ubuntu, each version of Guile
# comes with it's own PC file so we have to specify them as individual
# packages. Ugh.
AS_IF([test "x$with_guile" != xno],
[ PKG_CHECK_MODULES([GUILE], [guile-2.0], [have_guile=yes],
[PKG_CHECK_MODULES([GUILE], [guile-1.8], [have_guile=yes],
[have_guile=no])])
])
AS_IF([test "$have_guile" = yes],
[AC_DEFINE([HAVE_GUILE], [1], [Embed GNU Guile support])])
AM_CONDITIONAL([HAVE_GUILE], [test "$have_guile" = yes])
AC_FUNC_GETLOADAVG
# AC_FUNC_GETLOADAVG is documented to set the NLIST_STRUCT value, but it
# doesn't. So, we will.
if test "$ac_cv_header_nlist_h" = yes; then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <nlist.h>]],
AS_IF([test "$ac_cv_header_nlist_h" = yes],
[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <nlist.h>]],
[[struct nlist nl;
nl.n_name = "string";
return 0;]])],
[make_cv_nlist_struct=yes],
[make_cv_nlist_struct=no])
if test "$make_cv_nlist_struct" = yes; then
AC_DEFINE(NLIST_STRUCT, 1,
AS_IF([test "$make_cv_nlist_struct" = yes],
[ AC_DEFINE([NLIST_STRUCT], [1],
[Define to 1 if struct nlist.n_name is a pointer rather than an array.])
fi
fi
])
])
AC_CHECK_DECLS([sys_siglist, _sys_siglist, __sys_siglist], , ,
[AC_INCLUDES_DEFAULT
@@ -202,11 +216,10 @@ AC_CHECK_DECLS([sys_siglist, _sys_siglist, __sys_siglist], , ,
# Check out the wait reality.
AC_CHECK_HEADERS(sys/wait.h,,,[[#include <sys/types.h>]])
AC_CHECK_FUNCS(waitpid wait3)
AC_MSG_CHECKING(for union wait)
AC_CACHE_VAL(make_cv_union_wait, [dnl
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
AC_CHECK_HEADERS([sys/wait.h],[],[],[[#include <sys/types.h>]])
AC_CHECK_FUNCS([waitpid wait3])
AC_CACHE_CHECK([for union wait], [make_cv_union_wait],
[ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <sys/wait.h>]],
[[union wait status; int pid; pid = wait (&status);
#ifdef WEXITSTATUS
@@ -225,136 +238,172 @@ AC_CACHE_VAL(make_cv_union_wait, [dnl
#endif
]])],
[make_cv_union_wait=yes],
[make_cv_union_wait=no])])
if test "$make_cv_union_wait" = yes; then
AC_DEFINE(HAVE_UNION_WAIT, 1,
[Define to 1 if you have the \`union wait' type in <sys/wait.h>.])
fi
AC_MSG_RESULT($make_cv_union_wait)
[make_cv_union_wait=no])
])
AS_IF([test "$make_cv_union_wait" = yes],
[ AC_DEFINE([HAVE_UNION_WAIT], [1],
[Define to 1 if you have the 'union wait' type in <sys/wait.h>.])
])
# If we're building on Windows/DOS/OS/2, add some support for DOS drive specs.
if test "$PATH_SEPARATOR" = ';'; then
AC_DEFINE(HAVE_DOS_PATHS, 1,
AS_IF([test "$PATH_SEPARATOR" = ';'],
[ AC_DEFINE([HAVE_DOS_PATHS], [1],
[Define to 1 if your system requires backslashes or drive specs in pathnames.])
fi
])
# See if the user wants to use pmake's "customs" distributed build capability
AC_SUBST(REMOTE) REMOTE=stub
AC_SUBST([REMOTE]) REMOTE=stub
use_customs=false
AC_ARG_WITH(customs,
AC_HELP_STRING([--with-customs=DIR],
[enable remote jobs via Customs--see README.customs]),
[case $withval in
n|no) : ;;
*) make_cppflags="$CPPFLAGS"
case $withval in
y|ye|yes) : ;;
*) CPPFLAGS="$CPPFLAGS -I$with_customs/include/customs"
make_ldflags="$LDFLAGS -L$with_customs/lib" ;;
esac
CF_NETLIBS
AC_CHECK_HEADER(customs.h,
[use_customs=true
REMOTE=cstms
LIBS="$LIBS -lcustoms" LDFLAGS="$make_ldflags"],
[with_customs=no
CPPFLAGS="$make_cppflags" make_badcust=yes])
;;
esac])
AC_ARG_WITH([customs],
[ AC_HELP_STRING([--with-customs=DIR],
[enable remote jobs via Customs--see README.customs])],
[ AS_CASE([$withval], [n|no], [:],
[make_cppflags="$CPPFLAGS"
AS_CASE([$withval],
[y|ye|yes], [:],
[CPPFLAGS="$CPPFLAGS -I$with_customs/include/customs"
make_ldflags="$LDFLAGS -L$with_customs/lib"])
CF_NETLIBS
AC_CHECK_HEADER([customs.h],
[use_customs=true
REMOTE=cstms
LIBS="$LIBS -lcustoms" LDFLAGS="$make_ldflags"],
[with_customs=no
CPPFLAGS="$make_cppflags" make_badcust=yes])
])
])
# Tell automake about this, so it can include the right .c files.
AM_CONDITIONAL(USE_CUSTOMS, test "$use_customs" = true)
AM_CONDITIONAL([USE_CUSTOMS], [test "$use_customs" = true])
# See if the user asked to handle case insensitive file systems.
AH_TEMPLATE(HAVE_CASE_INSENSITIVE_FS, [Use case insensitive file names])
AC_ARG_ENABLE(case-insensitive-file-system,
AH_TEMPLATE([HAVE_CASE_INSENSITIVE_FS], [Use case insensitive file names])
AC_ARG_ENABLE([case-insensitive-file-system],
AC_HELP_STRING([--enable-case-insensitive-file-system],
[assume file systems are case insensitive]),
[case $enableval in
yes) AC_DEFINE(HAVE_CASE_INSENSITIVE_FS) ;;
esac])
[AS_IF([test "$enableval" = yes], [AC_DEFINE([HAVE_CASE_INSENSITIVE_FS])])])
# See if we can handle the job server feature, and if the user wants it.
AC_ARG_ENABLE(job-server,
AC_ARG_ENABLE([job-server],
AC_HELP_STRING([--disable-job-server],
[disallow recursive make communication during -jN]),
[make_cv_job_server="$enableval" user_job_server="$enableval"],
[make_cv_job_server="yes"])
has_wait_nohang=yes
case "$ac_cv_func_waitpid/$ac_cv_func_wait3" in
no/no) has_wait_nohang=no ;;
esac
AS_IF([test "$ac_cv_func_waitpid" = no && test "$ac_cv_func_wait3" = no],
[has_wait_nohang=no],
[has_wait_nohang=yes])
AC_CACHE_CHECK(for SA_RESTART, make_cv_sa_restart, [
AC_CACHE_CHECK([for SA_RESTART], [make_cv_sa_restart], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]],
[[return SA_RESTART;]])],
[make_cv_sa_restart=yes],
[make_cv_sa_restart=no])])
if test "$make_cv_sa_restart" != no; then
AC_DEFINE(HAVE_SA_RESTART, 1,
AS_IF([test "$make_cv_sa_restart" != no],
[ AC_DEFINE([HAVE_SA_RESTART], [1],
[Define to 1 if <signal.h> defines the SA_RESTART constant.])
fi
])
# enable make_cv_sa_restart for OS/2 so that the jobserver will be enabled,
# but do it after HAVE_SA_RESTART has been defined.
case "$host_os" in
os2*) make_cv_sa_restart=yes ;;
esac
# Only allow jobserver on systems that support it
AS_CASE([/$ac_cv_func_pipe/$ac_cv_func_sigaction/$make_cv_sa_restart/$has_wait_nohang/],
[*/no/*], [make_cv_job_server=no])
case "$ac_cv_func_pipe/$ac_cv_func_sigaction/$make_cv_sa_restart/$has_wait_nohang/$make_cv_job_server" in
yes/yes/yes/yes/yes)
AC_DEFINE(MAKE_JOBSERVER, 1,
[Define to 1 to enable job server support in GNU make.]);;
esac
# Also supported on OS2 and MinGW
AS_CASE([$host_os], [os2*|mingw*], [make_cv_job_server=yes])
# If we support it and the user didn't disable it, build with jobserver
AS_CASE([/$make_cv_job_server/$user_job_server/],
[*/no/*], [: no jobserver],
[AC_DEFINE(MAKE_JOBSERVER, 1,
[Define to 1 to enable job server support in GNU make.])
])
# If dl*() functions are supported we can enable the load operation
AC_CHECK_DECLS([dlopen, dlsym, dlerror], [], [],
[[#include <dlfcn.h>]])
AC_ARG_ENABLE([load],
AC_HELP_STRING([--disable-load],
[disable support for the 'load' operation]),
[make_cv_load="$enableval" user_load="$enableval"],
[make_cv_load="yes"])
AS_CASE([/$ac_cv_func_dlopen/$ac_cv_func_dlsym/$ac_cv_func_dlerror/],
[*/no/*], [make_cv_load=no])
AS_CASE([/$make_cv_load/$user_load/],
[*/no/*], [make_cv_load=no],
[AC_DEFINE(MAKE_LOAD, 1,
[Define to 1 to enable 'load' support in GNU make.])
])
# We might need -ldl
AS_IF([test "$make_cv_load" = yes], [
AC_SEARCH_LIBS([dlopen], [dl], [], [make_cv_load=])
])
# If we want load support, we might need to link with export-dynamic.
# See if we can figure it out. Unfortunately this is very difficult.
# For example passing -rdynamic to the SunPRO linker gives a warning
# but succeeds and creates a shared object, not an executable!
AS_IF([test "$make_cv_load" = yes], [
AC_MSG_CHECKING([If the linker accepts -Wl,--export-dynamic])
old_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
AC_LINK_IFELSE([int main(){}],
[AC_MSG_RESULT([yes])
AC_SUBST([AM_LDFLAGS], [-Wl,--export-dynamic])],
[AC_MSG_RESULT([no])
AC_MSG_CHECKING([If the linker accepts -rdynamic])
LDFLAGS="$old_LDFLAGS -rdynamic"
AC_LINK_IFELSE([int main(){}],
[AC_MSG_RESULT([yes])
AC_SUBST([AM_LDFLAGS], [-rdynamic])],
[AC_MSG_RESULT([no])])
])
LDFLAGS="$old_LDFLAGS"
])
# if we have both lstat() and readlink() then we can support symlink
# timechecks.
case "$ac_cv_func_lstat/$ac_cv_func_readlink" in
yes/yes)
AC_DEFINE(MAKE_SYMLINKS, 1,
[Define to 1 to enable symbolic link timestamp checking.]);;
esac
AS_IF([test "$ac_cv_func_lstat" = yes && test "$ac_cv_func_readlink" = yes],
[ AC_DEFINE([MAKE_SYMLINKS], [1],
[Define to 1 to enable symbolic link timestamp checking.])
])
# Find the SCCS commands, so we can include them in our default rules.
AC_CACHE_CHECK(for location of SCCS get command, make_cv_path_sccs_get, [
if test -f /usr/sccs/get; then
make_cv_path_sccs_get=/usr/sccs/get
else
make_cv_path_sccs_get=get
fi])
AC_DEFINE_UNQUOTED(SCCS_GET, ["$make_cv_path_sccs_get"],
AC_CACHE_CHECK([for location of SCCS get command], [make_cv_path_sccs_get], [
AS_IF([test -f /usr/sccs/get],
[make_cv_path_sccs_get=/usr/sccs/get],
[make_cv_path_sccs_get=get])
])
AC_DEFINE_UNQUOTED([SCCS_GET], ["$make_cv_path_sccs_get"],
[Define to the name of the SCCS 'get' command.])
ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later.
if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 &&
test -f s.conftest; then
# We successfully created an SCCS file.
AC_CACHE_CHECK(if SCCS get command understands -G, make_cv_sys_get_minus_G, [
if $make_cv_path_sccs_get -Gconftoast s.conftest >/dev/null 2>&1 &&
test -f conftoast; then
make_cv_sys_get_minus_G=yes
else
make_cv_sys_get_minus_G=no
fi])
case "$make_cv_sys_get_minus_G" in
yes) AC_DEFINE(SCCS_GET_MINUS_G, 1,
[Define to 1 if the SCCS 'get' command understands the '-G<file>' option.]);;
esac
fi
AS_IF([(/usr/sccs/admin -n s.conftest || admin -n s.conftest) >/dev/null 2>&1 &&
test -f s.conftest],
[ # We successfully created an SCCS file.
AC_CACHE_CHECK([if SCCS get command understands -G], [make_cv_sys_get_minus_G],
[AS_IF([$make_cv_path_sccs_get -Gconftoast s.conftest >/dev/null 2>&1 &&
test -f conftoast],
[make_cv_sys_get_minus_G=yes],
[make_cv_sys_get_minus_G=no])
])
AS_IF([test "$make_cv_sys_get_minus_G" = yes],
[AC_DEFINE([SCCS_GET_MINUS_G], [1],
[Define to 1 if the SCCS 'get' command understands the '-G<file>' option.])
])
])
rm -f s.conftest conftoast
# Check the system to see if it provides GNU glob. If not, use our
# local version.
AC_MSG_CHECKING(if system libc has GNU glob)
AC_CACHE_VAL(make_cv_sys_gnu_glob, [
AC_EGREP_CPP(gnu glob,[
AC_CACHE_CHECK([if system libc has GNU glob], [make_cv_sys_gnu_glob],
[ AC_EGREP_CPP([gnu glob],[
#include <features.h>
#include <glob.h>
#include <fnmatch.h>
@@ -365,47 +414,46 @@ AC_CACHE_VAL(make_cv_sys_gnu_glob, [
# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION
gnu glob
# endif
#endif
], [AC_MSG_RESULT(yes)
make_cv_sys_gnu_glob=yes], [AC_MSG_RESULT([no; using local copy])
make_cv_sys_gnu_glob=no])])
if test "$make_cv_sys_gnu_glob" = no; then
GLOBINC='-I$(srcdir)/glob'
#endif],
[make_cv_sys_gnu_glob=yes],
[make_cv_sys_gnu_glob=no])])
AS_IF([test "$make_cv_sys_gnu_glob" = no],
[ GLOBINC='-I$(srcdir)/glob'
GLOBLIB=glob/libglob.a
fi
AC_SUBST(GLOBINC)
AC_SUBST(GLOBLIB)
])
AC_SUBST([GLOBINC])
AC_SUBST([GLOBLIB])
# Tell automake about this, so it can build the right .c files.
AM_CONDITIONAL(USE_LOCAL_GLOB, test "$make_cv_sys_gnu_glob" = no)
AM_CONDITIONAL([USE_LOCAL_GLOB], [test "$make_cv_sys_gnu_glob" = no])
# Let the makefile know what our build host is
AC_DEFINE_UNQUOTED(MAKE_HOST,"$host",[Build host information.])
AC_DEFINE_UNQUOTED([MAKE_HOST],["$host"],[Build host information.])
MAKE_HOST="$host"
AC_SUBST(MAKE_HOST)
AC_SUBST([MAKE_HOST])
w32_target_env=no
AM_CONDITIONAL([WINDOWSENV], false)
AM_CONDITIONAL([WINDOWSENV], [false])
case "$host" in
*-*-mingw32)
AM_CONDITIONAL(WINDOWSENV, true)
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])
;;
esac
])
AC_DEFINE_UNQUOTED(PATH_SEPARATOR_CHAR,'$PATH_SEPARATOR',[Define to the character that separates directories in PATH.])
AC_DEFINE_UNQUOTED([PATH_SEPARATOR_CHAR],['$PATH_SEPARATOR'],
[Define to the character that separates directories in PATH.])
# Include the Maintainer's Makefile section, if it's here.
MAINT_MAKEFILE=/dev/null
if test -r "$srcdir/maintMakefile"; then
MAINT_MAKEFILE="$srcdir/maintMakefile"
fi
AC_SUBST_FILE(MAINT_MAKEFILE)
AS_IF([test -r "$srcdir/maintMakefile"],
[ MAINT_MAKEFILE="$srcdir/maintMakefile"
])
AC_SUBST_FILE([MAINT_MAKEFILE])
# Allow building with dmalloc
AM_WITH_DMALLOC
@@ -416,48 +464,54 @@ SET_MAKE=
# Sanity check and inform the user of what we found
case "$make_badcust" in
yes) echo
echo "WARNING: --with-customs specified but no customs.h could be found;"
echo " disabling Customs support."
echo ;;
esac
AS_IF([test "x$make_badcust" = xyes], [
echo
echo "WARNING: --with-customs specified but no customs.h could be found;"
echo " disabling Customs support."
echo
])
case "$with_customs" in
""|n|no|y|ye|yes) ;;
*) if test -f "$with_customs/lib/libcustoms.a"; then
:
else
echo
echo "WARNING: '$with_customs/lib' does not appear to contain the"
echo " Customs library. You must build and install Customs"
echo " before compiling GNU make."
echo
fi ;;
esac
AS_CASE([$with_customs],
[""|n|no|y|ye|yes], [:],
[AS_IF([test -f "$with_customs/lib/libcustoms.a"], [:],
[ echo
echo "WARNING: '$with_customs/lib' does not appear to contain the"
echo " Customs library. You must build and install Customs"
echo " before compiling GNU make."
echo
])])
case "$has_wait_nohang" in
no) echo
echo "WARNING: Your system has neither waitpid() nor wait3()."
echo " Without one of these, signal handling is unreliable."
echo " You should be aware that running GNU make with -j"
echo " could result in erratic behavior."
echo ;;
esac
AS_IF([test "x$has_wait_nohang" = xno],
[ echo
echo "WARNING: Your system has neither waitpid() nor wait3()."
echo " Without one of these, signal handling is unreliable."
echo " You should be aware that running GNU make with -j"
echo " could result in erratic behavior."
echo
])
case "$make_cv_job_server/$user_job_server" in
no/yes) echo
echo "WARNING: Make job server requires a POSIX-ish system that"
echo " supports the pipe(), sigaction(), and either"
echo " waitpid() or wait3() functions. Your system doesn't"
echo " appear to provide one or more of those."
echo " Disabling job server support."
echo ;;
esac
AS_IF([test "x$make_cv_job_server" = xno && test "x$user_job_server" = xyes],
[ echo
echo "WARNING: Make job server requires a POSIX-ish system that"
echo " supports the pipe(), sigaction(), and either"
echo " waitpid() or wait3() functions. Your system doesn't"
echo " appear to provide one or more of those."
echo " Disabling job server support."
echo
])
AS_IF([test "x$make_cv_load" = xno && test "x$user_load" = xyes],
[ echo
echo "WARNING: 'load' support requires a POSIX-ish system that"
echo " supports the dlopen(), dlsym(), and dlerror() functions."
echo " Your system doesn't appear to provide one or more of these."
echo " Disabling 'load' support."
echo
])
# Specify what files are to be created.
AC_CONFIG_FILES(Makefile glob/Makefile po/Makefile.in config/Makefile doc/Makefile w32/Makefile)
AC_CONFIG_FILES([Makefile glob/Makefile po/Makefile.in config/Makefile \
doc/Makefile w32/Makefile])
# OK, do it!
@@ -465,10 +519,10 @@ AC_OUTPUT
# We only generate the build.sh if we have a build.sh.in; we won't have
# one before we've created a distribution.
if test -f "$srcdir/build.sh.in"; then
./config.status --file build.sh
AS_IF([test -f "$srcdir/build.sh.in"],
[ ./config.status --file build.sh
chmod +x build.sh
fi
])
dnl Local Variables:
dnl comment-start: "dnl "

View File

@@ -1,6 +1,5 @@
/* Debugging macros and interface.
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
2009, 2010 Free Software Foundation, Inc.
Copyright (C) 1999-2012 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

View File

@@ -1,7 +1,5 @@
/* Data base of default implicit rules for GNU Make.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
Copyright (C) 1988-2012 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
@@ -32,8 +30,8 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* This is the default list of suffixes for suffix rules.
`.s' must come last, so that a `.o' file will be made from
a `.c' or `.p' or ... file rather than from a .s file. */
'.s' must come last, so that a '.o' file will be made from
a '.c' or '.p' or ... file rather than from a .s file. */
static char default_suffixes[]
#ifdef VMS
@@ -53,23 +51,23 @@ static char default_suffixes[]
static struct pspec default_pattern_rules[] =
{
{ "(%)", "%",
"$(AR) $(ARFLAGS) $@ $<" },
"$(AR) $(ARFLAGS) $@ $<" },
/* The X.out rules are only in BSD's default set because
BSD Make has no null-suffix rules, so `foo.out' and
`foo' are the same thing. */
BSD Make has no null-suffix rules, so 'foo.out' and
'foo' are the same thing. */
#ifdef VMS
{ "%.exe", "%",
"copy $< $@" },
#else
{ "%.out", "%",
"@rm -f $@ \n cp $< $@" },
"@rm -f $@ \n cp $< $@" },
#endif
/* Syntax is "ctangle foo.w foo.ch foo.c". */
{ "%.c", "%.w %.ch",
"$(CTANGLE) $^ $@" },
"$(CTANGLE) $^ $@" },
{ "%.tex", "%.w %.ch",
"$(CWEAVE) $^ $@" },
"$(CWEAVE) $^ $@" },
{ 0, 0, 0 }
};
@@ -88,21 +86,21 @@ static struct pspec default_terminal_rules[] =
"if f$$search($@) .nes. \"\" then +$(CHECKOUT,v)" },
/* SCCS. */
/* ain't no SCCS on vms */
/* ain't no SCCS on vms */
#else
/* RCS. */
{ "%", "%,v",
"$(CHECKOUT,v)" },
"$(CHECKOUT,v)" },
{ "%", "RCS/%,v",
"$(CHECKOUT,v)" },
"$(CHECKOUT,v)" },
{ "%", "RCS/%",
"$(CHECKOUT,v)" },
"$(CHECKOUT,v)" },
/* SCCS. */
{ "%", "s.%",
"$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" },
"$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" },
{ "%", "SCCS/s.%",
"$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" },
"$(GET) $(GFLAGS) $(SCCS_OUTPUT_OPTION) $<" },
#endif /* !VMS */
{ 0, 0, 0 }
};
@@ -293,13 +291,13 @@ static char *default_suffix_rules[] =
"$(TEXI2DVI) $(TEXI2DVI_FLAGS) $<",
".w.c",
"$(CTANGLE) $< - $@", /* The `-' says there is no `.ch' file. */
"$(CTANGLE) $< - $@", /* The '-' says there is no '.ch' file. */
".web.p",
"$(TANGLE) $<",
".w.tex",
"$(CWEAVE) $< - $@", /* The `-' says there is no `.ch' file. */
"$(CWEAVE) $< - $@", /* The '-' says there is no '.ch' file. */
".web.tex",
"$(WEAVE) $<",
@@ -401,7 +399,7 @@ static const char *default_variables[] =
#ifdef GCC_IS_NATIVE
"CC", "gcc",
# ifdef __MSDOS__
"CXX", "gpp", /* g++ is an invalid name on MSDOS */
"CXX", "gpp", /* g++ is an invalid name on MSDOS */
# else
"CXX", "gcc",
# endif /* __MSDOS__ */
@@ -419,17 +417,17 @@ static const char *default_variables[] =
"COFLAGS", "",
"CPP", "$(CC) -E",
#ifdef CRAY
#ifdef CRAY
"CF77PPFLAGS", "-P",
"CF77PP", "/lib/cpp",
"CFT", "cft77",
"CF", "cf77",
"FC", "$(CF)",
#else /* Not CRAY. */
#ifdef _IBMR2
#else /* Not CRAY. */
#ifdef _IBMR2
"FC", "xlf",
#else
#ifdef __convex__
#ifdef __convex__
"FC", "fc",
#else
"FC", "f77",
@@ -439,7 +437,7 @@ static const char *default_variables[] =
However, there is no way to make implicit rules use them and FC. */
"F77", "$(FC)",
"F77FLAGS", "$(FFLAGS)",
#endif /* Cray. */
#endif /* Cray. */
"GET", SCCS_GET,
"LD", "ld",
#ifdef GCC_IS_NATIVE
@@ -449,20 +447,20 @@ static const char *default_variables[] =
#endif
"LINT", "lint",
"M2C", "m2c",
#ifdef pyr
#ifdef pyr
"PC", "pascal",
#else
#ifdef CRAY
#ifdef CRAY
"PC", "PASCAL",
"SEGLDR", "segldr",
#else
"PC", "pc",
#endif /* CRAY. */
#endif /* pyr. */
#endif /* CRAY. */
#endif /* pyr. */
#ifdef GCC_IS_NATIVE
"YACC", "bison -y",
#else
"YACC", "yacc", /* Or "bison -y" */
"YACC", "yacc", /* Or "bison -y" */
#endif
"MAKEINFO", "makeinfo",
"TEX", "tex",
@@ -508,23 +506,23 @@ static const char *default_variables[] =
"PREPROCESS.r", "$(FC) $(FFLAGS) $(RFLAGS) $(TARGET_ARCH) -F",
"LINT.c", "$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(TARGET_ARCH)",
#ifndef NO_MINUS_C_MINUS_O
#ifndef NO_MINUS_C_MINUS_O
"OUTPUT_OPTION", "-o $@",
#endif
#ifdef SCCS_GET_MINUS_G
#ifdef SCCS_GET_MINUS_G
"SCCS_OUTPUT_OPTION", "-G$@",
#endif
#ifdef _AMIGA
#if defined(_AMIGA)
".LIBPATTERNS", "%.lib",
#else
#ifdef __MSDOS__
#elif defined(__MSDOS__)
".LIBPATTERNS", "lib%.a $(DJDIR)/lib/lib%.a",
#elif defined(__APPLE__)
".LIBPATTERNS", "lib%.dylib lib%.a",
#else
".LIBPATTERNS", "lib%.so lib%.a",
#endif
#endif
#endif /* !VMS */
0, 0
@@ -567,12 +565,13 @@ install_default_suffix_rules (void)
struct file *f = enter_file (strcache_add (s[0]));
/* Don't clobber cmds given in a makefile if there were any. */
if (f->cmds == 0)
{
f->cmds = xmalloc (sizeof (struct commands));
f->cmds->fileinfo.filenm = 0;
f->cmds->commands = s[1];
f->cmds->command_lines = 0;
}
{
f->cmds = xmalloc (sizeof (struct commands));
f->cmds->fileinfo.filenm = 0;
f->cmds->commands = s[1];
f->cmds->command_lines = 0;
f->cmds->recipe_prefix = RECIPEPREFIX_DEFAULT;
}
}
}

14
dep.h
View File

@@ -1,7 +1,5 @@
/* Definitions of dependency data structures for GNU Make.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
Copyright (C) 1988-2012 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -16,9 +14,9 @@ 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/>. */
/* Flag bits for the second argument to `read_makefile'.
These flags are saved in the `changed' field of each
`struct dep' in the chain returned by `read_all_makefiles'. */
/* Flag bits for the second argument to 'read_makefile'.
These flags are saved in the 'changed' field of each
'struct dep' in the chain returned by 'read_all_makefiles'. */
#define RM_NO_DEFAULT_GOAL (1 << 0) /* Do not set default goal. */
#define RM_INCLUDED (1 << 1) /* Search makefile search path. */
@@ -27,8 +25,8 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#define RM_NOFLAG 0
/* Structure representing one dependency of a file.
Each struct file's `deps' points to a chain of these,
chained through the `next'. `stem' is the stem for this
Each struct file's 'deps' points to a chain of these,
chained through the 'next'. 'stem' is the stem for this
dep line of static pattern rule or NULL.
Note that the first two words of this match a struct nameseq. */

16
dir.c
View File

@@ -1,7 +1,5 @@
/* Directory hashing for GNU Make.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
Copyright (C) 1988-2012 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
@@ -337,7 +335,7 @@ struct directory
/* The directory's contents. This data may be shared by several
entries in the hash table, which refer to the same directory
(identified uniquely by `dev' and `ino') under different names. */
(identified uniquely by 'dev' and 'ino') under different names. */
struct directory_contents *contents;
};
@@ -410,7 +408,7 @@ static int dir_contents_file_exists_p (struct directory_contents *dir,
const char *filename);
static struct directory *find_directory (const char *name);
/* Find the directory named NAME and return its `struct directory'. */
/* Find the directory named NAME and return its 'struct directory'. */
static struct directory *
find_directory (const char *name)
@@ -482,7 +480,7 @@ find_directory (const char *name)
if (r < 0)
{
/* Couldn't stat the directory. Mark this by
setting the `contents' member to a nil pointer. */
setting the 'contents' member to a nil pointer. */
dir->contents = 0;
}
else
@@ -553,7 +551,7 @@ find_directory (const char *name)
ENULLLOOP (dc->dirstream, opendir (name));
if (dc->dirstream == 0)
/* Couldn't open the directory. Mark this by setting the
`files' member to a nil pointer. */
'files' member to a nil pointer. */
dc->dirfiles.ht_vec = 0;
else
{
@@ -805,7 +803,7 @@ file_exists_p (const char *name)
return dir_file_exists_p (dirname, slash + 1);
}
/* Mark FILENAME as `impossible' for `file_impossible_p'.
/* Mark FILENAME as 'impossible' for 'file_impossible_p'.
This means an attempt has been made to search for FILENAME
as an intermediate file, and it has failed. */
@@ -1146,7 +1144,7 @@ read_dirstream (__ptr_t stream)
struct dirfile *df = *ds->dirfile_slot++;
if (! HASH_VACANT (df) && !df->impossible)
{
/* The glob interface wants a `struct dirent', so mock one up. */
/* The glob interface wants a 'struct dirent', so mock one up. */
struct dirent *d;
unsigned int len = df->length + 1;
unsigned int sz = sizeof (*d) - sizeof (d->d_name) + len;

View File

@@ -1,6 +1,5 @@
# -*-Makefile-*-, or close enough
# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
# 2010 Free Software Foundation, Inc.
# Copyright (C) 2000-2012 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

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,5 @@
@echo off
rem Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
rem 2008, 2009, 2010 Free Software Foundation, Inc.
rem Copyright (C) 1998-2012 Free Software Foundation, Inc.
rem This file is part of GNU Make.
rem
rem GNU Make is free software; you can redistribute it and/or modify it under
@@ -55,6 +54,8 @@ echo commands.o > respf.$$$
for %%f in (job dir file misc main read remake rule implicit default variable) do echo %%f.o >> respf.$$$
for %%f in (expand function vpath hash strcache version ar arscan signame remote-stub getopt getopt1) do echo %%f.o >> respf.$$$
echo glob/libglob.a >> respf.$$$
rem gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g guile.c -o guile.o
rem echo guile.o >> respf.$$$
@echo Linking...
@echo on
gcc -o make.new @respf.$$$

View File

@@ -1,7 +1,5 @@
/* Variable expansion functions for GNU Make.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
Copyright (C) 1988-2012 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
@@ -124,7 +122,7 @@ recursively_expand_for_file (struct variable *v, struct file *file)
if (!v->exp_count)
/* Expanding V causes infinite recursion. Lose. */
fatal (*expanding_var,
_("Recursive variable `%s' references itself (eventually)"),
_("Recursive variable '%s' references itself (eventually)"),
v->name);
--v->exp_count;
}
@@ -187,7 +185,7 @@ reference_variable (char *o, const char *name, unsigned int length)
LENGTH bytes of STRING are actually scanned. If LENGTH is -1, scan until
a null byte is found.
Write the results to LINE, which must point into `variable_buffer'. If
Write the results to LINE, which must point into 'variable_buffer'. If
LINE is NULL, start at the beginning of the buffer.
Return a pointer to LINE, or to the beginning of the buffer if LINE is
NULL.
@@ -197,7 +195,7 @@ variable_expand_string (char *line, const char *string, long length)
{
struct variable *v;
const char *p, *p1;
char *abuf = NULL;
char *save;
char *o;
unsigned int line_offset;
@@ -212,16 +210,11 @@ variable_expand_string (char *line, const char *string, long length)
return (variable_buffer);
}
/* If we want a subset of the string, allocate a temporary buffer for it.
Most of the functions we use here don't work with length limits. */
if (length > 0 && string[length] != '\0')
{
abuf = xmalloc(length+1);
memcpy(abuf, string, length);
abuf[length] = '\0';
string = abuf;
}
p = string;
/* We need a copy of STRING: due to eval, it's possible that it will get
freed as we process it (it might be the value of a variable that's reset
for example). Also having a nil-terminated string is handy. */
save = length < 0 ? xstrdup (string) : xstrndup (string, length);
p = save;
while (1)
{
@@ -289,7 +282,7 @@ variable_expand_string (char *line, const char *string, long length)
}
/* If COUNT is >= 0, there were unmatched opening parens
or braces, so we go to the simple case of a variable name
such as `$($(a)'. */
such as '$($(a)'. */
if (count < 0)
{
abeg = expand_argument (beg, p); /* Expand the name. */
@@ -411,15 +404,14 @@ variable_expand_string (char *line, const char *string, long length)
++p;
}
if (abuf)
free (abuf);
free (save);
variable_buffer_output (o, "", 1);
return (variable_buffer + line_offset);
}
/* Scan LINE for variable references and expansion-function calls.
Build in `variable_buffer' the result of expanding the references and calls.
Build in 'variable_buffer' the result of expanding the references and calls.
Return the address of the resulting string, which is null-terminated
and is valid only until the next time this function is called. */
@@ -432,7 +424,7 @@ variable_expand (const char *line)
/* Expand an argument for an expansion function.
The text starting at STR and ending at END is variable-expanded
into a null-terminated string that is returned as the value.
This is done without clobbering `variable_buffer' or the current
This is done without clobbering 'variable_buffer' or the current
variable-expansion that is in progress. */
char *
@@ -499,10 +491,12 @@ variable_expand_for_file (const char *line, struct file *file)
static char *
variable_append (const char *name, unsigned int length,
const struct variable_set_list *set)
const struct variable_set_list *set, int local)
{
const struct variable *v;
char *buf = 0;
/* If this set is local and the next is not a parent, then next is local. */
int nextlocal = local && set->next_is_parent == 0;
/* If there's nothing left to check, return the empty buffer. */
if (!set)
@@ -511,14 +505,14 @@ variable_append (const char *name, unsigned int length,
/* Try to find the variable in this variable set. */
v = lookup_variable_in_set (name, length, set->set);
/* If there isn't one, look to see if there's one in a set above us. */
if (!v)
return variable_append (name, length, set->next);
/* If there isn't one, or this one is private, try the set above us. */
if (!v || (!local && v->private_var))
return variable_append (name, length, set->next, nextlocal);
/* If this variable type is append, first get any upper values.
If not, initialize the buffer. */
if (v->append)
buf = variable_append (name, length, set->next);
buf = variable_append (name, length, set->next, nextlocal);
else
buf = initialize_variable_output ();
@@ -548,7 +542,8 @@ allocated_variable_append (const struct variable *v)
variable_buffer = 0;
val = variable_append (v->name, strlen (v->name), current_variable_set_list);
val = variable_append (v->name, strlen (v->name),
current_variable_set_list, 1);
variable_buffer_output (val, "", 1);
val = variable_buffer;

55
file.c
View File

@@ -1,7 +1,5 @@
/* Target file management for GNU Make.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
Copyright (C) 1988-2012 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
@@ -202,7 +200,7 @@ enter_file (const char *name)
}
/* Rehash FILE to NAME. This is not as simple as resetting
the `hname' member, since it must be put in a new hash bucket,
the 'hname' member, since it must be put in a new hash bucket,
and possibly merged with an existing file called NAME. */
void
@@ -264,18 +262,18 @@ rehash_file (struct file *from_file, const char *to_hname)
but give a message to let the user know what's going on. */
if (to_file->cmds->fileinfo.filenm != 0)
error (&from_file->cmds->fileinfo,
_("Recipe was specified for file `%s' at %s:%lu,"),
_("Recipe was specified for file '%s' at %s:%lu,"),
from_file->name, to_file->cmds->fileinfo.filenm,
to_file->cmds->fileinfo.lineno);
else
error (&from_file->cmds->fileinfo,
_("Recipe for file `%s' was found by implicit rule search,"),
_("Recipe for file '%s' was found by implicit rule search,"),
from_file->name);
error (&from_file->cmds->fileinfo,
_("but `%s' is now considered the same file as `%s'."),
_("but '%s' is now considered the same file as '%s'."),
from_file->name, to_hname);
error (&from_file->cmds->fileinfo,
_("Recipe for `%s' will be ignored in favor of the one for `%s'."),
_("Recipe for '%s' will be ignored in favor of the one for '%s'."),
to_hname, from_file->name);
}
}
@@ -295,12 +293,12 @@ rehash_file (struct file *from_file, const char *to_hname)
merge_variable_set_lists (&to_file->variables, from_file->variables);
if (to_file->double_colon && from_file->is_target && !from_file->double_colon)
fatal (NILF, _("can't rename single-colon `%s' to double-colon `%s'"),
fatal (NILF, _("can't rename single-colon '%s' to double-colon '%s'"),
from_file->name, to_hname);
if (!to_file->double_colon && from_file->double_colon)
{
if (to_file->is_target)
fatal (NILF, _("can't rename double-colon `%s' to single-colon `%s'"),
fatal (NILF, _("can't rename double-colon '%s' to single-colon '%s'"),
from_file->name, to_hname);
else
to_file->double_colon = from_file->double_colon;
@@ -327,7 +325,7 @@ rehash_file (struct file *from_file, const char *to_hname)
}
/* Rename FILE to NAME. This is not as simple as resetting
the `name' member, since it must be put in a new hash bucket,
the 'name' member, since it must be put in a new hash bucket,
and possibly merged with an existing file called NAME. */
void
@@ -389,7 +387,7 @@ remove_intermediates (int sig)
if (!f->dontcare)
{
if (sig)
error (NILF, _("*** Deleting intermediate file `%s'"), f->name);
error (NILF, _("*** Deleting intermediate file '%s'"), f->name);
else
{
if (! doneany)
@@ -575,12 +573,11 @@ expand_deps (struct file *f)
"$*" so they'll expand properly. */
if (d->staticpattern)
{
char *o;
d->name = o = variable_expand ("");
char *o = variable_expand ("");
o = subst_expand (o, name, "%", "$*", 1, 2, 0);
*o = '\0';
free (name);
d->name = name = xstrdup (d->name);
d->name = name = xstrdup (variable_buffer);
d->staticpattern = 0;
}
@@ -637,8 +634,8 @@ reset_updating (const void *item)
f->updating = 0;
}
/* For each dependency of each file, make the `struct dep' point
at the appropriate `struct file' (which may have to be created).
/* For each dependency of each file, make the 'struct dep' point
at the appropriate 'struct file' (which may have to be created).
Also mark the files depended on by .PRECIOUS, .PHONY, .SILENT,
and various other special targets. */
@@ -772,7 +769,7 @@ snap_deps (void)
#endif
}
/* Set the `command_state' member of FILE and all its `also_make's. */
/* Set the 'command_state' member of FILE and all its 'also_make's. */
void
set_command_state (struct file *file, enum cmd_state state)
@@ -788,9 +785,10 @@ set_command_state (struct file *file, enum cmd_state state)
/* Convert an external file timestamp to internal form. */
FILE_TIMESTAMP
file_timestamp_cons (const char *fname, time_t s, int ns)
file_timestamp_cons (const char *fname, time_t stamp, long int ns)
{
int offset = ORDINARY_MTIME_MIN + (FILE_TIMESTAMP_HI_RES ? ns : 0);
FILE_TIMESTAMP s = stamp;
FILE_TIMESTAMP product = (FILE_TIMESTAMP) s << FILE_TIMESTAMP_LO_BITS;
FILE_TIMESTAMP ts = product + offset;
@@ -920,6 +918,19 @@ print_file (const void *item)
const struct file *f = item;
putchar ('\n');
if (f->cmds && f->cmds->recipe_prefix != cmd_prefix)
{
fputs (".RECIPEPREFIX = ", stdout);
cmd_prefix = f->cmds->recipe_prefix;
if (cmd_prefix != RECIPEPREFIX_DEFAULT)
putchar (cmd_prefix);
putchar ('\n');
}
if (f->variables != 0)
print_target_variables (f);
if (!f->is_target)
puts (_("# Not a target:"));
printf ("%s:%s", f->name, f->double_colon ? ":" : "");
@@ -937,7 +948,7 @@ print_file (const void *item)
? _("# Implicit rule search has been done.")
: _("# Implicit rule search has not been done."));
if (f->stem != 0)
printf (_("# Implicit/static pattern stem: `%s'\n"), f->stem);
printf (_("# Implicit/static pattern stem: '%s'\n"), f->stem);
if (f->intermediate)
puts (_("# File is an intermediate prerequisite."));
if (f->also_make != 0)
@@ -987,14 +998,14 @@ print_file (const void *item)
puts (_("# Failed to be updated."));
break;
default:
puts (_("# Invalid value in `update_status' member!"));
puts (_("# Invalid value in 'update_status' member!"));
fflush (stdout);
fflush (stderr);
abort ();
}
break;
default:
puts (_("# Invalid value in `command_state' member!"));
puts (_("# Invalid value in 'command_state' member!"));
fflush (stdout);
fflush (stderr);
abort ();

View File

@@ -1,7 +1,5 @@
/* Definition of target file data structures for GNU Make.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
Copyright (C) 1988-2012 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -19,7 +17,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Structure that represents the info on one file
that the makefile says how to make.
All of these are chained together through `next'. */
All of these are chained together through 'next'. */
#include "hash.h"
@@ -43,7 +41,7 @@ struct file
struct file *last; /* Last entry for the same file name. */
/* File that this file was renamed to. After any time that a
file could be renamed, call `check_renamed' (below). */
file could be renamed, call 'check_renamed' (below). */
struct file *renamed;
/* List of variable sets used for this file. */
@@ -63,7 +61,6 @@ struct file
short int update_status; /* Status of the last attempt to update,
or -1 if none has been made. */
enum cmd_state /* State of the commands. */
{ /* Note: It is important that cs_not_started be zero. */
cs_not_started, /* Not yet started. */
@@ -119,7 +116,7 @@ void print_file_data_base (void);
#if FILE_TIMESTAMP_HI_RES
# define FILE_TIMESTAMP_STAT_MODTIME(fname, st) \
file_timestamp_cons (fname, (st).st_mtime, (st).st_mtim.ST_MTIM_NSEC)
file_timestamp_cons (fname, (st).st_mtime, (st).ST_MTIM_NSEC)
#else
# define FILE_TIMESTAMP_STAT_MODTIME(fname, st) \
file_timestamp_cons (fname, (st).st_mtime, 0)
@@ -156,7 +153,7 @@ void print_file_data_base (void);
* 302 / 1000) \
+ 1 + 1 + 4 + 25)
FILE_TIMESTAMP file_timestamp_cons (char const *, time_t, int);
FILE_TIMESTAMP file_timestamp_cons (char const *, time_t, long int);
FILE_TIMESTAMP file_timestamp_now (int *);
void file_timestamp_sprintf (char *p, FILE_TIMESTAMP ts);
@@ -190,10 +187,10 @@ FILE_TIMESTAMP f_mtime (struct file *file, int search);
<< FILE_TIMESTAMP_LO_BITS) \
+ ORDINARY_MTIME_MIN + FILE_TIMESTAMPS_PER_S - 1)
/* 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
/* 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
different ideas about what time it is; and can also lose for `force'
different ideas about what time it is; and can also lose for 'force'
targets, which need to be considered newer than anything that depends on
them, even if said dependents' modtimes are in the future. */
#define NEW_MTIME INTEGER_TYPE_MAXIMUM (FILE_TIMESTAMP)

View File

@@ -1,7 +1,5 @@
/* Builtin function expansion for GNU Make.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
Copyright (C) 1988-2012 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
@@ -356,7 +354,7 @@ string_glob (char *line)
unsigned int idx;
chain = PARSE_FILE_SEQ (&line, struct nameseq, '\0', NULL,
/* We do not want parse_file_seq to strip `./'s.
/* We do not want parse_file_seq to strip './'s.
That would break examples like:
$(patsubst ./%.c,obj/%.o,$(wildcard ./?*.c)). */
PARSEFS_NOSTRIP|PARSEFS_NOCACHE|PARSEFS_EXISTS);
@@ -525,7 +523,7 @@ func_notdir_suffix (char *o, char **argv, const char *funcname)
int doneany =0;
unsigned int len=0;
int is_suffix = streq (funcname, "suffix");
int is_suffix = funcname[0] == 's';
int is_notdir = !is_suffix;
while ((p2 = find_next_token (&list_iterator, &len)) != 0)
{
@@ -549,7 +547,7 @@ func_notdir_suffix (char *o, char **argv, const char *funcname)
}
#ifdef HAVE_DOS_PATHS
/* Handle the case of "d:foo/bar". */
else if (streq (funcname, "notdir") && p2[0] && p2[1] == ':')
else if (is_notdir && p2[0] && p2[1] == ':')
{
p = p2 + 2;
o = variable_buffer_output (o, p, len - (p - p2));
@@ -579,11 +577,11 @@ func_basename_dir (char *o, char **argv, const char *funcname)
/* Expand the argument. */
const char *p3 = argv[0];
const char *p2;
int doneany=0;
unsigned int len=0;
int doneany = 0;
unsigned int len = 0;
int is_basename= streq (funcname, "basename");
int is_dir= !is_basename;
int is_basename = funcname[0] == 'b';
int is_dir = !is_basename;
while ((p2 = find_next_token (&p3, &len)) != 0)
{
@@ -634,7 +632,7 @@ func_addsuffix_addprefix (char *o, char **argv, const char *funcname)
{
int fixlen = strlen (argv[0]);
const char *list_iterator = argv[1];
int is_addprefix = streq (funcname, "addprefix");
int is_addprefix = funcname[3] == 'p';
int is_addsuffix = !is_addprefix;
int doneany = 0;
@@ -706,7 +704,7 @@ func_words (char *o, char **argv, const char *funcname UNUSED)
const char *word_iterator = argv[0];
char buf[20];
while (find_next_token (&word_iterator, (unsigned int *) 0) != 0)
while (find_next_token (&word_iterator, NULL) != 0)
++i;
sprintf (buf, "%d", i);
@@ -755,12 +753,12 @@ func_word (char *o, char **argv, const char *funcname UNUSED)
int i;
/* Check the first argument. */
check_numeric (argv[0], _("non-numeric first argument to `word' function"));
check_numeric (argv[0], _("non-numeric first argument to 'word' function"));
i = atoi (argv[0]);
if (i == 0)
fatal (*expanding_var,
_("first argument to `word' function must be greater than 0"));
_("first argument to 'word' function must be greater than 0"));
end_p = argv[1];
while ((p = find_next_token (&end_p, 0)) != 0)
@@ -780,14 +778,14 @@ func_wordlist (char *o, char **argv, const char *funcname UNUSED)
/* Check the arguments. */
check_numeric (argv[0],
_("non-numeric first argument to `wordlist' function"));
_("non-numeric first argument to 'wordlist' function"));
check_numeric (argv[1],
_("non-numeric second argument to `wordlist' function"));
_("non-numeric second argument to 'wordlist' function"));
start = atoi (argv[0]);
if (start < 1)
fatal (*expanding_var,
"invalid first argument to `wordlist' function: `%d'", start);
"invalid first argument to 'wordlist' function: '%d'", start);
count = atoi (argv[1]) - start + 1;
@@ -905,7 +903,6 @@ struct a_pattern
char *str;
char *percent;
int length;
int save_c;
};
static char *
@@ -919,7 +916,7 @@ func_filter_filterout (char *o, char **argv, const char *funcname)
struct a_pattern *pp;
struct hash_table a_word_table;
int is_filter = streq (funcname, "filter");
int is_filter = funcname[CSTRLEN ("filter")] == '\0';
const char *pat_iterator = argv[0];
const char *word_iterator = argv[1];
int literals = 0;
@@ -928,7 +925,9 @@ func_filter_filterout (char *o, char **argv, const char *funcname)
char *p;
unsigned int len;
/* Chop ARGV[0] up into patterns to match against the words. */
/* Chop ARGV[0] up into patterns to match against the words.
We don't need to preserve it because our caller frees all the
argument memory anyway. */
pattail = &pathead;
while ((p = find_next_token (&pat_iterator, &len)) != 0)
@@ -942,12 +941,13 @@ func_filter_filterout (char *o, char **argv, const char *funcname)
++pat_iterator;
pat->str = p;
pat->length = len;
pat->save_c = p[len];
p[len] = '\0';
pat->percent = find_percent (p);
if (pat->percent == 0)
literals++;
/* find_percent() might shorten the string so LEN is wrong. */
pat->length = strlen (pat->str);
}
*pattail = 0;
@@ -1029,9 +1029,6 @@ func_filter_filterout (char *o, char **argv, const char *funcname)
--o;
}
for (pp = pathead; pp != 0; pp = pp->next)
pp->str[pp->length] = pp->save_c;
if (hashing)
hash_free (&a_word_table, 0);
@@ -1133,21 +1130,14 @@ func_sort (char *o, char **argv, const char *funcname UNUSED)
/* Find the maximum number of words we'll have. */
t = argv[0];
wordi = 1;
while (*t != '\0')
wordi = 0;
while ((p = find_next_token (&t, NULL)) != 0)
{
char c = *(t++);
if (! isspace ((unsigned char)c))
continue;
++t;
++wordi;
while (isspace ((unsigned char)*t))
++t;
}
words = xmalloc (wordi * sizeof (char *));
words = xmalloc ((wordi == 0 ? 1 : wordi) * sizeof (char *));
/* Now assign pointers to each string in the array. */
t = argv[0];
@@ -1393,14 +1383,14 @@ func_value (char *o, char **argv, const char *funcname UNUSED)
}
/*
\r is replaced on UNIX as well. Is this desirable?
\r is replaced on UNIX as well. Is this desirable?
*/
static void
fold_newlines (char *buffer, unsigned int *length)
fold_newlines (char *buffer, unsigned int *length, int trim_newlines)
{
char *dst = buffer;
char *src = buffer;
char *last_nonnl = buffer -1;
char *last_nonnl = buffer - 1;
src[*length] = 0;
for (; *src != '\0'; ++src)
{
@@ -1416,6 +1406,10 @@ fold_newlines (char *buffer, unsigned int *length)
*dst++ = *src;
}
}
if (!trim_newlines && (last_nonnl < (dst - 2)))
last_nonnl = dst - 2;
*(++last_nonnl) = '\0';
*length = last_nonnl - buffer;
}
@@ -1437,37 +1431,70 @@ void
windows32_openpipe (int *pipedes, pid_t *pid_p, char **command_argv, char **envp)
{
SECURITY_ATTRIBUTES saAttr;
HANDLE hIn;
HANDLE hErr;
HANDLE hIn = INVALID_HANDLE_VALUE;
HANDLE hErr = INVALID_HANDLE_VALUE;
HANDLE hChildOutRd;
HANDLE hChildOutWr;
HANDLE hProcess;
HANDLE hProcess, tmpIn, tmpErr;
DWORD e;
saAttr.nLength = sizeof (SECURITY_ATTRIBUTES);
saAttr.bInheritHandle = TRUE;
saAttr.lpSecurityDescriptor = NULL;
/* Standard handles returned by GetStdHandle can be NULL or
INVALID_HANDLE_VALUE if the parent process closed them. If that
happens, we open the null device and pass its handle to
process_begin below as the corresponding handle to inherit. */
tmpIn = GetStdHandle(STD_INPUT_HANDLE);
if (DuplicateHandle (GetCurrentProcess(),
GetStdHandle(STD_INPUT_HANDLE),
tmpIn,
GetCurrentProcess(),
&hIn,
0,
TRUE,
DUPLICATE_SAME_ACCESS) == FALSE) {
fatal (NILF, _("windows32_openpipe(): DuplicateHandle(In) failed (e=%ld)\n"),
GetLastError());
if ((e = GetLastError()) == ERROR_INVALID_HANDLE) {
tmpIn = CreateFile("NUL", GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (tmpIn != INVALID_HANDLE_VALUE
&& DuplicateHandle(GetCurrentProcess(),
tmpIn,
GetCurrentProcess(),
&hIn,
0,
TRUE,
DUPLICATE_SAME_ACCESS) == FALSE)
CloseHandle(tmpIn);
}
if (hIn == INVALID_HANDLE_VALUE)
fatal (NILF, _("windows32_openpipe: DuplicateHandle(In) failed (e=%ld)\n"), e);
}
tmpErr = GetStdHandle(STD_ERROR_HANDLE);
if (DuplicateHandle(GetCurrentProcess(),
GetStdHandle(STD_ERROR_HANDLE),
tmpErr,
GetCurrentProcess(),
&hErr,
0,
TRUE,
DUPLICATE_SAME_ACCESS) == FALSE) {
fatal (NILF, _("windows32_open_pipe(): DuplicateHandle(Err) failed (e=%ld)\n"),
GetLastError());
if ((e = GetLastError()) == ERROR_INVALID_HANDLE) {
tmpErr = CreateFile("NUL", GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (tmpErr != INVALID_HANDLE_VALUE
&& DuplicateHandle(GetCurrentProcess(),
tmpErr,
GetCurrentProcess(),
&hErr,
0,
TRUE,
DUPLICATE_SAME_ACCESS) == FALSE)
CloseHandle(tmpErr);
}
if (hErr == INVALID_HANDLE_VALUE)
fatal (NILF, _("windows32_openpipe: DuplicateHandle(Err) failed (e=%ld)\n"), e);
}
if (!CreatePipe(&hChildOutRd, &hChildOutWr, &saAttr, 0))
@@ -1480,29 +1507,31 @@ windows32_openpipe (int *pipedes, pid_t *pid_p, char **command_argv, char **envp
/* make sure that CreateProcess() has Path it needs */
sync_Path_environment();
/* `sync_Path_environment' may realloc `environ', so take note of
/* 'sync_Path_environment' may realloc 'environ', so take note of
the new value. */
envp = environ;
if (!process_begin(hProcess, command_argv, envp, command_argv[0], NULL)) {
/* register process for wait */
process_register(hProcess);
process_register(hProcess);
/* set the pid for returning to caller */
*pid_p = (pid_t) hProcess;
*pid_p = (pid_t) hProcess;
/* set up to read data from child */
pipedes[0] = _open_osfhandle((intptr_t) hChildOutRd, O_RDONLY);
/* set up to read data from child */
pipedes[0] = _open_osfhandle((intptr_t) hChildOutRd, O_RDONLY);
/* this will be closed almost right away */
pipedes[1] = _open_osfhandle((intptr_t) hChildOutWr, O_APPEND);
/* this will be closed almost right away */
pipedes[1] = _open_osfhandle((intptr_t) hChildOutWr, O_APPEND);
} else {
/* reap/cleanup the failed process */
process_cleanup(hProcess);
/* close handles which were duplicated, they weren't used */
CloseHandle(hIn);
CloseHandle(hErr);
if (hIn != INVALID_HANDLE_VALUE)
CloseHandle(hIn);
if (hErr != INVALID_HANDLE_VALUE)
CloseHandle(hErr);
/* close pipe handles, they won't be used */
CloseHandle(hChildOutRd);
@@ -1521,7 +1550,7 @@ FILE *
msdos_openpipe (int* pipedes, int *pidp, char *text)
{
FILE *fpipe=0;
/* MSDOS can't fork, but it has `popen'. */
/* MSDOS can't fork, but it has 'popen'. */
struct variable *sh = lookup_variable ("SHELL", 5);
int e;
extern int dos_command_running, dos_status;
@@ -1578,12 +1607,20 @@ msdos_openpipe (int* pipedes, int *pidp, char *text)
#ifdef VMS
/* VMS can't do $(shell ...) */
char *
func_shell_base (char *o, char **argv, int trim_newlines)
{
fprintf (stderr, "This platform does not support shell\n");
die (EXIT_FAILURE);
}
#define func_shell 0
#else
#ifndef _AMIGA
static char *
func_shell (char *o, char **argv, const char *funcname UNUSED)
char *
func_shell_base (char *o, char **argv, int trim_newlines)
{
char *batch_filename = NULL;
@@ -1597,14 +1634,27 @@ func_shell (char *o, char **argv, const char *funcname UNUSED)
pid_t pid;
#ifndef __MSDOS__
#ifdef WINDOWS32
/* Reset just_print_flag. This is needed on Windows when batch files
are used to run the commands, because we normally refrain from
creating batch files under -n. */
int j_p_f = just_print_flag;
just_print_flag = 0;
#endif
/* Construct the argument list. */
command_argv = construct_command_argv (argv[0], NULL, NULL, 0,
&batch_filename);
if (command_argv == 0)
return o;
{
#ifdef WINDOWS32
just_print_flag = j_p_f;
#endif
return o;
}
#endif
/* Using a target environment for `shell' loses in cases like:
/* Using a target environment for 'shell' loses in cases like:
export var = $(shell echo foobie)
because target_environment hits a loop trying to expand $(var)
to put it in the environment. This is even more confusing when
@@ -1637,11 +1687,13 @@ func_shell (char *o, char **argv, const char *funcname UNUSED)
}
#elif defined(WINDOWS32)
windows32_openpipe (pipedes, &pid, command_argv, envp);
/* Restore the value of just_print_flag. */
just_print_flag = j_p_f;
if (pipedes[0] < 0)
{
/* open of the pipe failed, mark as failed execution */
/* Open of the pipe failed, mark as failed execution. */
shell_function_completed = -1;
return o;
}
else
@@ -1661,7 +1713,7 @@ func_shell (char *o, char **argv, const char *funcname UNUSED)
if (pid < 0)
perror_with_name (error_prefix, "spawn");
# else /* ! __EMX__ */
pid = vfork ();
pid = fork ();
if (pid < 0)
perror_with_name (error_prefix, "fork");
else if (pid == 0)
@@ -1686,7 +1738,7 @@ func_shell (char *o, char **argv, const char *funcname UNUSED)
/* Close the write side of the pipe. We test for -1, since
pipedes[1] is -1 on MS-Windows, and some versions of MS
libraries barf when `close' is called with -1. */
libraries barf when 'close' is called with -1. */
if (pipedes[1] >= 0)
close (pipedes[1]);
#endif
@@ -1747,7 +1799,7 @@ func_shell (char *o, char **argv, const char *funcname UNUSED)
{
/* The child finished normally. Replace all newlines in its output
with spaces, and put that in the variable output buffer. */
fold_newlines (buffer, &i);
fold_newlines (buffer, &i, trim_newlines);
o = variable_buffer_output (o, buffer, i);
}
@@ -1761,8 +1813,8 @@ func_shell (char *o, char **argv, const char *funcname UNUSED)
/* Do the Amiga version of func_shell. */
static char *
func_shell (char *o, char **argv, const char *funcname)
char *
func_shell_base (char *o, char **argv, int trim_newlines)
{
/* Amiga can't fork nor spawn, but I can start a program with
redirection of my choice. However, this means that we
@@ -1839,12 +1891,18 @@ func_shell (char *o, char **argv, const char *funcname)
Close (child_stdout);
fold_newlines (buffer, &i);
fold_newlines (buffer, &i, trim_newlines);
o = variable_buffer_output (o, buffer, i);
free (buffer);
return o;
}
#endif /* _AMIGA */
char *
func_shell (char *o, char **argv, const char *funcname UNUSED)
{
return func_shell_base (o, argv, 1);
}
#endif /* !VMS */
#ifdef EXPERIMENTAL
@@ -1853,7 +1911,7 @@ func_shell (char *o, char **argv, const char *funcname)
equality. Return is string-boolean, ie, the empty string is false.
*/
static char *
func_eq (char *o, char **argv, char *funcname)
func_eq (char *o, char **argv, char *funcname UNUSED)
{
int result = ! strcmp (argv[0], argv[1]);
o = variable_buffer_output (o, result ? "1" : "", result);
@@ -1865,7 +1923,7 @@ func_eq (char *o, char **argv, char *funcname)
string-boolean not operator.
*/
static char *
func_not (char *o, char **argv, char *funcname)
func_not (char *o, char **argv, char *funcname UNUSED)
{
const char *s = argv[0];
int result = 0;
@@ -1886,8 +1944,8 @@ func_not (char *o, char **argv, char *funcname)
#define ROOT_LEN 1
#endif
/* Return the absolute name of file NAME which does not contain any `.',
`..' components nor any repeated path separators ('/'). */
/* Return the absolute name of file NAME which does not contain any '.',
'..' components nor any repeated path separators ('/'). */
static char *
abspath (const char *name, char *apath)
@@ -2008,9 +2066,7 @@ func_realpath (char *o, char **argv, const char *funcname UNUSED)
const char *path = 0;
int doneany = 0;
unsigned int len = 0;
#ifndef HAVE_REALPATH
struct stat st;
#endif
PATH_VAR (in);
PATH_VAR (out);
@@ -2025,9 +2081,9 @@ func_realpath (char *o, char **argv, const char *funcname UNUSED)
#ifdef HAVE_REALPATH
realpath (in, out)
#else
abspath (in, out) && stat (out, &st) == 0
abspath (in, out)
#endif
)
&& stat (out, &st) == 0)
{
o = variable_buffer_output (o, out, strlen (out));
o = variable_buffer_output (o, " ", 1);
@@ -2043,6 +2099,45 @@ func_realpath (char *o, char **argv, const char *funcname UNUSED)
return o;
}
static char *
func_file (char *o, char **argv, const char *funcname UNUSED)
{
char *fn = argv[0];
if (fn[0] == '>')
{
FILE *fp;
const char *mode = "w";
/* We are writing a file. */
++fn;
if (fn[0] == '>')
{
mode = "a";
++fn;
}
fn = next_token (fn);
fp = fopen (fn, mode);
if (fp == NULL)
fatal (reading_file, _("open: %s: %s"), fn, strerror (errno));
else
{
int l = strlen (argv[1]);
int nl = (l == 0 || argv[1][l-1] != '\n');
if (fputs (argv[1], fp) == EOF || (nl && fputc('\n', fp) == EOF))
fatal (reading_file, _("write: %s: %s"), fn, strerror (errno));
fclose (fp);
}
}
else
fatal (reading_file, _("Invalid file operation: %s"), fn);
return o;
}
static char *
func_abspath (char *o, char **argv, const char *funcname UNUSED)
{
@@ -2130,6 +2225,7 @@ static struct function_table_entry function_table_init[] =
{ STRING_SIZE_TUPLE("and"), 1, 0, 0, func_and},
{ STRING_SIZE_TUPLE("value"), 0, 1, 1, func_value},
{ STRING_SIZE_TUPLE("eval"), 0, 1, 1, func_eval},
{ STRING_SIZE_TUPLE("file"), 1, 2, 1, func_file},
#ifdef EXPERIMENTAL
{ STRING_SIZE_TUPLE("eq"), 2, 2, 1, func_eq},
{ STRING_SIZE_TUPLE("not"), 0, 1, 1, func_not},
@@ -2147,7 +2243,7 @@ expand_builtin_function (char *o, int argc, char **argv,
{
if (argc < (int)entry_p->minimum_args)
fatal (*expanding_var,
_("insufficient number of arguments (%d) to function `%s'"),
_("insufficient number of arguments (%d) to function '%s'"),
argc, entry_p->name);
/* I suppose technically some function could do something with no
@@ -2159,7 +2255,7 @@ expand_builtin_function (char *o, int argc, char **argv,
if (!entry_p->func_ptr)
fatal (*expanding_var,
_("unimplemented on this platform: function `%s'"), entry_p->name);
_("unimplemented on this platform: function '%s'"), entry_p->name);
return entry_p->func_ptr (o, argv, entry_p->name);
}
@@ -2209,7 +2305,7 @@ handle_function (char **op, const char **stringp)
if (count >= 0)
fatal (*expanding_var,
_("unterminated call to function `%s': missing `%c'"),
_("unterminated call to function '%s': missing '%c'"),
entry_p->name, closeparen);
*stringp = end;
@@ -2276,7 +2372,7 @@ handle_function (char **op, const char **stringp)
if (entry_p->expand_args)
for (argvp=argv; *argvp != 0; ++argvp)
free (*argvp);
if (abeg)
else if (abeg)
free (abeg);
return 1;
@@ -2387,6 +2483,33 @@ func_call (char *o, char **argv, const char *funcname UNUSED)
return o + strlen (o);
}
void
define_new_function(const struct floc *flocp,
const char *name, int min, int max, int expand,
char *(*func)(char *, char **, const char *))
{
size_t len = strlen (name);
struct function_table_entry *ent = xmalloc (sizeof (struct function_table_entry));
if (len > 255)
fatal (flocp, _("Function name too long: %s\n"), name);
if (min < 0 || min > 255)
fatal (flocp, _("Invalid minimum argument count (%d) for function %s\n"),
min, name);
if (max < 0 || max > 255 || max < min)
fatal (flocp, _("Invalid maximum argument count (%d) for function %s\n"),
max, name);
ent->name = name;
ent->len = len;
ent->minimum_args = min;
ent->maximum_args = max;
ent->expand_args = expand ? 1 : 0;
ent->func_ptr = func;
hash_insert (&function_table, ent);
}
void
hash_init_function_table (void)
{

View File

@@ -1,7 +1,5 @@
/* Get the system load averages.
Copyright (C) 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2008, 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 1985-2012 Free Software Foundation, Inc.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -86,9 +84,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Exclude all the code except the test program at the end
if the system has its own `getloadavg' function.
if the system has its own 'getloadavg' function.
The declaration of `errno' is needed by the test program
The declaration of 'errno' is needed by the test program
as well as the function itself, so it comes first. */
#include <errno.h>
@@ -745,7 +743,7 @@ getloadavg (double loadavg[], int nelem)
# define LDAV_DONE
/* This call can return -1 for an error, but with good args
it's not supposed to fail. The first argument is for no
apparent reason of type `long int *'. */
apparent reason of type 'long int *'. */
dg_sys_info ((long int *) &load_info,
DG_SYS_INFO_LOAD_INFO_TYPE,
DG_SYS_INFO_LOAD_VERSION_0);

View File

@@ -3,9 +3,7 @@ NOTE: getopt is now part of the C library, so if you don't know what
"Keep this file name-space clean" means, talk to drepper@gnu.org
before changing it!
Copyright (C) 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
Copyright (C) 1987-2012 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.
@@ -83,7 +81,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#define _(msgid) gettext (msgid)
/* This version of `getopt' appears to the caller like standard Unix `getopt'
/* This version of `getopt' appears to the caller like standard Unix 'getopt'
but it behaves differently for the user, since it allows the user
to intersperse the options with the other arguments.
@@ -658,7 +656,7 @@ _getopt_internal (int argc, char *const *argv, const char *optstring,
if (ambig && !exact)
{
if (opterr)
fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
fprintf (stderr, _("%s: option '%s' is ambiguous\n"),
argv[0], argv[optind]);
nextchar += strlen (nextchar);
optind++;
@@ -682,12 +680,12 @@ _getopt_internal (int argc, char *const *argv, const char *optstring,
if (argv[optind - 1][1] == '-')
/* --option */
fprintf (stderr,
_("%s: option `--%s' doesn't allow an argument\n"),
_("%s: option '--%s' doesn't allow an argument\n"),
argv[0], pfound->name);
else
/* +option or -option */
fprintf (stderr,
_("%s: option `%c%s' doesn't allow an argument\n"),
_("%s: option '%c%s' doesn't allow an argument\n"),
argv[0], argv[optind - 1][0], pfound->name);
nextchar += strlen (nextchar);
@@ -704,7 +702,7 @@ _getopt_internal (int argc, char *const *argv, const char *optstring,
{
if (opterr)
fprintf (stderr,
_("%s: option `%s' requires an argument\n"),
_("%s: option '%s' requires an argument\n"),
argv[0], argv[optind - 1]);
nextchar += strlen (nextchar);
optopt = pfound->val;
@@ -733,11 +731,11 @@ _getopt_internal (int argc, char *const *argv, const char *optstring,
{
if (argv[optind][1] == '-')
/* --option */
fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
fprintf (stderr, _("%s: unrecognized option '--%s'\n"),
argv[0], nextchar);
else
/* +option or -option */
fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
fprintf (stderr, _("%s: unrecognized option '%c%s'\n"),
argv[0], argv[optind][0], nextchar);
}
nextchar = (char *) "";
@@ -843,7 +841,7 @@ _getopt_internal (int argc, char *const *argv, const char *optstring,
if (ambig && !exact)
{
if (opterr)
fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
fprintf (stderr, _("%s: option '-W %s' is ambiguous\n"),
argv[0], argv[optind]);
nextchar += strlen (nextchar);
optind++;
@@ -862,7 +860,7 @@ _getopt_internal (int argc, char *const *argv, const char *optstring,
{
if (opterr)
fprintf (stderr, _("\
%s: option `-W %s' doesn't allow an argument\n"),
%s: option '-W %s' doesn't allow an argument\n"),
argv[0], pfound->name);
nextchar += strlen (nextchar);
@@ -877,7 +875,7 @@ _getopt_internal (int argc, char *const *argv, const char *optstring,
{
if (opterr)
fprintf (stderr,
_("%s: option `%s' requires an argument\n"),
_("%s: option '%s' requires an argument\n"),
argv[0], argv[optind - 1]);
nextchar += strlen (nextchar);
return optstring[0] == ':' ? ':' : '?';
@@ -1003,7 +1001,7 @@ main (int argc, char **argv)
break;
case 'c':
printf ("option c with value `%s'\n", optarg);
printf ("option c with value '%s'\n", optarg);
break;
case '?':

View File

@@ -1,7 +1,5 @@
/* Declarations for getopt.
Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
Software Foundation, Inc.
Copyright (C) 1989-2012 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.

View File

@@ -1,7 +1,5 @@
/* getopt_long and getopt_long_only entry points for GNU getopt.
Copyright (C) 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
Copyright (C) 1987-1994, 1996-2012 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.
@@ -149,11 +147,11 @@ main (int argc, char **argv)
break;
case 'c':
printf ("option c with value `%s'\n", optarg);
printf ("option c with value '%s'\n", optarg);
break;
case 'd':
printf ("option d with value `%s'\n", optarg);
printf ("option d with value '%s'\n", optarg);
break;
case '?':

View File

@@ -1,6 +1,5 @@
/* Convenience header for conditional use of GNU <libintl.h>.
Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 1995-2012 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

57
gmk-default.scm Normal file
View File

@@ -0,0 +1,57 @@
;; Contents of the (gnu make) Guile module
;; Copyright (C) 2011-2012 Free Software Foundation, Inc.
;; This file is part of GNU Make.
;;
;; GNU Make is free software; you can redistribute it and/or modify it under
;; the terms of the GNU General Public License as published by the Free
;; Software Foundation; either version 3 of the License, or (at your option)
;; any later version.
;;
;; GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
;; WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
;; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
;; details.
;;
;; You should have received a copy of the GNU General Public License along
;; with this program. If not, see <http://www.gnu.org/licenses/>.
(define (to-string-maybe x)
(cond
;; In GNU make, "false" is the empty string
((or (not x)
(unspecified? x)
(variable? x)
(null? x)
(and (string? x) (string-null? x)))
#f)
;; We want something not false... not sure about this
((eq? x #t) "#t")
;; Basics
((or (symbol? x) (number? x))
(object->string x))
((char? x)
(string x))
;; Printable string (no special characters)
((and (string? x) (string-every char-set:printing x))
x)
;; No idea: fail
(else (error "Unknown object:" x))))
(define (obj-to-str x)
(let ((acc '()))
(define (walk x)
(cond ((pair? x) (walk (car x)) (walk (cdr x)))
((to-string-maybe x) => (lambda (s) (set! acc (cons s acc))))))
(walk x)
(string-join (reverse! acc))))
;; eval (GNU make eval) the input string S
(define (gmk-eval s)
(gmk-expand (format #f "$(eval ~a)" (obj-to-str s))))
;; Return the value of the GNU make variable V
(define (gmk-var v)
(gmk-expand (format #f "$(~a)" (obj-to-str v))))
;; Export the public interfaces
(export gmk-expand gmk-eval gmk-var)

119
guile.c Normal file
View File

@@ -0,0 +1,119 @@
/* GNU Guile interface for GNU Make.
Copyright (C) 2011-2012 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */
#include "make.h"
#include "debug.h"
#include "dep.h"
#include "variable.h"
#include <libguile.h>
static SCM make_mod = SCM_EOL;
static SCM obj_to_str = SCM_EOL;
/* Convert an SCM object into a string. */
static char *
cvt_scm_to_str (SCM obj)
{
return scm_to_locale_string (scm_call_1 (obj_to_str, obj));
}
/* Perform the GNU make expansion function. */
static SCM
guile_expand_wrapper (SCM obj)
{
char *str = cvt_scm_to_str (obj);
SCM ret;
char *res;
DB (DB_BASIC, (_("guile: Expanding '%s'\n"), str));
res = allocated_variable_expand (str);
ret = scm_from_locale_string (res);
free (str);
free (res);
return ret;
}
/* Invoked by scm_c_define_module(), in the context of the GNU make module. */
static void
guile_define_module (void *data UNUSED)
{
/* Ingest the predefined Guile module for GNU make. */
#include "gmk-default.h"
/* Register a subr for GNU make's eval capability. */
scm_c_define_gsubr ("gmk-expand", 1, 0, 0, guile_expand_wrapper);
/* Define the rest of the module. */
scm_c_eval_string (GUILE_module_defn);
}
/* Initialize the GNU make Guile module. */
static void *
guile_init (void *arg UNUSED)
{
/* Define the module. */
make_mod = scm_c_define_module ("gnu make", guile_define_module, NULL);
/* Get a reference to the object-to-string translator, for later. */
obj_to_str = scm_variable_ref (scm_c_module_lookup (make_mod, "obj-to-str"));
/* Import the GNU make module exports into the generic space. */
scm_c_eval_string ("(use-modules (gnu make))");
return NULL;
}
static void *
internal_guile_eval (void *arg)
{
return cvt_scm_to_str (scm_c_eval_string (arg));
}
/* This is the function registered with make */
static char *
func_guile (char *o, char **argv, const char *funcname UNUSED)
{
if (argv[0] && argv[0][0] != '\0')
{
char *str = scm_with_guile (internal_guile_eval, argv[0]);
if (str)
{
o = variable_buffer_output (o, str, strlen (str));
free (str);
}
}
return o;
}
/* ----- Public interface ----- */
/* We could send the flocp to define_new_function(), but since guile is
"kind of" built-in, that didn't seem so useful. */
int
guile_gmake_setup (const struct floc *flocp UNUSED)
{
/* Initialize the Guile interpreter. */
scm_with_guile (guile_init, NULL);
/* Create a make function "guile". */
define_new_function (NILF, "guile", 0, 1, 1, func_guile);
return 1;
}

8
hash.c
View File

@@ -26,7 +26,7 @@ static void hash_rehash __P((struct hash_table* ht));
static unsigned long round_up_2 __P((unsigned long rough));
/* Implement double hashing with open addressing. The table size is
always a power of two. The secondary (`increment') hash function
always a power of two. The secondary ('increment') hash function
is forced to return an odd-value, in order to be relatively prime
to the table size. This guarantees that the increment can
potentially hit every slot in the table during collision
@@ -61,7 +61,7 @@ hash_init (struct hash_table *ht, unsigned long size,
ht->ht_compare = hash_cmp;
}
/* Load an array of items into `ht'. */
/* Load an array of items into 'ht'. */
void
hash_load (struct hash_table *ht, void *item_table,
@@ -75,9 +75,9 @@ hash_load (struct hash_table *ht, void *item_table,
}
}
/* Returns the address of the table slot matching `key'. If `key' is
/* Returns the address of the table slot matching 'key'. If 'key' is
not found, return the address of an empty slot suitable for
inserting `key'. The caller is responsible for incrementing
inserting 'key'. The caller is responsible for incrementing
ht_fill on insertion. */
void **

12
hash.h
View File

@@ -28,9 +28,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#else /* Not C++ or ANSI C. */
# undef __P
# define __P(protos) ()
/* We can get away without defining `const' here only because in this file
it is used only inside the prototype for `fnmatch', which is elided in
non-ANSI C where `const' is problematical. */
/* We can get away without defining 'const' here only because in this file
it is used only inside the prototype for 'fnmatch', which is elided in
non-ANSI C where 'const' is problematical. */
#endif /* C++ or ANSI C. */
typedef unsigned long (*hash_func_t) __P((void const *key));
@@ -41,6 +41,9 @@ typedef void (*hash_map_arg_func_t) __P((void const *item, void *arg));
struct hash_table
{
void **ht_vec;
hash_func_t ht_hash_1; /* primary hash function */
hash_func_t ht_hash_2; /* secondary hash function */
hash_cmp_func_t ht_compare; /* comparison function */
unsigned long ht_size; /* total number of slots (power of 2) */
unsigned long ht_capacity; /* usable slots, limited by loading-factor */
unsigned long ht_fill; /* items in table */
@@ -48,9 +51,6 @@ struct hash_table
unsigned long ht_collisions; /* # of failed calls to comparison function */
unsigned long ht_lookups; /* # of queries */
unsigned int ht_rehashes; /* # of times we've expanded table */
hash_func_t ht_hash_1; /* primary hash function */
hash_func_t ht_hash_2; /* secondary hash function */
hash_cmp_func_t ht_compare; /* comparison function */
};
typedef int (*qsort_cmp_t) __P((void const *, void const *));

View File

@@ -1,7 +1,5 @@
/* Implicit rule searching for GNU Make.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
Copyright (C) 1988-2012 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
@@ -37,7 +35,7 @@ static int pattern_search (struct file *file, int archive,
int
try_implicit_rule (struct file *file, unsigned int depth)
{
DBF (DB_IMPLICIT, _("Looking for an implicit rule for `%s'.\n"));
DBF (DB_IMPLICIT, _("Looking for an implicit rule for '%s'.\n"));
/* The order of these searches was previously reversed. My logic now is
that since the non-archive search uses more information in the target
@@ -53,7 +51,7 @@ try_implicit_rule (struct file *file, unsigned int depth)
if (ar_name (file->name))
{
DBF (DB_IMPLICIT,
_("Looking for archive-member implicit rule for `%s'.\n"));
_("Looking for archive-member implicit rule for '%s'.\n"));
if (pattern_search (file, 1, depth, 0))
return 1;
}
@@ -251,7 +249,7 @@ pattern_search (struct file *file, int archive,
int file_vars_initialized = 0;
/* Nonzero if we have matched a pattern-rule target
that is not just `%'. */
that is not just '%'. */
int specific_rule_matched = 0;
struct dep dep_simple;
@@ -488,7 +486,14 @@ pattern_search (struct file *file, int archive,
dir = pathdir;
}
DBS (DB_IMPLICIT, (_("Trying pattern rule with stem `%.*s'.\n"),
if (stemlen > GET_PATH_MAX)
{
DBS (DB_IMPLICIT, (_("Stem too long: '%.*s'.\n"),
(int) stemlen, stem));
continue;
}
DBS (DB_IMPLICIT, (_("Trying pattern rule with stem '%.*s'.\n"),
(int) stemlen, stem));
strncpy (stem_str, stem, stemlen);
@@ -671,8 +676,8 @@ pattern_search (struct file *file, int archive,
second pass either since we know that will fail. */
DBS (DB_IMPLICIT,
(is_rule
? _("Rejecting impossible rule prerequisite `%s'.\n")
: _("Rejecting impossible implicit prerequisite `%s'.\n"),
? _("Rejecting impossible rule prerequisite '%s'.\n")
: _("Rejecting impossible implicit prerequisite '%s'.\n"),
d->name));
tryrules[ri].rule = 0;
@@ -685,8 +690,8 @@ pattern_search (struct file *file, int archive,
DBS (DB_IMPLICIT,
(is_rule
? _("Trying rule prerequisite `%s'.\n")
: _("Trying implicit prerequisite `%s'.\n"), d->name));
? _("Trying rule prerequisite '%s'.\n")
: _("Trying implicit prerequisite '%s'.\n"), d->name));
/* If this prereq is also explicitly mentioned for FILE,
skip all tests below since it must be built no matter
@@ -725,7 +730,7 @@ pattern_search (struct file *file, int archive,
if (vname)
{
DBS (DB_IMPLICIT,
(_("Found prerequisite `%s' as VPATH `%s'\n"),
(_("Found prerequisite '%s' as VPATH '%s'\n"),
d->name, vname));
(pat++)->name = d->name;
continue;
@@ -739,7 +744,7 @@ pattern_search (struct file *file, int archive,
if (intermed_ok)
{
DBS (DB_IMPLICIT,
(_("Looking for a rule with intermediate file `%s'.\n"),
(_("Looking for a rule with intermediate file '%s'.\n"),
d->name));
if (int_file == 0)
@@ -788,7 +793,7 @@ pattern_search (struct file *file, int archive,
file->stem = 0;
/* This rule is no longer `in use' for recursive searches. */
/* This rule is no longer 'in use' for recursive searches. */
rule->in_use = 0;
if (! failed)
@@ -890,8 +895,8 @@ pattern_search (struct file *file, int archive,
/* If the file actually existed (was not an intermediate file), and
the rule that found it was a terminal one, then we want to mark
the found file so that it will not have implicit rule search done
for it. If we are not entering a `struct file' for it now, we
indicate this with the `changed' flag. */
for it. If we are not entering a 'struct file' for it now, we
indicate this with the 'changed' flag. */
if (dep->file == 0)
dep->changed = 1;
else
@@ -935,7 +940,7 @@ pattern_search (struct file *file, int archive,
}
/* If this rule builds other targets, too, put the others into FILE's
`also_make' member. */
'also_make' member. */
if (rule->num > 1)
for (ri = 0; ri < rule->num; ++ri)

388
job.c
View File

@@ -1,7 +1,5 @@
/* Job execution and handling for GNU Make.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
Copyright (C) 1988-2012 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
@@ -108,6 +106,7 @@ static void vmsWaitForChildren (int *);
# include "sub_proc.h"
# include "w32err.h"
# include "pathstuff.h"
# define WAIT_NOHANG 1
#endif /* WINDOWS32 */
#ifdef __EMX__
@@ -153,7 +152,7 @@ int wait ();
# define WIFEXITED(x) (WTERMSIG (x) == 0)
# endif
#else /* Have `union wait'. */
#else /* Have 'union wait'. */
# define WAIT_T union wait
# ifndef WTERMSIG
@@ -172,7 +171,7 @@ int wait ();
# define WIFEXITED(x) (WTERMSIG(x) == 0)
# endif
#endif /* Don't have `union wait'. */
#endif /* Don't have 'union wait'. */
#if !defined(HAVE_UNISTD_H) && !defined(WINDOWS32)
int dup2 ();
@@ -224,7 +223,7 @@ struct child *children = 0;
unsigned int job_slots_used = 0;
/* Nonzero if the `good' standard input is in use. */
/* Nonzero if the 'good' standard input is in use. */
static int good_stdin_used = 0;
@@ -266,7 +265,16 @@ create_batch_file (char const *base, int unixy, int *fd)
char temp_path[MAXPATHLEN]; /* need to know its length */
unsigned path_size = GetTempPath(sizeof temp_path, temp_path);
int path_is_dot = 0;
unsigned uniq = 1;
/* The following variable is static so we won't try to reuse a name
that was generated a little while ago, because that file might
not be on disk yet, since we use FILE_ATTRIBUTE_TEMPORARY below,
which tells the OS it doesn't need to flush the cache to disk.
If the file is not yet on disk, we might think the name is
available, while it really isn't. This happens in parallel
builds, where Make doesn't wait for one job to finish before it
launches the next one. */
static unsigned uniq = 0;
static int second_loop = 0;
const unsigned sizemax = strlen (base) + strlen (ext) + 10;
if (path_size == 0)
@@ -275,9 +283,19 @@ create_batch_file (char const *base, int unixy, int *fd)
path_is_dot = 1;
}
++uniq;
if (uniq >= 0x10000 && !second_loop)
{
/* If we already had 64K batch files in this
process, make a second loop through the numbers,
looking for free slots, i.e. files that were
deleted in the meantime. */
second_loop = 1;
uniq = 1;
}
while (path_size > 0 &&
path_size + sizemax < sizeof temp_path &&
uniq < 0x10000)
!(uniq >= 0x10000 && second_loop))
{
unsigned size = sprintf (temp_path + path_size,
"%s%s-%x.%s",
@@ -297,7 +315,14 @@ create_batch_file (char const *base, int unixy, int *fd)
const DWORD er = GetLastError();
if (er == ERROR_FILE_EXISTS || er == ERROR_ALREADY_EXISTS)
++uniq;
{
++uniq;
if (uniq == 0x10000 && !second_loop)
{
second_loop = 1;
uniq = 1;
}
}
/* the temporary path is not guaranteed to exist */
else if (path_is_dot == 0)
@@ -437,27 +462,46 @@ is_bourne_compatible_shell (const char *path)
Append "(ignored)" if IGNORED is nonzero. */
static void
child_error (const char *target_name,
child_error (const struct file *file,
int exit_code, int exit_sig, int coredump, int ignored)
{
const char *nm;
const char *pre = "*** ";
const char *post = "";
const char *dump = "";
struct floc *flocp = &file->cmds->fileinfo;
if (ignored && silent_flag)
return;
if (exit_sig && coredump)
dump = _(" (core dumped)");
if (ignored)
{
pre = "";
post = _(" (ignored)");
}
if (! flocp->filenm)
nm = _("<builtin>");
else
{
char *a = alloca (strlen (flocp->filenm) + 1 + 11 + 1);
sprintf (a, "%s:%lu", flocp->filenm, flocp->lineno);
nm = a;
}
message (0, _("%s: recipe for target '%s' failed"), nm, file->name);
#ifdef VMS
if (!(exit_code & 1))
error (NILF,
(ignored ? _("*** [%s] Error 0x%x (ignored)")
: _("*** [%s] Error 0x%x")),
target_name, exit_code);
error (NILF, _("%s[%s] Error 0x%x%s"), pre, file->name, exit_code, post);
#else
if (exit_sig == 0)
error (NILF, ignored ? _("[%s] Error %d (ignored)") :
_("*** [%s] Error %d"),
target_name, exit_code);
error (NILF, _("%s[%s] Error %d%s"), pre, file->name, exit_code, post);
else
error (NILF, "*** [%s] %s%s",
target_name, strsignal (exit_sig),
coredump ? _(" (core dumped)") : "");
error (NILF, _("%s[%s] %s%s%s"),
pre, file->name, strsignal (exit_sig), dump, post);
#endif /* VMS */
}
@@ -498,7 +542,7 @@ child_handler (int sig UNUSED)
extern int shell_function_pid, shell_function_completed;
/* Reap all dead children, storing the returned status and the new command
state (`cs_finished') in the `file' member of the `struct child' for the
state ('cs_finished') in the 'file' member of the 'struct child' for the
dead child, and removing the child from the chain. In addition, if BLOCK
nonzero, we block in this function until we've reaped at least one
complete child, waiting for it to die if necessary. If ERR is nonzero,
@@ -509,9 +553,9 @@ reap_children (int block, int err)
{
#ifndef WINDOWS32
WAIT_T status;
#endif
/* Initially, assume we have some. */
int reap_more = 1;
#endif
#ifdef WAIT_NOHANG
# define REAP_MORE reap_more
@@ -533,7 +577,7 @@ reap_children (int block, int err)
int remote = 0;
pid_t pid;
int exit_code, exit_sig, coredump;
register struct child *lastc, *c;
struct child *lastc, *c;
int child_failed;
int any_remote, any_local;
int dontcare;
@@ -680,6 +724,7 @@ reap_children (int block, int err)
HANDLE hPID;
int werr;
HANDLE hcTID, hcPID;
DWORD dwWaitStatus = 0;
exit_code = 0;
exit_sig = 0;
coredump = 0;
@@ -703,7 +748,7 @@ reap_children (int block, int err)
}
/* wait for anything to finish */
hPID = process_wait_for_any();
hPID = process_wait_for_any(block, &dwWaitStatus);
if (hPID)
{
@@ -725,15 +770,27 @@ reap_children (int block, int err)
coredump = 0;
}
else if (dwWaitStatus == WAIT_FAILED)
{
/* The WaitForMultipleObjects() failed miserably. Punt. */
pfatal_with_name ("WaitForMultipleObjects");
}
else if (dwWaitStatus == WAIT_TIMEOUT)
{
/* No child processes are finished. Give up waiting. */
reap_more = 0;
break;
}
pid = (pid_t) hPID;
}
#endif /* WINDOWS32 */
}
/* Check if this is the child of the `shell' function. */
/* Check if this is the child of the 'shell' function. */
if (!remote && pid == shell_function_pid)
{
/* It is. Leave an indicator for the `shell' function. */
/* It is. Leave an indicator for the 'shell' function. */
if (exit_sig == 0 && exit_code == 127)
shell_function_completed = -1;
else
@@ -760,11 +817,16 @@ reap_children (int block, int err)
c, pid2str (c->pid), c->remote ? _(" (remote)") : ""));
if (c->sh_batch_file) {
int rm_status;
DB (DB_JOBS, (_("Cleaning up temp batch file %s\n"),
c->sh_batch_file));
/* just try and remove, don't care if this fails */
remove (c->sh_batch_file);
errno = 0;
rm_status = remove (c->sh_batch_file);
if (rm_status)
DB (DB_JOBS, (_("Cleaning up temp batch file %s failed (%d)\n"),
c->sh_batch_file, errno));
/* all done with memory */
free (c->sh_batch_file);
@@ -784,7 +846,7 @@ reap_children (int block, int err)
static int delete_on_error = -1;
if (!dontcare)
child_error (c->file->name, exit_code, exit_sig, coredump, 0);
child_error (c->file, exit_code, exit_sig, coredump, 0);
c->file->update_status = 2;
if (delete_on_error == -1)
@@ -800,8 +862,7 @@ reap_children (int block, int err)
if (child_failed)
{
/* The commands failed, but we don't care. */
child_error (c->file->name,
exit_code, exit_sig, coredump, 1);
child_error (c->file, exit_code, exit_sig, coredump, 1);
child_failed = 0;
}
@@ -908,6 +969,19 @@ free_child (struct child *child)
/* If we're using the jobserver and this child is not the only outstanding
job, put a token back into the pipe for it. */
#ifdef WINDOWS32
if (has_jobserver_semaphore() && jobserver_tokens > 1)
{
if (! release_jobserver_semaphore())
{
DWORD err = GetLastError();
fatal (NILF, _("release jobserver semaphore: (Error %ld: %s)"),
err, map_windows32_error_to_string(err));
}
DB (DB_JOBS, (_("Released token for child %p (%s).\n"), child, child->file->name));
}
#else
if (job_fds[1] >= 0 && jobserver_tokens > 1)
{
char token = '+';
@@ -922,6 +996,7 @@ free_child (struct child *child)
DB (DB_JOBS, (_("Released token for child %p (%s).\n"),
child, child->file->name));
}
#endif
--jobserver_tokens;
@@ -973,7 +1048,7 @@ unblock_sigs (void)
}
#endif
#ifdef MAKE_JOBSERVER
#if defined(MAKE_JOBSERVER) && !defined(WINDOWS32)
RETSIGTYPE
job_noop (int sig UNUSED)
{
@@ -1018,7 +1093,7 @@ set_child_handler_action_flags (int set_handler, int set_alarm)
CHILD is updated to reflect the commands and ID of the child process.
NOTE: On return fatal signals are blocked! The caller is responsible
for calling `unblock_sigs', once the new child is safely on the chain so
for calling 'unblock_sigs', once the new child is safely on the chain so
it can be cleaned up in the event of a fatal signal. */
static void
@@ -1070,8 +1145,23 @@ start_job_command (struct child *child)
child->file->cmds->lines_flags[child->command_line - 1]
|= flags & COMMANDS_RECURSE;
/* Figure out an argument list from this command line. */
/* POSIX requires that a recipe prefix after a backslash-newline should
be ignored. Remove it now so the output is correct. */
{
char prefix = child->file->cmds->recipe_prefix;
char *p1, *p2;
p1 = p2 = p;
while (*p1 != '\0')
{
*(p2++) = *p1;
if (p1[0] == '\n' && p1[1] == prefix)
++p1;
++p1;
}
*p2 = *p1;
}
/* Figure out an argument list from this command line. */
{
char *end = 0;
#ifdef VMS
@@ -1079,7 +1169,7 @@ start_job_command (struct child *child)
#else
argv = construct_command_argv (p, &end, child->file,
child->file->cmds->lines_flags[child->command_line - 1],
&child->sh_batch_file);
&child->sh_batch_file);
#endif
if (end == NULL)
child->command_ptr = NULL;
@@ -1090,9 +1180,9 @@ start_job_command (struct child *child)
}
}
/* If -q was given, say that updating `failed' if there was any text on the
command line, or `succeeded' otherwise. The exit status of 1 tells the
user that -q is saying `something to do'; the exit status for a random
/* If -q was given, say that updating 'failed' if there was any text on the
command line, or 'succeeded' otherwise. The exit status of 1 tells the
user that -q is saying 'something to do'; the exit status for a random
error is 2. */
if (argv != 0 && question_flag && !(flags & COMMANDS_RECURSE))
{
@@ -1139,11 +1229,12 @@ start_job_command (struct child *child)
return;
}
/* Print out the command. If silent, we call `message' with null so it
/* Print out the command. If silent, we call 'message' with null so it
can log the working directory before the command's own error messages
appear. */
message (0, (just_print_flag || (!(flags & COMMANDS_SILENT) && !silent_flag))
message (0, (just_print_flag || trace_flag
|| (!(flags & COMMANDS_SILENT) && !silent_flag))
? "%s" : (char *) 0, p);
/* Tell update_goal_chain that a command has been started on behalf of
@@ -1224,8 +1315,8 @@ start_job_command (struct child *child)
#endif /* !WINDOWS32 && !_AMIGA && !__MSDOS__ */
/* Decide whether to give this child the `good' standard input
(one that points to the terminal or whatever), or the `bad' one
/* Decide whether to give this child the 'good' standard input
(one that points to the terminal or whatever), or the 'bad' one
that points to the read side of a broken pipe. */
child->good_stdin = !good_stdin_used;
@@ -1367,25 +1458,25 @@ start_job_command (struct child *child)
block_sigs ();
dos_status = 0;
/* We call `system' to do the job of the SHELL, since stock DOS
shell is too dumb. Our `system' knows how to handle long
/* We call 'system' to do the job of the SHELL, since stock DOS
shell is too dumb. Our 'system' knows how to handle long
command lines even if pipes/redirection is needed; it will only
call COMMAND.COM when its internal commands are used. */
if (execute_by_shell)
{
char *cmdline = argv[0];
/* We don't have a way to pass environment to `system',
/* We don't have a way to pass environment to 'system',
so we need to save and restore ours, sigh... */
char **parent_environ = environ;
environ = child->environment;
/* If we have a *real* shell, tell `system' to call
/* If we have a *real* shell, tell 'system' to call
it to do everything for us. */
if (unixy_shell)
{
/* A *real* shell on MSDOS may not support long
command lines the DJGPP way, so we must use `system'. */
command lines the DJGPP way, so we must use 'system'. */
cmdline = argv[2]; /* get past "shell -c" */
}
@@ -1485,7 +1576,7 @@ start_job_command (struct child *child)
/* Try to start a child running.
Returns nonzero if the child was started (and maybe finished), or zero if
the load was too high and the child was put on the `waiting_jobs' chain. */
the load was too high and the child was put on the 'waiting_jobs' chain. */
static int
start_waiting_job (struct child *c)
@@ -1549,7 +1640,7 @@ start_waiting_job (struct child *c)
return 1;
}
/* Create a `struct child' for FILE and start its commands running. */
/* Create a 'struct child' for FILE and start its commands running. */
void
new_job (struct file *file)
@@ -1672,7 +1763,7 @@ new_job (struct file *file)
}
/* Start the command sequence, record it in a new
`struct child', and add that to the chain. */
'struct child', and add that to the chain. */
c = xcalloc (sizeof (struct child));
c->file = file;
@@ -1706,12 +1797,18 @@ new_job (struct file *file)
just once). Also more thought needs to go into the entire algorithm;
this is where the old parallel job code waits, so... */
#ifdef WINDOWS32
else if (has_jobserver_semaphore())
#else
else if (job_fds[0] >= 0)
#endif
while (1)
{
char token;
int got_token;
#ifndef WINDOWS32
char token;
int saved_errno;
#endif
DB (DB_JOBS, ("Need a job token; we %shave children\n",
children ? "" : "don't "));
@@ -1720,6 +1817,7 @@ new_job (struct file *file)
if (!jobserver_tokens)
break;
#ifndef WINDOWS32
/* Read a token. As long as there's no token available we'll block.
We enable interruptible system calls before the read(2) so that if
we get a SIGCHLD while we're waiting, we'll return with EINTR and
@@ -1748,6 +1846,7 @@ new_job (struct file *file)
DB (DB_JOBS, ("Duplicate the job FD\n"));
job_rfd = dup (job_fds[0]);
}
#endif
/* Reap anything that's currently waiting. */
reap_children (0, 0);
@@ -1766,11 +1865,24 @@ new_job (struct file *file)
if (!children)
fatal (NILF, "INTERNAL: no children as we go to sleep on read\n");
#ifdef WINDOWS32
/* On Windows we simply wait for the jobserver semaphore to become
* signalled or one of our child processes to terminate.
*/
got_token = wait_for_semaphore_or_child_process();
if (got_token < 0)
{
DWORD err = GetLastError();
fatal (NILF, _("semaphore or child process wait: (Error %ld: %s)"),
err, map_windows32_error_to_string(err));
}
#else
/* Set interruptible system calls, and read() for a job token. */
set_child_handler_action_flags (1, waiting_jobs != NULL);
got_token = read (job_rfd, &token, 1);
saved_errno = errno;
set_child_handler_action_flags (0, waiting_jobs != NULL);
#endif
/* If we got one, we're done here. */
if (got_token == 1)
@@ -1780,6 +1892,7 @@ new_job (struct file *file)
break;
}
#ifndef WINDOWS32
/* If the error _wasn't_ expected (EINTR or EBADF), punt. Otherwise,
go back and reap_children(), and try again. */
errno = saved_errno;
@@ -1787,27 +1900,44 @@ new_job (struct file *file)
pfatal_with_name (_("read jobs pipe"));
if (errno == EBADF)
DB (DB_JOBS, ("Read returned EBADF.\n"));
#endif
}
#endif
++jobserver_tokens;
/* Trace the build.
Use message here so that changes to working directories are logged. */
if (trace_flag)
{
char *newer = allocated_variable_expand_for_file ("$?", c->file);
char *nm;
if (! cmds->fileinfo.filenm)
nm = _("<builtin>");
else
{
nm = alloca (strlen (cmds->fileinfo.filenm) + 1 + 11 + 1);
sprintf (nm, "%s:%lu", cmds->fileinfo.filenm, cmds->fileinfo.lineno);
}
if (newer[0] == '\0')
message (0, _("%s: target '%s' does not exist"), nm, c->file->name);
else
message (0, _("%s: update target '%s' due to: %s"), nm,
c->file->name, newer);
free (newer);
}
/* The job is now primed. Start it running.
(This will notice if there is in fact no recipe.) */
if (cmds->fileinfo.filenm)
DB (DB_BASIC, (_("Invoking recipe from %s:%lu to update target `%s'.\n"),
cmds->fileinfo.filenm, cmds->fileinfo.lineno,
c->file->name));
else
DB (DB_BASIC, (_("Invoking builtin recipe to update target `%s'.\n"),
c->file->name));
start_waiting_job (c);
if (job_slots == 1 || not_parallel)
/* Since there is only one job slot, make things run linearly.
Wait for the child to die, setting the state to `cs_finished'. */
Wait for the child to die, setting the state to 'cs_finished'. */
while (file->command_state == cs_running)
reap_children (1, 0);
@@ -2100,7 +2230,7 @@ exec_command (char **argv, char **envp)
}
/* wait and reap last child */
hWaitPID = process_wait_for_any();
hWaitPID = process_wait_for_any(1, 0);
while (hWaitPID)
{
/* was an error found on this process? */
@@ -2267,7 +2397,7 @@ void clean_tmp (void)
#ifndef VMS
/* Figure out the argument list necessary to run LINE as a command. Try to
avoid using a shell. This routine handles only ' quoting, and " quoting
when no backslash, $ or ` characters are seen in the quotes. Starting
when no backslash, $ or ' characters are seen in the quotes. Starting
quotes may be escaped with a backslash. If any of the characters in
sh_chars[] is seen, or any of the builtin commands listed in sh_cmds[]
is the first word of a line, the shell is used.
@@ -2286,26 +2416,26 @@ void clean_tmp (void)
static char **
construct_command_argv_internal (char *line, char **restp, char *shell,
char *shellflags, char *ifs, int flags,
char **batch_filename_ptr)
char **batch_filename UNUSED)
{
#ifdef __MSDOS__
/* MSDOS supports both the stock DOS shell and ports of Unixy shells.
We call `system' for anything that requires ``slow'' processing,
We call 'system' for anything that requires ''slow'' processing,
because DOS shells are too dumb. When $SHELL points to a real
(unix-style) shell, `system' just calls it to do everything. When
$SHELL points to a DOS shell, `system' does most of the work
(unix-style) shell, 'system' just calls it to do everything. When
$SHELL points to a DOS shell, 'system' does most of the work
internally, calling the shell only for its internal commands.
However, it looks on the $PATH first, so you can e.g. have an
external command named `mkdir'.
external command named 'mkdir'.
Since we call `system', certain characters and commands below are
Since we call 'system', certain characters and commands below are
actually not specific to COMMAND.COM, but to the DJGPP implementation
of `system'. In particular:
of 'system'. In particular:
The shell wildcard characters are in DOS_CHARS because they will
not be expanded if we call the child via `spawnXX'.
not be expanded if we call the child via 'spawnXX'.
The `;' is in DOS_CHARS, because our `system' knows how to run
The ';' is in DOS_CHARS, because our 'system' knows how to run
multiple commands on a single line.
DOS_CHARS also include characters special to 4DOS/NDOS, so we
@@ -2367,7 +2497,14 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
"unset", "unsetenv", "version",
0 };
#elif defined (WINDOWS32)
static char sh_chars_dos[] = "\"|&<>";
/* We used to have a double quote (") in sh_chars_dos[] below, but
that caused any command line with quoted file names be run
through a temporary batch file, which introduces command-line
limit of 4K charcaters imposed by cmd.exe. Since CreateProcess
can handle quoted file names just fine, removing the quote lifts
the limit from a very frequent use case, because using quoted
file names is commonplace on MS-Windows. */
static char sh_chars_dos[] = "|&<>";
static char *sh_cmds_dos[] = { "assoc", "break", "call", "cd", "chcp",
"chdir", "cls", "color", "copy", "ctty",
"date", "del", "dir", "echo", "echo.",
@@ -2434,6 +2571,9 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
if (*line == '\0')
return 0;
if (shellflags == 0)
shellflags = posix_pedantic ? "-ec" : "-c";
/* See if it is safe to parse commands internally. */
if (shell == 0)
shell = default_shell;
@@ -2458,7 +2598,7 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
{
extern int _is_unixy_shell (const char *_path);
DB (DB_BASIC, (_("$SHELL changed (was `%s', now `%s')\n"),
DB (DB_BASIC, (_("$SHELL changed (was '%s', now '%s')\n"),
default_shell, shell));
unixy_shell = _is_unixy_shell (shell);
/* we must allocate a copy of shell: construct_command_argv() will free
@@ -2529,10 +2669,9 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
{
/* Backslash-newline is handled differently depending on what
kind of string we're in: inside single-quoted strings you
keep them; in double-quoted strings they disappear.
For DOS/Windows/OS2, if we don't have a POSIX shell,
we keep the pre-POSIX behavior of removing the
backslash-newline. */
keep them; in double-quoted strings they disappear. For
DOS/Windows/OS2, if we don't have a POSIX shell, we keep the
pre-POSIX behavior of removing the backslash-newline. */
if (instring == '"'
#if defined (__MSDOS__) || defined (__EMX__) || defined (WINDOWS32)
|| !unixy_shell
@@ -2557,6 +2696,10 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
quotes have the same effect. */
else if (instring == '"' && strchr ("\\$`", *p) != 0 && unixy_shell)
goto slow;
#ifdef WINDOWS32
else if (instring == '"' && strncmp (p, "\\\"", 2) == 0)
*ap++ = *++p;
#endif
else
*ap++ = *p;
}
@@ -2568,7 +2711,7 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
goto slow;
#ifdef __MSDOS__
else if (*p == '.' && p[1] == '.' && p[2] == '.' && p[3] != '.')
/* `...' is a wildcard in DJGPP. */
/* '...' is a wildcard in DJGPP. */
goto slow;
#endif
else
@@ -2657,10 +2800,10 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
last_argument_was_empty = 0;
/* Update SEEN_NONEQUALS, which tells us if every word
heretofore has contained an `='. */
heretofore has contained an '='. */
seen_nonequals |= ! word_has_equals;
if (word_has_equals && ! seen_nonequals)
/* An `=' in a word before the first
/* An '=' in a word before the first
word without one is magical. */
goto slow;
word_has_equals = 0; /* Prepare for the next word. */
@@ -2735,7 +2878,7 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
}
#ifdef __MSDOS__
execute_by_shell = 1; /* actually, call `system' if shell isn't unixy */
execute_by_shell = 1; /* actually, call 'system' if shell isn't unixy */
#endif
#ifdef _AMIGA
@@ -2792,12 +2935,12 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
unsigned int shell_len = strlen (shell);
unsigned int line_len = strlen (line);
unsigned int sflags_len = strlen (shellflags);
unsigned int sflags_len = shellflags ? strlen (shellflags) : 0;
char *command_ptr = NULL; /* used for batch_mode_shell mode */
char *new_line;
# ifdef __EMX__ /* is this necessary? */
if (!unixy_shell)
if (!unixy_shell && shellflags)
shellflags[0] = '/'; /* "/c" */
# endif
@@ -2857,21 +3000,48 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
*t = '\0';
}
new_argv = xmalloc (4 * sizeof (char *));
new_argv[0] = xstrdup(shell);
new_argv[1] = xstrdup(shellflags);
new_argv[2] = line;
new_argv[3] = NULL;
/* Create an argv list for the shell command line. */
{
int n = 0;
new_argv = xmalloc ((4 + sflags_len/2) * sizeof (char *));
new_argv[n++] = xstrdup (shell);
/* Chop up the shellflags (if any) and assign them. */
if (! shellflags)
new_argv[n++] = xstrdup ("");
else
{
const char *s = shellflags;
char *t;
unsigned int len;
while ((t = find_next_token (&s, &len)) != 0)
new_argv[n++] = xstrndup (t, len);
}
/* Set the command to invoke. */
new_argv[n++] = line;
new_argv[n++] = NULL;
}
return new_argv;
}
new_line = alloca (shell_len + 1 + sflags_len + 1
+ (line_len*2) + 1);
new_line = xmalloc ((shell_len*2) + 1 + sflags_len + 1
+ (line_len*2) + 1);
ap = new_line;
memcpy (ap, shell, shell_len);
ap += shell_len;
/* Copy SHELL, escaping any characters special to the shell. If
we don't escape them, construct_command_argv_internal will
recursively call itself ad nauseam, or until stack overflow,
whichever happens first. */
for (p = shell; *p != '\0'; ++p)
{
if (strchr (sh_chars, *p) != 0)
*(ap++) = '\\';
*(ap++) = *p;
}
*(ap++) = ' ';
memcpy (ap, shellflags, sflags_len);
if (shellflags)
memcpy (ap, shellflags, sflags_len);
ap += sflags_len;
*(ap++) = ' ';
command_ptr = ap;
@@ -2915,7 +3085,7 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
#ifdef __MSDOS__
else if (unixy_shell && strneq (p, "...", 3))
{
/* The case of `...' wildcard again. */
/* The case of '...' wildcard again. */
strcpy (ap, "\\.\\.\\");
ap += 5;
p += 2;
@@ -2924,8 +3094,11 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
*ap++ = *p;
}
if (ap == new_line + shell_len + sflags_len + 2)
/* Line was empty. */
return 0;
{
/* Line was empty. */
free (new_line);
return 0;
}
*ap = '\0';
#ifdef WINDOWS32
@@ -2938,7 +3111,7 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
new_argv = xmalloc(2 * sizeof (char *));
new_argv[0] = xstrdup ("");
new_argv[1] = NULL;
} else if ((no_default_sh_exe || batch_mode_shell) && batch_filename_ptr) {
} else if ((no_default_sh_exe || batch_mode_shell) && batch_filename) {
int temp_fd;
FILE* batch = NULL;
int id = GetCurrentProcessId();
@@ -2946,10 +3119,10 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
/* create a file name */
sprintf(fbuf, "make%d", id);
*batch_filename_ptr = create_batch_file (fbuf, unixy_shell, &temp_fd);
*batch_filename = create_batch_file (fbuf, unixy_shell, &temp_fd);
DB (DB_JOBS, (_("Creating temporary batch file %s\n"),
*batch_filename_ptr));
*batch_filename));
/* Create a FILE object for the batch file, and write to it the
commands to be executed. Put the batch file in TEXT mode. */
@@ -2967,9 +3140,9 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
new_argv = xmalloc(3 * sizeof (char *));
if (unixy_shell) {
new_argv[0] = xstrdup (shell);
new_argv[1] = *batch_filename_ptr; /* only argv[0] gets freed later */
new_argv[1] = *batch_filename; /* only argv[0] gets freed later */
} else {
new_argv[0] = xstrdup (*batch_filename_ptr);
new_argv[0] = xstrdup (*batch_filename);
new_argv[1] = NULL;
}
new_argv[2] = NULL;
@@ -2977,7 +3150,8 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
#endif /* WINDOWS32 */
if (unixy_shell)
new_argv = construct_command_argv_internal (new_line, 0, 0, 0, 0, flags, 0);
new_argv = construct_command_argv_internal (new_line, 0, 0, 0, 0,
flags, 0);
#ifdef __EMX__
else if (!unixy_shell)
@@ -3065,6 +3239,8 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
fatal (NILF, _("%s (line %d) Bad shell context (!unixy && !batch_mode_shell)\n"),
__FILE__, __LINE__);
#endif
free (new_line);
}
#endif /* ! AMIGA */
@@ -3074,7 +3250,7 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
/* Figure out the argument list necessary to run LINE as a command. Try to
avoid using a shell. This routine handles only ' quoting, and " quoting
when no backslash, $ or ` characters are seen in the quotes. Starting
when no backslash, $ or ' characters are seen in the quotes. Starting
quotes may be escaped with a backslash. If any of the characters in
sh_chars[] is seen, or any of the builtin commands listed in sh_cmds[]
is the first word of a line, the shell is used.
@@ -3087,7 +3263,7 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
char **
construct_command_argv (char *line, char **restp, struct file *file,
int cmd_flags, char **batch_filename_ptr)
int cmd_flags, char **batch_filename)
{
char *shell, *ifs, *shellflags;
char **argv;
@@ -3201,7 +3377,7 @@ construct_command_argv (char *line, char **restp, struct file *file,
}
argv = construct_command_argv_internal (line, restp, shell, shellflags, ifs,
cmd_flags, batch_filename_ptr);
cmd_flags, batch_filename);
free (shell);
free (shellflags);

18
job.h
View File

@@ -1,7 +1,5 @@
/* Definitions for managing subprocesses in GNU Make.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
Foundation, Inc.
Copyright (C) 1992-2012 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
@@ -45,22 +43,20 @@ struct child
struct file *file; /* File being remade. */
char **environment; /* Environment for commands. */
char *sh_batch_file; /* Script file for shell commands */
char **command_lines; /* Array of variable-expanded cmd lines. */
unsigned int command_line; /* Index into above. */
char *command_ptr; /* Ptr into command_lines[command_line]. */
pid_t pid; /* Child process's ID number. */
#ifdef VMS
char *comname; /* Temporary command file name */
int efn; /* Completion event flag number */
int cstatus; /* Completion status */
char *comname; /* Temporary command file name */
#endif
char *sh_batch_file; /* Script file for shell commands */
unsigned int command_line; /* Index into command_lines. */
pid_t pid; /* Child process's ID number. */
unsigned int remote:1; /* Nonzero if executing remotely. */
unsigned int noerror:1; /* Nonzero if commands contained a `-'. */
unsigned int noerror:1; /* Nonzero if commands contained a '-'. */
unsigned int good_stdin:1; /* Nonzero if this child has a good stdin. */
unsigned int deleted:1; /* Nonzero if targets have been deleted. */
unsigned int dontcare:1; /* Saved dontcare flag. */

157
load.c Normal file
View File

@@ -0,0 +1,157 @@
/* Loading dynamic objects for GNU Make.
Copyright (C) 2012 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */
#include "make.h"
#if MAKE_LOAD
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <dlfcn.h>
#include <errno.h>
#define SYMBOL_EXTENSION "_gmake_setup"
static void *global_dl = NULL;
#include "debug.h"
#include "filedef.h"
#include "variable.h"
static int
init_symbol (const struct floc *flocp, const char *ldname, load_func_t symp)
{
int r;
const char *p;
int nmlen = strlen (ldname);
char *loaded = allocated_variable_expand("$(.LOADED)");
/* If it's already been loaded don't do it again. */
p = strstr (loaded, ldname);
r = p && (p==loaded || p[-1]==' ') && (p[nmlen]=='\0' || p[nmlen]==' ');
free (loaded);
if (r)
return 1;
/* Now invoke the symbol. */
r = (*symp) (flocp);
/* If it succeeded, add the symbol to the loaded variable. */
if (r > 0)
do_variable_definition (flocp, ".LOADED", ldname, o_default, f_append, 0);
return r;
}
int
load_file (const struct floc *flocp, const char *ldname, int noerror)
{
load_func_t symp;
const char *fp;
char *symname = NULL;
char *new = alloca (strlen (ldname) + CSTRLEN (SYMBOL_EXTENSION) + 1);
if (! global_dl)
{
global_dl = dlopen (NULL, RTLD_NOW|RTLD_GLOBAL);
if (! global_dl)
fatal (flocp, _("Failed to open global symbol table: %s"), dlerror());
}
/* If a symbol name was provided, use it. */
fp = strchr (ldname, '(');
if (fp)
{
const char *ep;
/* If there's an open paren, see if there's a close paren: if so use
that as the symbol name. We can't have whitespace: it would have
been chopped up before this function is called. */
ep = strchr (fp+1, ')');
if (ep && ep[1] == '\0')
{
int l = fp - ldname;;
++fp;
if (fp == ep)
fatal (flocp, _("Empty symbol name for load: %s"), ldname);
/* Make a copy of the ldname part. */
memcpy (new, ldname, l);
new[l] = '\0';
ldname = new;
/* Make a copy of the symbol name part. */
symname = new + l + 1;
memcpy (symname, fp, ep - fp);
symname[ep - fp] = '\0';
}
}
/* If we didn't find a symbol name yet, construct it from the ldname. */
if (! symname)
{
char *p = new;
fp = strrchr (ldname, '/');
if (!fp)
fp = ldname;
else
++fp;
while (isalnum (*fp) || *fp == '_')
*(p++) = *(fp++);
strcpy (p, SYMBOL_EXTENSION);
symname = new;
}
DB (DB_VERBOSE, (_("Loading symbol %s from %s\n"), symname, ldname));
/* See if it's already defined. */
symp = (load_func_t) dlsym (global_dl, symname);
if (! symp) {
void *dlp = dlopen (ldname, RTLD_LAZY|RTLD_GLOBAL);
if (! dlp)
{
if (noerror)
DB (DB_BASIC, ("%s", dlerror()));
else
error (flocp, "%s", dlerror());
return 0;
}
symp = dlsym (dlp, symname);
if (! symp)
fatal (flocp, _("Failed to load symbol %s from %s: %s"),
symname, ldname, dlerror());
}
/* Invoke the symbol to initialize the loaded object. */
return init_symbol(flocp, ldname, symp);
}
#else
int
load_file (const struct floc *flocp, const char *ldname, int noerror)
{
if (! noerror)
fatal (flocp, _("The 'load' operation is not supported on this platform."));
return 0;
}
#endif /* MAKE_LOAD */

230
main.c
View File

@@ -1,7 +1,5 @@
/* Argument parsing and main program of GNU Make.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
Copyright (C) 1988-2012 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
@@ -32,9 +30,11 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
# include <proto/dos.h>
#endif
#ifdef WINDOWS32
#include <windows.h>
#include <io.h>
#include "pathstuff.h"
# include <windows.h>
# include <io.h>
# include "pathstuff.h"
# include "sub_proc.h"
# include "w32err.h"
#endif
#ifdef __EMX__
# include <sys/types.h>
@@ -151,9 +151,9 @@ static int debug_flag = 0;
int db_level = 0;
/* Output level (--verbosity). */
/* Tracing (--trace). */
static struct stringlist *verbosity_flags;
int trace_flag = 0;
#ifdef WINDOWS32
/* Suspend make in main for a short time to allow debugger to attach */
@@ -358,6 +358,8 @@ static const char *const usage[] =
N_("\
-t, --touch Touch targets instead of remaking them.\n"),
N_("\
--trace Print tracing information.\n"),
N_("\
-v, --version Print the version number of make and exit.\n"),
N_("\
-w, --print-directory Print the current directory.\n"),
@@ -414,9 +416,8 @@ static const struct command_switch switches[] =
{ 'S', flag_off, &keep_going_flag, 1, 1, 0, 0, &default_keep_going_flag,
"no-keep-going" },
{ 't', flag, &touch_flag, 1, 1, 1, 0, 0, "touch" },
{ CHAR_MAX+3, flag, &trace_flag, 1, 1, 0, 0, 0, "trace" },
{ 'v', flag, &print_version_flag, 1, 1, 0, 0, 0, "version" },
{ CHAR_MAX+3, string, &verbosity_flags, 1, 1, 0, 0, 0,
"verbosity" },
{ 'w', flag, &print_directory_flag, 1, 1, 0, 0, 0, "print-directory" },
{ CHAR_MAX+4, flag, &inhibit_print_directory_flag, 1, 1, 0, 0, 0,
"no-print-directory" },
@@ -486,7 +487,7 @@ struct variable * default_goal_var;
struct file *default_file;
/* Nonzero if we have seen the magic `.POSIX' target.
/* Nonzero if we have seen the magic '.POSIX' target.
This turns on pedantic compliance with POSIX.2. */
int posix_pedantic;
@@ -502,7 +503,7 @@ int second_expansion;
int one_shell;
/* Nonzero if we have seen the `.NOTPARALLEL' target.
/* Nonzero if we have seen the '.NOTPARALLEL' target.
This turns off parallel builds for this invocation of make. */
int not_parallel;
@@ -647,7 +648,7 @@ decode_debug_flags (void)
db_level |= DB_BASIC | DB_VERBOSE;
break;
default:
fatal (NILF, _("unknown debug level specification `%s'"), p);
fatal (NILF, _("unknown debug level specification '%s'"), p);
}
while (*(++p) != '\0')
@@ -907,7 +908,6 @@ open_tmpfile(char **name, const char *template)
#endif
}
#ifdef _AMIGA
int
main (int argc, char **argv)
@@ -955,12 +955,12 @@ main (int argc, char **argv, char **envp)
#endif
/* Needed for OS/2 */
initialize_main(&argc, &argv);
initialize_main (&argc, &argv);
reading_file = 0;
#if defined (__MSDOS__) && !defined (_POSIX_SOURCE)
/* Request the most powerful version of `system', to
/* Request the most powerful version of 'system', to
make up for the dumb default shell. */
__system_flags = (__system_redirect
| __system_use_shell
@@ -986,7 +986,7 @@ main (int argc, char **argv, char **envp)
fatal_signal_mask = 0;
#define ADD_SIG(sig) fatal_signal_mask |= sigmask (sig)
#else
#define ADD_SIG(sig) (void)sig /* Needed to avoid warnings in MSVC. */
#define ADD_SIG(sig) (void)sig
#endif
#endif
@@ -1086,7 +1086,7 @@ main (int argc, char **argv, char **envp)
program = strrchr (argv[0], '\\');
if (program)
{
argv0_len = strlen(program);
argv0_len = strlen (program);
if (argv0_len > 4 && streq (&program[argv0_len - 4], ".exe"))
/* Remove .exe extension */
program[argv0_len - 4] = '\0';
@@ -1122,6 +1122,7 @@ main (int argc, char **argv, char **envp)
}
else
directory_before_chdir = xstrdup (current_directory);
#ifdef __MSDOS__
/* Make sure we will return to the initial directory, come what may. */
atexit (msdos_return_to_initial_directory);
@@ -1134,11 +1135,11 @@ main (int argc, char **argv, char **envp)
define_variable_cname (".SHELLFLAGS", "-c", o_default, 0);
/* Set up .FEATURES
We must do this in multiple calls because define_variable_cname() is
a macro and some compilers (MSVC) don't like conditionals in macros. */
Use a separate variable because define_variable_cname() is a macro and
some compilers (MSVC) don't like conditionals in macros. */
{
const char *features = "target-specific order-only second-expansion"
" else-if shortest-stem undefine"
" else-if shortest-stem undefine oneshell"
#ifndef NO_ARCHIVES
" archives"
#endif
@@ -1147,12 +1148,23 @@ main (int argc, char **argv, char **envp)
#endif
#ifdef MAKE_SYMLINKS
" check-symlink"
#endif
#ifdef HAVE_GUILE
" guile"
#endif
#ifdef MAKE_LOAD
" load"
#endif
;
define_variable_cname (".FEATURES", features, o_default, 0);
}
#ifdef HAVE_GUILE
/* Configure GNU Guile support */
guile_gmake_setup (NILF);
#endif
/* Read in variables from the environment. It is important that this be
done before $(MAKE) is figured out so its definitions will not be
from the environment. */
@@ -1169,9 +1181,9 @@ main (int argc, char **argv, char **envp)
while (*ep != '\0' && *ep != '=')
++ep;
#ifdef WINDOWS32
if (!unix_path && strneq(envp[i], "PATH=", 5))
if (!unix_path && strneq (envp[i], "PATH=", 5))
unix_path = ep+1;
else if (!strnicmp(envp[i], "Path=", 5)) {
else if (!strnicmp (envp[i], "Path=", 5)) {
do_not_define = 1; /* it gets defined after loop exits */
if (!windows32_path)
windows32_path = ep+1;
@@ -1190,7 +1202,7 @@ main (int argc, char **argv, char **envp)
environment. We used to rely on target_environment's
v_default code to do this. But that does not work for the
case where an environment variable is redefined in a makefile
with `override'; it should then still be exported, because it
with 'override'; it should then still be exported, because it
was originally in the environment. */
v->export = v_export;
@@ -1282,11 +1294,11 @@ main (int argc, char **argv, char **envp)
always_make_flag = always_make_set && (restarts == 0);
/* Print version information. */
if (print_version_flag || print_data_base_flag || db_level)
if (print_version_flag || print_data_base_flag || ISDB (DB_BASIC))
{
print_version ();
/* `make --version' is supposed to just print the version and exit. */
/* 'make --version' is supposed to just print the version and exit. */
if (print_version_flag)
die (0);
}
@@ -1520,7 +1532,7 @@ main (int argc, char **argv, char **envp)
)
tmpdir = DEFAULT_TMPDIR;
template = alloca (strlen (tmpdir) + sizeof (DEFAULT_TMPFILE) + 1);
template = alloca (strlen (tmpdir) + CSTRLEN (DEFAULT_TMPFILE) + 2);
strcpy (template, tmpdir);
#ifdef HAVE_DOS_PATHS
@@ -1567,7 +1579,7 @@ main (int argc, char **argv, char **envp)
#ifndef __EMX__ /* Don't use a SIGCHLD handler for OS/2 */
#if defined(MAKE_JOBSERVER) || !defined(HAVE_WAIT_NOHANG)
/* Set up to handle children dying. This must be done before
reading in the makefiles so that `shell' function calls will work.
reading in the makefiles so that 'shell' function calls will work.
If we don't have a hanging wait we have to fall back to old, broken
functionality here and rely on the signal handler and counting
@@ -1630,7 +1642,7 @@ main (int argc, char **argv, char **envp)
{
char *p, *value;
unsigned int i;
unsigned int len = sizeof ("--eval=") * eval_strings->idx;
unsigned int len = (CSTRLEN ("--eval=") + 1) * eval_strings->idx;
for (i = 0; i < eval_strings->idx; ++i)
{
@@ -1644,7 +1656,7 @@ main (int argc, char **argv, char **envp)
for (i = 0; i < eval_strings->idx; ++i)
{
strcpy (p, "--eval=");
p += strlen (p);
p += CSTRLEN ("--eval=");
p = quote_for_env (p, eval_strings->list[i]);
*(p++) = ' ';
}
@@ -1655,8 +1667,7 @@ main (int argc, char **argv, char **envp)
/* Read all the makefiles. */
read_makefiles
= read_all_makefiles (makefiles == 0 ? 0 : makefiles->list);
read_makefiles = read_all_makefiles (makefiles == 0 ? 0 : makefiles->list);
#ifdef WINDOWS32
/* look one last time after reading all Makefiles */
@@ -1722,12 +1733,22 @@ main (int argc, char **argv, char **envp)
cp = jobserver_fds->list[0];
#ifdef WINDOWS32
if (! open_jobserver_semaphore(cp))
{
DWORD err = GetLastError();
fatal (NILF, _("internal error: unable to open jobserver semaphore '%s': (Error %ld: %s)"),
cp, err, map_windows32_error_to_string(err));
}
DB (DB_JOBS, (_("Jobserver client (semaphore %s)\n"), cp));
#else
if (sscanf (cp, "%d,%d", &job_fds[0], &job_fds[1]) != 2)
fatal (NILF,
_("internal error: invalid --jobserver-fds string `%s'"), cp);
_("internal error: invalid --jobserver-fds string '%s'"), cp);
DB (DB_JOBS,
(_("Jobserver client (fds %d,%d)\n"), job_fds[0], job_fds[1]));
#endif
/* The combination of a pipe + !job_slots means we're using the
jobserver. If !job_slots and we don't have a pipe, we can start
@@ -1739,25 +1760,30 @@ main (int argc, char **argv, char **envp)
error (NILF,
_("warning: -jN forced in submake: disabling jobserver mode."));
#ifndef WINDOWS32
/* Create a duplicate pipe, that will be closed in the SIGCHLD
handler. If this fails with EBADF, the parent has closed the pipe
on us because it didn't think we were a submake. If so, print a
warning then default to -j1. */
else if ((job_rfd = dup (job_fds[0])) < 0)
{
if (errno != EBADF)
pfatal_with_name (_("dup jobserver"));
error (NILF,
_("warning: jobserver unavailable: using -j1. Add `+' to parent make rule."));
_("warning: jobserver unavailable: using -j1. Add '+' to parent make rule."));
job_slots = 1;
}
#endif
if (job_slots > 0)
{
#ifdef WINDOWS32
free_jobserver_semaphore ();
#else
close (job_fds[0]);
close (job_fds[1]);
#endif
job_fds[0] = job_fds[1] = -1;
free (jobserver_fds->list);
free (jobserver_fds);
@@ -1771,10 +1797,30 @@ main (int argc, char **argv, char **envp)
if (job_slots > 1)
{
char *cp;
#ifdef WINDOWS32
/* sub_proc.c cannot wait for more than MAXIMUM_WAIT_OBJECTS objects
* and one of them is the job-server semaphore object. Limit the
* number of available job slots to (MAXIMUM_WAIT_OBJECTS - 1). */
if (job_slots >= MAXIMUM_WAIT_OBJECTS)
{
job_slots = MAXIMUM_WAIT_OBJECTS - 1;
DB (DB_JOBS, (_("Jobserver slots limited to %d\n"), job_slots));
}
if (! create_jobserver_semaphore(job_slots - 1))
{
DWORD err = GetLastError();
fatal (NILF, _("creating jobserver semaphore: (Error %ld: %s)"),
err, map_windows32_error_to_string(err));
}
#else
char c = '+';
if (pipe (job_fds) < 0 || (job_rfd = dup (job_fds[0])) < 0)
pfatal_with_name (_("creating jobs pipe"));
#endif
/* Every make assumes that it always has one job it can run. For the
submakes it's the token they were given by their parent. For the
@@ -1783,6 +1829,10 @@ main (int argc, char **argv, char **envp)
master_job_slots = job_slots;
#ifdef WINDOWS32
/* We're using the jobserver so set job_slots to 0. */
job_slots = 0;
#else
while (--job_slots)
{
int r;
@@ -1791,14 +1841,19 @@ main (int argc, char **argv, char **envp)
if (r != 1)
pfatal_with_name (_("init jobserver pipe"));
}
#endif
/* Fill in the jobserver_fds struct for our children. */
cp = xmalloc ((sizeof ("1024")*2)+1);
#ifdef WINDOWS32
cp = xmalloc (MAX_PATH + 1);
strcpy (cp, get_jobserver_semaphore_name());
#else
cp = xmalloc ((CSTRLEN ("1024") * 2) + 2);
sprintf (cp, "%d,%d", job_fds[0], job_fds[1]);
#endif
jobserver_fds = (struct stringlist *)
xmalloc (sizeof (struct stringlist));
jobserver_fds = xmalloc (sizeof (struct stringlist));
jobserver_fds->list = xmalloc (sizeof (char *));
jobserver_fds->list[0] = cp;
jobserver_fds->idx = 1;
@@ -1818,7 +1873,7 @@ main (int argc, char **argv, char **envp)
define_makeflags (1, 0);
/* Make each `struct dep' point at the `struct file' for the file
/* Make each 'struct dep' point at the 'struct file' for the file
depended on. Also do magic for special targets. */
snap_deps ();
@@ -1914,7 +1969,7 @@ main (int argc, char **argv, char **envp)
you write your makefiles.) */
DB (DB_VERBOSE,
(_("Makefile `%s' might loop; not remaking it.\n"),
(_("Makefile '%s' might loop; not remaking it.\n"),
f->name));
if (last == 0)
@@ -1942,7 +1997,7 @@ main (int argc, char **argv, char **envp)
}
}
/* Set up `MAKEFLAGS' specially while remaking makefiles. */
/* Set up 'MAKEFLAGS' specially while remaking makefiles. */
define_makeflags (1, 1);
rebuilding_makefiles = 1;
@@ -1993,7 +2048,7 @@ main (int argc, char **argv, char **envp)
FILE_TIMESTAMP mtime;
/* The update failed and this makefile was not
from the MAKEFILES variable, so we care. */
error (NILF, _("Failed to remake makefile `%s'."),
error (NILF, _("Failed to remake makefile '%s'."),
d->file->name);
mtime = file_mtime_no_search (d->file);
any_remade |= (mtime != NONEXISTENT_MTIME
@@ -2010,12 +2065,12 @@ main (int argc, char **argv, char **envp)
/* An included makefile. We don't need
to die, but we do want to complain. */
error (NILF,
_("Included makefile `%s' was not found."),
_("Included makefile '%s' was not found."),
dep_name (d));
else
{
/* A normal makefile. We must die later. */
error (NILF, _("Makefile `%s' was not found"),
error (NILF, _("Makefile '%s' was not found"),
dep_name (d));
any_failed = 1;
}
@@ -2088,12 +2143,17 @@ main (int argc, char **argv, char **envp)
++restarts;
/* If we're re-exec'ing the first make, put back the number of
job slots so define_makefiles() will get it right. */
if (master_job_slots)
job_slots = master_job_slots;
/* Reset makeflags in case they were changed. */
{
const char *pv = define_makeflags (1, 1);
char *p = alloca (sizeof ("MAKEFLAGS=") + strlen (pv) + 1);
char *p = alloca (CSTRLEN ("MAKEFLAGS=") + strlen (pv) + 1);
sprintf (p, "MAKEFLAGS=%s", pv);
putenv (p);
putenv (allocated_variable_expand (p));
}
if (ISDB (DB_BASIC))
@@ -2192,7 +2252,7 @@ main (int argc, char **argv, char **envp)
free (makefile_mtimes);
}
/* Set up `MAKEFLAGS' again for the normal targets. */
/* Set up 'MAKEFLAGS' again for the normal targets. */
define_makeflags (1, 0);
/* Set always_make_flag if -B was given. */
@@ -2310,7 +2370,7 @@ main (int argc, char **argv, char **envp)
}
/* NOTREACHED */
return 0;
exit(0);
}
/* Parsing of arguments, decoding of switches. */
@@ -2385,7 +2445,7 @@ handle_non_switch_argument (char *arg, int env)
/* Non-option argument. It might be a variable definition. */
struct variable *v;
if (arg[0] == '-' && arg[1] == '\0')
/* Ignore plain `-' for compatibility. */
/* Ignore plain '-' for compatibility. */
return;
v = try_variable_definition (0, arg, o_command, 0);
if (v != 0)
@@ -2559,7 +2619,7 @@ decode_switches (int argc, char **argv, int env)
else
op = cs->long_name;
error (NILF, _("the `%s%s' option requires a non-empty string argument"),
error (NILF, _("the '%s%s' option requires a non-empty string argument"),
short_option (cs->c) ? "-" : "--", op);
bad = 1;
}
@@ -2567,8 +2627,7 @@ decode_switches (int argc, char **argv, int env)
sl = *(struct stringlist **) cs->value_ptr;
if (sl == 0)
{
sl = (struct stringlist *)
xmalloc (sizeof (struct stringlist));
sl = xmalloc (sizeof (struct stringlist));
sl->max = 5;
sl->idx = 0;
sl->list = xmalloc (5 * sizeof (char *));
@@ -2614,7 +2673,7 @@ decode_switches (int argc, char **argv, int env)
if (i < 1 || cp[0] != '\0')
{
error (NILF, _("the `-%c' option requires a positive integral argument"),
error (NILF, _("the '-%c' option requires a positive integral argument"),
cs->c);
bad = 1;
}
@@ -2754,7 +2813,7 @@ quote_for_env (char *out, const char *in)
/* Define the MAKEFLAGS and MFLAGS variables to reflect the settings of the
command switches. Include options with args if ALL is nonzero.
Don't include options with the `no_makefile' flag set if MAKEFILE. */
Don't include options with the 'no_makefile' flag set if MAKEFILE. */
static const char *
define_makeflags (int all, int makefile)
@@ -2768,7 +2827,7 @@ define_makeflags (int all, int makefile)
unsigned int words;
struct variable *v;
/* We will construct a linked list of `struct flag's describing
/* We will construct a linked list of 'struct flag's describing
all the flags which need to go in MAKEFLAGS. Then, once we
know how many there are and their lengths, we can put them all
together in a string. */
@@ -2824,9 +2883,6 @@ define_makeflags (int all, int makefile)
&& (*(unsigned int *) cs->value_ptr ==
*(unsigned int *) cs->noarg_value))
ADD_FLAG ("", 0); /* Optional value omitted; see below. */
else if (cs->c == 'j')
/* Special case for `-j'. */
ADD_FLAG ("1", 1);
else
{
char *buf = alloca (30);
@@ -2880,7 +2936,7 @@ define_makeflags (int all, int makefile)
}
/* Four more for the possible " -- ". */
flagslen += 4 + sizeof (posixref) + sizeof (evalref);
flagslen += 4 + CSTRLEN (posixref) + 1 + CSTRLEN (evalref) + 1;
#undef ADD_FLAG
@@ -2963,8 +3019,8 @@ define_makeflags (int all, int makefile)
p = flagstring;
else
*p++ = ' ';
memcpy (p, evalref, sizeof (evalref) - 1);
p += sizeof (evalref) - 1;
memcpy (p, evalref, CSTRLEN (evalref));
p += CSTRLEN (evalref);
}
if (all && command_variables != 0)
@@ -2992,13 +3048,13 @@ define_makeflags (int all, int makefile)
/* Copy in the string. */
if (posix_pedantic)
{
memcpy (p, posixref, sizeof (posixref) - 1);
p += sizeof (posixref) - 1;
memcpy (p, posixref, CSTRLEN (posixref));
p += CSTRLEN (posixref);
}
else
{
memcpy (p, ref, sizeof (ref) - 1);
p += sizeof (ref) - 1;
memcpy (p, ref, CSTRLEN (ref));
p += CSTRLEN (ref);
}
}
else if (p == &flagstring[1])
@@ -3029,7 +3085,7 @@ define_makeflags (int all, int makefile)
if (! all)
/* The first time we are called, set MAKEFLAGS to always be exported.
We should not do this again on the second call, because that is
after reading makefiles which might have done `unexport MAKEFLAGS'. */
after reading makefiles which might have done 'unexport MAKEFLAGS'. */
v->export = v_export;
return v->value;
@@ -3059,9 +3115,10 @@ print_version (void)
/* Print this untranslated. The coding standards recommend translating the
(C) to the copyright symbol, but this string is going to change every
year, and none of the rest of it should be translated (including the
word "Copyright", so it hardly seems worth it. */
word "Copyright"), so it hardly seems worth it. */
printf ("%sCopyright (C) 2010 Free Software Foundation, Inc.\n", precede);
printf ("%sCopyright (C) 1988-2012 Free Software Foundation, Inc.\n",
precede);
printf (_("%sLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n\
%sThis is free software: you are free to change and redistribute it.\n\
@@ -3071,7 +3128,7 @@ print_version (void)
printed_version = 1;
/* Flush stdout so the user doesn't have to wait to see the
version information while things are thought about. */
version information while make thinks about things. */
fflush (stdout);
}
@@ -3099,27 +3156,37 @@ print_data_base ()
static void
clean_jobserver (int status)
{
char token = '+';
/* Sanity: have we written all our jobserver tokens back? If our
exit status is 2 that means some kind of syntax error; we might not
have written all our tokens so do that now. If tokens are left
after any other error code, that's bad. */
#ifdef WINDOWS32
if (has_jobserver_semaphore() && jobserver_tokens)
#else
char token = '+';
if (job_fds[0] != -1 && jobserver_tokens)
#endif
{
if (status != 2)
error (NILF,
"INTERNAL: Exiting with %u jobserver tokens (should be 0)!",
jobserver_tokens);
else
while (jobserver_tokens--)
/* Don't write back the "free" token */
while (--jobserver_tokens)
{
#ifdef WINDOWS32
if (! release_jobserver_semaphore())
perror_with_name ("release_jobserver_semaphore", "");
#else
int r;
EINTRLOOP (r, write (job_fds[1], &token, 1));
if (r != 1)
perror_with_name ("write", "");
#endif
}
}
@@ -3131,18 +3198,27 @@ clean_jobserver (int status)
/* We didn't write one for ourself, so start at 1. */
unsigned int tcnt = 1;
#ifdef WINDOWS32
while (acquire_jobserver_semaphore())
++tcnt;
#else
/* Close the write side, so the read() won't hang. */
close (job_fds[1]);
while (read (job_fds[0], &token, 1) == 1)
++tcnt;
#endif
if (tcnt != master_job_slots)
error (NILF,
"INTERNAL: Exiting with %u jobserver tokens available; should be %u!",
tcnt, master_job_slots);
#ifdef WINDOWS32
free_jobserver_semaphore();
#else
close (job_fds[0]);
#endif
/* Clean out jobserver_fds so we don't pass this information to any
sub-makes. Also reset job_slots since it will be put on the command
@@ -3200,7 +3276,7 @@ die (int status)
if (directory_before_chdir != 0)
{
/* If it fails we don't care: shut up GCC. */
int _x;
int _x UNUSED;
_x = chdir (directory_before_chdir);
}
@@ -3239,10 +3315,10 @@ log_working_directory (int entering)
printf (_("%s: Leaving an unknown directory\n"), program);
else
if (entering)
printf (_("%s: Entering directory `%s'\n"),
printf (_("%s: Entering directory '%s'\n"),
program, starting_directory);
else
printf (_("%s: Leaving directory `%s'\n"),
printf (_("%s: Leaving directory '%s'\n"),
program, starting_directory);
else
if (starting_directory == 0)
@@ -3254,10 +3330,10 @@ log_working_directory (int entering)
program, makelevel);
else
if (entering)
printf (_("%s[%u]: Entering directory `%s'\n"),
printf (_("%s[%u]: Entering directory '%s'\n"),
program, makelevel, starting_directory);
else
printf (_("%s[%u]: Leaving directory `%s'\n"),
printf (_("%s[%u]: Leaving directory '%s'\n"),
program, makelevel, starting_directory);
/* Flush stdout to be sure this comes before any stderr output. */

View File

@@ -5,6 +5,9 @@
# We like mondo-warnings!
AM_CFLAGS += -Wall -Wextra -Wdeclaration-after-statement -Wshadow -Wpointer-arith -Wbad-function-cast
MAKE_MAINTAINER_MODE := -DMAKE_MAINTAINER_MODE
AM_CPPFLAGS += $(MAKE_MAINTAINER_MODE)
# I want this one but I have to wait for the const cleanup!
# -Wwrite-strings
@@ -135,6 +138,8 @@ move_if_change = if test -r $(target) && cmp -s $(target).t $(target); then \
# http://translation.sf.net/maint/
# ftp://tiger.informatik.hu-berlin.de/pub/po/maint/
po_wget_flags = --recursive --level=1 --no-directories --no-parent \
--no-check-certificate
po_repo = http://translationproject.org/latest/$(PACKAGE)
.PHONY: do-po-update po-update
do-po-update:
@@ -142,7 +147,7 @@ do-po-update:
&& rm -rf "$$tmppo" \
&& mkdir "$$tmppo" \
&& (cd "$$tmppo" \
&& $(WGET) -r -l1 -nd --no-parent -A '*.po' $(po_repo)) \
&& $(WGET) $(po_wget_flags) -A '*.po' $(po_repo)) \
&& cp "$$tmppo"/*.po $(top_srcdir)/po && rm -rf "$$tmppo"
cd po && $(MAKE) update-po
$(MAKE) po-check
@@ -196,7 +201,7 @@ update: po-update scm-update
## Sanity checks. ##
## --------------- ##
# Checks that don't require cvs. Run `changelog-check' last as
# Checks that don't require cvs. Run 'changelog-check' last as
# previous test may reveal problems requiring new ChangeLog entries.
local-check: po-check changelog-check
@@ -266,8 +271,7 @@ $(UPLOADS): $(DIST_ARCHIVES) $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
$(FTPPUT) "$(gnu-upload-host)" "$(gnu-upload-dir)/$(@:upload-%=%)" $^
# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
# Copyright (C) 1997-2012 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

178
make.1
View File

@@ -1,49 +1,35 @@
.TH MAKE 1 "22 August 1989" "GNU" "LOCAL USER COMMANDS"
.TH MAKE 1 "03 March 2012" "GNU" "User Commands"
.SH NAME
make \- GNU make utility to maintain groups of programs
.SH SYNOPSIS
.B "make "
[
.B \-f
.I makefile
] [ options ] ... [ targets ] ...
.SH WARNING
This man page is an extract of the documentation of GNU
.IR make .
It is updated only occasionally, because the GNU project does not use nroff.
For complete, current documentation, refer to the Info file
.B make.info
which is made from the Texinfo source file
.BR make.texi .
.B make
[\fIOPTION\fR]... [\fITARGET\fR]...
.SH DESCRIPTION
.LP
The purpose of the
The
.I make
utility is to determine automatically which
pieces of a large program need to be recompiled, and issue the commands to
recompile them.
The manual describes the GNU implementation of
.IR make ,
which was written by Richard Stallman and Roland McGrath, and is
currently maintained by Paul Smith.
Our examples show C programs, since they are most common, but you can use
.I make
with any programming language whose compiler can be run with a
shell command.
utility will determine automatically which pieces of a large program need to
be recompiled, and issue the commands to recompile them. The manual describes
the GNU implementation of
.BR make ,
which was written by Richard Stallman and Roland McGrath, and is currently
maintained by Paul Smith. Our examples show C programs, since they are very
common, but you can use
.B make
with any programming language whose compiler can be run with a shell command.
In fact,
.I make
is not limited to programs.
You can use it to describe any task where some files must be
updated automatically from others whenever the others change.
.B make
is not limited to programs. You can use it to describe any task where some
files must be updated automatically from others whenever the others change.
.LP
To prepare to use
.IR make ,
.BR make ,
you must write a file called the
.I makefile
that describes the relationships among files in your program, and the
states the commands for updating each file.
In a program, typically the executable file is updated from object
files, which are in turn made by compiling source files.
that describes the relationships among files in your program, and the states
the commands for updating each file. In a program, typically the executable
file is updated from object files, which are in turn made by compiling source
files.
.LP
Once a suitable makefile exists, each time you change some source files,
this simple shell command:
@@ -54,16 +40,15 @@ this simple shell command:
.sp 1
suffices to perform all necessary recompilations.
The
.I make
program uses the makefile data base and the last-modification times
of the files to decide which of the files need to be updated.
For each of those files, it issues the commands recorded in the data base.
.B make
program uses the makefile description and the last-modification times of the
files to decide which of the files need to be updated. For each of those
files, it issues the commands recorded in the makefile.
.LP
.I make
.B make
executes commands in the
.I makefile
to update
one or more target
to update one or more target
.IR names ,
where
.I name
@@ -71,7 +56,7 @@ is typically a program.
If no
.B \-f
option is present,
.I make
.B make
will look for the makefiles
.IR GNUmakefile ,
.IR makefile ,
@@ -90,27 +75,27 @@ listing, right near other important files such as
.IR README .)
The first name checked,
.IR GNUmakefile ,
is not recommended for most makefiles.
You should use this name if you have a makefile that is specific to GNU
.IR make ,
is not recommended for most makefiles. You should use this name if you have a
makefile that is specific to GNU
.BR make ,
and will not be understood by other versions of
.IR make .
.BR make .
If
.I makefile
is `\-', the standard input is read.
is '\-', the standard input is read.
.LP
.I make
.B make
updates a target if it depends on prerequisite files
that have been modified since the target was last modified,
or if the target does not exist.
.SH OPTIONS
.sp 1
.TP 0.5i
.BR \-b , " \-m"
\fB\-b\fR, \fB\-m\fR
These options are ignored for compatibility with other versions of
.IR make .
.BR make .
.TP 0.5i
.BR \-B , " \-\-always\-make"
\fB\-B\fR, \fB\-\-always\-make\fR
Unconditionally make all targets.
.TP 0.5i
\fB\-C\fR \fIdir\fR, \fB\-\-directory\fR=\fIdir\fR
@@ -126,7 +111,7 @@ previous one:
is equivalent to
.BR "\-C " /etc.
This is typically used with recursive invocations of
.IR make .
.BR make .
.TP 0.5i
.B \-d
Print debugging information in addition to normal processing.
@@ -134,7 +119,7 @@ The debugging information says which files are being considered for
remaking, which file-times are being compared and with what results,
which files actually need to be remade, which implicit rules are
considered and which are applied---everything interesting about how
.I make
.B make
decides what to do.
.TP 0.5i
.BI \-\-debug "[=FLAGS]"
@@ -160,7 +145,7 @@ for details on invocation of commands, and
.I m
for debugging while remaking makefiles.
.TP 0.5i
.BR \-e , " \-\-environment\-overrides"
\fB\-e\fR, \fB\-\-environment\-overrides\fR
Give variables taken from the environment precedence
over variables from makefiles.
.TP 0.5i
@@ -169,7 +154,7 @@ Use
.I file
as a makefile.
.TP 0.5i
.BR \-i , " \-\-ignore\-errors"
\fB\-i\fR, \fB\-\-ignore\-errors\fR
Ignore all errors in commands executed to remake files.
.TP 0.5i
\fB\-I\fR \fIdir\fR, \fB\-\-include\-dir\fR=\fIdir\fR
@@ -181,13 +166,14 @@ If several
options are used to specify several directories, the directories are
searched in the order specified.
Unlike the arguments to other flags of
.IR make ,
.BR make ,
directories given with
.B \-I
flags may come directly after the flag:
.BI \-I dir
is allowed, as well as
.BI "\-I " dir.
.B \-I
.IR dir .
This syntax is allowed for compatibility with the C
preprocessor's
.B \-I
@@ -203,10 +189,10 @@ option, the last one is effective.
If the
.B \-j
option is given without an argument,
.IR make
.BR make
will not limit the number of jobs that can run simultaneously.
.TP 0.5i
.BR \-k , " \-\-keep\-going"
\fB\-k\fR, \fB\-\-keep\-going\fR
Continue as much as possible after an error.
While the target that failed, and those that depend on it, cannot
be remade, the other dependencies of these targets can be processed
@@ -219,10 +205,10 @@ others jobs running and the load average is at least
(a floating-point number).
With no argument, removes a previous load limit.
.TP 0.5i
.BR \-L , " \-\-check\-symlink\-times"
\fB\-L\fR, \fB\-\-check\-symlink\-times\fR
Use the latest mtime between symlinks and target.
.TP 0.5i
.BR \-n , " \-\-just\-print" , " \-\-dry\-run" , " \-\-recon"
\fB\-n\fR, \fB\-\-just\-print\fR, \fB\-\-dry\-run\fR, \fB\-\-recon\fR
Print the commands that would be executed, but do not execute them (except in
certain circumstances).
.TP 0.5i
@@ -234,7 +220,7 @@ on account of changes in
.IR file .
Essentially the file is treated as very old and its rules are ignored.
.TP 0.5i
.BR \-p , " \-\-print\-data\-base"
\fB\-p\fR, \fB\-\-print\-data\-base\fR
Print the data base (rules and variable values) that results from
reading the makefiles; then execute as usual or as otherwise
specified.
@@ -242,59 +228,61 @@ This also prints the version information given by the
.B \-v
switch (see below).
To print the data base without trying to remake any files, use
.B make
.B \-p
.BI \-f /dev/null.
.IR "make \-p \-f/dev/null" .
.TP 0.5i
.BR \-q , " \-\-question"
\fB\-q\fR, \fB\-\-question\fR
``Question mode''.
Do not run any commands, or print anything; just return an exit status
that is zero if the specified targets are already up to date, nonzero
otherwise.
.TP 0.5i
.BR \-r , " \-\-no\-builtin\-rules"
\fB\-r\fR, \fB\-\-no\-builtin\-rules\fR
Eliminate use of the built\-in implicit rules.
Also clear out the default list of suffixes for suffix rules.
.TP 0.5i
.BR \-R , " \-\-no\-builtin\-variables"
\fB\-R\fR, \fB\-\-no\-builtin\-variables\fR
Don't define any built\-in variables.
.TP 0.5i
.BR \-s , " \-\-silent" , " \-\-quiet"
\fB\-s\fR, \fB\-\-silent\fR, \fB\-\-quiet\fR
Silent operation; do not print the commands as they are executed.
.TP 0.5i
.BR \-S , " \-\-no\-keep\-going" , " \-\-stop"
\fB\-S\fR, \fB\-\-no\-keep\-going\fR, \fB\-\-stop\fR
Cancel the effect of the
.B \-k
option.
This is never necessary except in a recursive
.I make
.B make
where
.B \-k
might be inherited from the top-level
.I make
.B make
via MAKEFLAGS or if you set
.B \-k
in MAKEFLAGS in your environment.
.TP 0.5i
.BR \-t , " \-\-touch"
\fB\-t\fR, \fB\-\-touch\fR
Touch files (mark them up to date without really changing them)
instead of running their commands.
This is used to pretend that the commands were done, in order to fool
future invocations of
.IR make .
.BR make .
.TP 0.5i
.BR \-v , " \-\-version"
.B \-\-trace
Print information about the commands invoked by
.BR make.
.TP 0.5i
\fB\-v\fR, \fB\-\-version\fR
Print the version of the
.I make
.B make
program plus a copyright, a list of authors and a notice that there
is no warranty.
.TP 0.5i
.BR \-w , " \-\-print\-directory"
\fB\-w\fR, \fB\-\-print\-directory\fR
Print a message containing the working directory
before and after other processing.
This may be useful for tracking down errors from complicated nests of
recursive
.I make
.B make
commands.
.TP 0.5i
.B \-\-no\-print\-directory
@@ -314,36 +302,46 @@ Without
it is almost the same as running a
.I touch
command on the given file before running
.IR make ,
.BR make ,
except that the modification time is changed only in the imagination of
.IR make .
.BR make .
.TP 0.5i
.B \-\-warn\-undefined\-variables
Warn when an undefined variable is referenced.
.SH "EXIT STATUS"
GNU
.I make
.B make
exits with a status of zero if all makefiles were successfully parsed
and no targets that were built failed. A status of one will be returned
if the
.B \-q
flag was used and
.I make
.B make
determines that a target needs to be rebuilt. A status of two will be
returned if any errors were encountered.
.SH "SEE ALSO"
.I "The GNU Make Manual"
The full documentation for
.B make
is maintained as a Texinfo manual. If the
.B info
and
.B make
programs are properly installed at your site, the command
.IP
.B info make
.PP
should give you access to the complete manual.
.SH BUGS
See the chapter `Problems and Bugs' in
See the chapter ``Problems and Bugs'' in
.IR "The GNU Make Manual" .
.SH AUTHOR
This manual page contributed by Dennis Morse of Stanford University.
It has been reworked by Roland McGrath. Further updates contributed by
Mike Frysinger.
Further updates contributed by Mike Frysinger. It has been reworked by Roland
McGrath. Maintained by Paul Smith.
.SH "COPYRIGHT"
Copyright (C) 1992, 1993, 1996, 1999, 2007 Free Software Foundation, Inc.
This file is part of GNU
.IR make .
Copyright \(co 1992-1993, 1996-2012 Free Software Foundation, Inc.
This file is part of
.IR "GNU make" .
.LP
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

73
make.h
View File

@@ -1,7 +1,5 @@
/* Miscellaneous global declarations and portability cruft for GNU Make.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
Copyright (C) 1988-2012 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
@@ -43,6 +41,12 @@ char *alloca ();
# endif
#endif
/* Disable assert() unless we're a maintainer.
Some asserts are compute-intensive. */
#ifndef MAKE_MAINTAINER_MODE
# define NDEBUG 1
#endif
#ifdef CRAY
/* This must happen before #include <signal.h> so
@@ -60,13 +64,12 @@ char *alloca ();
#include <signal.h>
#include <stdio.h>
#include <ctype.h>
#ifdef HAVE_SYS_TIMEB_H
/* SCO 3.2 "devsys 4.2" has a prototype for `ftime' in <time.h> that bombs
unless <sys/timeb.h> has been included first. Does every system have a
<sys/timeb.h>? If any does not, configure should check for it. */
/* SCO 3.2 "devsys 4.2" has a prototype for 'ftime' in <time.h> that bombs
unless <sys/timeb.h> has been included first. */
# include <sys/timeb.h>
#endif
#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
@@ -91,7 +94,7 @@ extern int errno;
#ifdef HAVE_UNISTD_H
# include <unistd.h>
/* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get
POSIX.1 behavior with `cc -YPOSIX', which predefines POSIX itself! */
POSIX.1 behavior with 'cc -YPOSIX', which predefines POSIX itself! */
# if defined (_POSIX_VERSION) && !defined (ultrix) && !defined (VMS)
# define POSIX 1
# endif
@@ -148,8 +151,13 @@ unsigned int get_path_max (void);
# define CHAR_BIT 8
#endif
/* Nonzero if the integer type T is signed. */
#define INTEGER_TYPE_SIGNED(t) ((t) -1 < 0)
#ifndef USHRT_MAX
# define USHRT_MAX 65535
#endif
/* Nonzero if the integer type T is signed.
Use <= to avoid GCC warnings about always-false expressions. */
#define INTEGER_TYPE_SIGNED(t) ((t) -1 <= 0)
/* The minimum and maximum values for the integer type T.
Use ~ (t) 0, not -1, for portability to 1's complement hosts. */
@@ -191,7 +199,7 @@ unsigned int get_path_max (void);
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
# define __attribute__(x)
# endif
/* The __-protected variants of `format' and `printf' attributes
/* The __-protected variants of 'format' and 'printf' attributes
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
# define __format__ format
@@ -249,6 +257,9 @@ char *strerror (int errnum);
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#if HAVE_STDINT_H
# include <stdint.h>
#endif
#define FILE_TIMESTAMP uintmax_t
#if !defined(HAVE_STRSIGNAL)
@@ -262,7 +273,7 @@ char *strsignal (int signum);
- It's typically faster.
POSIX 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that
only '0' through '9' are digits. Prefer ISDIGIT to isdigit() unless
it's important to use the locale's definition of `digit' even when the
it's important to use the locale's definition of 'digit' even when the
host does not conform to POSIX. */
#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
@@ -305,11 +316,15 @@ char *strsignal (int signum);
#define N_(msgid) gettext_noop (msgid)
#define S_(msg1,msg2,num) ngettext (msg1,msg2,num)
/* Handle other OSs. */
#ifndef PATH_SEPARATOR_CHAR
# if defined(HAVE_DOS_PATHS)
# define PATH_SEPARATOR_CHAR ';'
# elif defined(VMS)
/* Handle other OSs.
To overcome an issue parsing paths in a DOS/Windows environment when
built in a unix based environment, override the PATH_SEPARATOR_CHAR
definition unless being built for Cygwin. */
#if defined(HAVE_DOS_PATHS) && !defined(__CYGWIN__)
# undef PATH_SEPARATOR_CHAR
# define PATH_SEPARATOR_CHAR ';'
#elif !defined(PATH_SEPARATOR_CHAR)
# if defined (VMS)
# define PATH_SEPARATOR_CHAR ','
# else
# define PATH_SEPARATOR_CHAR ':'
@@ -344,7 +359,7 @@ extern int unixy_shell;
#endif
#ifdef SET_STACK_SIZE
# include <sys/resource.h>
struct rlimit stack_limit;
extern struct rlimit stack_limit;
#endif
struct floc
@@ -354,7 +369,8 @@ struct floc
};
#define NILF ((struct floc *)0)
#define STRING_SIZE_TUPLE(_s) (_s), (sizeof (_s)-1)
#define CSTRLEN(_s) (sizeof (_s)-1)
#define STRING_SIZE_TUPLE(_s) (_s), CSTRLEN(_s)
/* We have to have stdarg.h or varargs.h AND v*printf or doprnt to use
@@ -452,8 +468,17 @@ void strcache_init (void);
void strcache_print_stats (const char *prefix);
int strcache_iscached (const char *str);
const char *strcache_add (const char *str);
const char *strcache_add_len (const char *str, int len);
int strcache_setbufsize (int size);
const char *strcache_add_len (const char *str, unsigned int len);
int strcache_setbufsize (unsigned int size);
/* Guile support */
#ifdef HAVE_GUILE
int guile_gmake_setup (const struct floc *flocp);
#endif
/* Loadable object support */
typedef int (*load_func_t)(const struct floc *flocp);
int load_file (const struct floc *flocp, const char *filename, int noerror);
#ifdef HAVE_VFORK_H
# include <vfork.h>
@@ -511,9 +536,9 @@ extern int just_print_flag, silent_flag, ignore_errors_flag, keep_going_flag;
extern int print_data_base_flag, question_flag, touch_flag, always_make_flag;
extern int env_overrides, no_builtin_rules_flag, no_builtin_variables_flag;
extern int print_version_flag, print_directory_flag, check_symlink_flag;
extern int warn_undefined_variables_flag, posix_pedantic, not_parallel;
extern int second_expansion, clock_skew_detected, rebuilding_makefiles;
extern int one_shell;
extern int warn_undefined_variables_flag, trace_flag, posix_pedantic;
extern int not_parallel, second_expansion, clock_skew_detected;
extern int rebuilding_makefiles, one_shell;
/* can we run commands via 'sh -c xxx' or must we use batch files? */
extern int batch_mode_shell;

View File

@@ -154,6 +154,11 @@
<File
RelativePath=".\getopt1.c">
</File>
<!--
<File
RelativePath=".\guile.c">
</File>
-->
<File
RelativePath=".\hash.c">
</File>
@@ -263,6 +268,9 @@
<File
RelativePath=".\gettext.h">
</File>
<File
RelativePath=".\gmk-default.h">
</File>
<File
RelativePath=".\hash.h">
</File>

View File

@@ -138,8 +138,7 @@ $ exit
$ endsubroutine : compileit
$!
$!-----------------------------------------------------------------------------
$!Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
$!2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
$!Copyright (C) 1996-2012 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

View File

@@ -1,7 +1,6 @@
# -*-Makefile-*- to build GNU make on VMS
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
# Copyright (C) 1996-2012 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
@@ -82,18 +81,22 @@ extras = ,signame.obj,remote-stub.obj,vmsfunctions.obj,vmsify.obj
# as an alternative:
glob = ,[.glob]glob.obj,[.glob]fnmatch.obj
getopt = ,getopt.obj,getopt1.obj
# Directory to install `make' in.
# Directory to install 'make' in.
bindir = []
# Directory to install the man page in.
mandir = []
# Number to put on the man page filename.
manext = 1
#guile = ,guile.obj
objs = commands.obj,job.obj,dir.obj,file.obj,misc.obj,hash.obj,\
main.obj,read.obj,remake.obj,rule.obj,implicit.obj,\
default.obj,variable.obj,expand.obj,function.obj,strcache.obj,\
vpath.obj,version.obj$(ARCHIVES)$(ALLOCA)$(extras)$(getopt)$(glob)
srcs = commands.c job.c dir.c file.c misc.c hash.c \
vpath.obj,version.obj\
$(ARCHIVES)$(ALLOCA)$(extras)$(getopt)$(glob)$(guile)
srcs = commands.c job.c dir.c file.c misc.c guile.c hash.c \
main.c read.c remake.c rule.c implicit.c \
default.c variable.c expand.c function.c strcache.c \
vpath.c version.c vmsfunctions.c vmsify.c $(ARCHIVES_SRC) $(ALLOCASRC) \
@@ -124,6 +127,7 @@ misc.obj: misc.c make.h dep.h
hash.obj: hash.c make.h hash.h
strcache.obj: strcache.c make.h hash.h
main.obj: main.c make.h commands.h dep.h filedef.h variable.h job.h
guile.obj: guile.c make.h debug.h dep.h gmk-default.h
read.obj: read.c make.h commands.h dep.h filedef.h variable.h
remake.obj: remake.c make.h commands.h job.h dep.h filedef.h
rule.obj: rule.c make.h commands.h dep.h filedef.h variable.h rule.h

24
misc.c
View File

@@ -1,7 +1,5 @@
/* Miscellaneous generic support functions for GNU Make.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
Copyright (C) 1988-2012 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
@@ -112,15 +110,17 @@ collapse_continuations (char *line)
/* Skip the newline. */
++in;
/* If the newline is escaped, discard following whitespace leaving just
one space. POSIX requires that each backslash/newline/following
whitespace sequence be reduced to a single space. */
if (backslash)
{
/* Backslash/newline handling:
In traditional GNU make all trailing whitespace, consecutive
backslash/newlines, and any leading whitespace on the next line
is reduced to a single space.
In POSIX, each backslash/newline and is replaced by a space. */
in = next_token (in);
/* Removing this loop will fix Savannah bug #16670: do we want to? */
while (out > line && isblank ((unsigned char)out[-1]))
--out;
if (! posix_pedantic)
while (out > line && isblank ((unsigned char)out[-1]))
--out;
*out++ = ' ';
}
else
@@ -174,7 +174,7 @@ concat (num, va_alist)
{
static unsigned int rlen = 0;
static char *result = NULL;
int ri = 0;
unsigned int ri = 0;
#if USE_VARIADIC
va_list args;
@@ -533,7 +533,7 @@ find_next_token (const char **ptr, unsigned int *lengthptr)
}
/* Copy a chain of `struct dep'. For 2nd expansion deps, dup the name. */
/* Copy a chain of 'struct dep'. For 2nd expansion deps, dup the name. */
struct dep *
copy_dep_chain (const struct dep *d)
@@ -939,7 +939,7 @@ get_path_max (void)
the failure. That's what the ferror test is checking below.
It's important to detect such failures and exit nonzero because many
tools (most notably `make' and other build-management systems) depend
tools (most notably 'make' and other build-management systems) depend
on being able to detect failure in other tools via their exit status. */
void

View File

@@ -1,3 +1,15 @@
2013-01-06 Paul Smith <psmith@gnu.org>
* POTFILES.in: Add new load.c file.
2012-01-12 Paul Smith <psmith@gnu.org>
* POTFILES.in: Add new guile.c file.
2011-09-26 Paul Smith <psmith@gnu.org>
* LINGUAS: Added new translation file for Czech (cs).
2009-09-16 Paul Smith <psmith@gnu.org>
* LINGUAS: Added new translation for Italian (it).
@@ -65,8 +77,7 @@
* POTFILES.in, LINGUAS, Makevars: Created.
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
Foundation, Inc.
Copyright (C) 2002-2012 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

View File

@@ -1,5 +1,5 @@
# Set of available languages: 24 languages
# Set of available languages: 25 languages
be da de es fi fr ga gl he hr id it ja ko lt nl pl pt_BR ru sv tr uk vi zh_CN
be cs da de es fi fr ga gl he hr id it ja ko lt nl pl pt_BR ru sv tr uk vi zh_CN
# Can't seem to get en@quot and en@boldquot to build properly?

View File

@@ -1,6 +1,5 @@
# This is a -*-Makefile-*-
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
# Software Foundation, Inc.
# Copyright (C) 2002-2012 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

View File

@@ -1,6 +1,5 @@
# List of source files containing translatable strings.
# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
# 2010 Free Software Foundation, Inc.
# Copyright (C) 2000-2012 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
@@ -24,9 +23,11 @@ expand.c
file.c
function.c
getopt.c
guile.c
hash.c
implicit.c
job.c
load.c
main.c
misc.c
read.c

466
read.c

File diff suppressed because it is too large Load Diff

View File

@@ -212,7 +212,7 @@ returns a modification time 1 hour ahead. This results in GNU make
warning messages. For a just created source you will see:
$ gmake x.exe
gmake.exe;1: *** Warning: File `x.c' has modification time in the future (940582863 > 940579269)
gmake.exe;1: *** Warning: File 'x.c' has modification time in the future (940582863 > 940579269)
cc /obj=x.obj x.c
link x.obj /exe=x.exe
gmake.exe;1: *** Warning: Clock skew detected. Your build may be incomplete.
@@ -375,8 +375,7 @@ Long command lines are now converted to command files.
Comma (',') as a separator is now allowed. See makefile.vms for an example.
-------------------------------------------------------------------------------
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 1996-2012 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

128
remake.c
View File

@@ -1,7 +1,5 @@
/* Basic dependency engine for GNU Make.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
Copyright (C) 1988-2012 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
@@ -43,7 +41,7 @@ extern int try_implicit_rule (struct file *file, unsigned int depth);
/* The test for circular dependencies is based on the 'updating' bit in
`struct file'. However, double colon targets have seperate `struct
'struct file'. However, double colon targets have seperate 'struct
file's; make sure we always use the base of the double colon chain. */
#define start_updating(_f) (((_f)->double_colon ? (_f)->double_colon : (_f))\
@@ -70,13 +68,13 @@ static FILE_TIMESTAMP name_mtime (const char *name);
static const char *library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr);
/* Remake all the goals in the `struct dep' chain GOALS. Return -1 if nothing
/* Remake all the goals in the 'struct dep' chain GOALS. Return -1 if nothing
was done, 0 if all goals were updated successfully, or 1 if a goal failed.
If rebuilding_makefiles is nonzero, these goals are makefiles, so -t, -q,
and -n should be disabled for them unless they were also command-line
targets, and we should only make one goal at a time and return as soon as
one goal whose `changed' member is nonzero is successfully made. */
one goal whose 'changed' member is nonzero is successfully made. */
int
update_goal_chain (struct dep *goals)
@@ -92,7 +90,7 @@ update_goal_chain (struct dep *goals)
goals = copy_dep_chain (goals);
{
/* Clear the `changed' flag of each goal in the chain.
/* Clear the 'changed' flag of each goal in the chain.
We will use the flag below to notice when any commands
have actually been run for a target. When no commands
have been run, we give an "up to date" diagnostic. */
@@ -149,7 +147,7 @@ update_goal_chain (struct dep *goals)
touch_flag = question_flag = just_print_flag = 0;
}
/* Save the old value of `commands_started' so we can compare
/* Save the old value of 'commands_started' so we can compare
later. It will be incremented when any commands are
actually run. */
ocommands_started = commands_started;
@@ -157,7 +155,7 @@ update_goal_chain (struct dep *goals)
x = update_file (file, rebuilding_makefiles ? 1 : 0);
check_renamed (file);
/* Set the goal's `changed' flag if any commands were started
/* Set the goal's 'changed' flag if any commands were started
by calling update_file above. We check this flag below to
decide when to give an "up to date" diagnostic. */
if (commands_started > ocommands_started)
@@ -231,8 +229,8 @@ update_goal_chain (struct dep *goals)
/* Never give a message under -s or -q. */
&& !silent_flag && !question_flag)
message (1, ((file->phony || file->cmds == 0)
? _("Nothing to be done for `%s'.")
: _("`%s' is up to date.")),
? _("Nothing to be done for '%s'.")
: _("'%s' is up to date.")),
file->name);
/* This goal is finished. Remove it from the chain. */
@@ -274,7 +272,7 @@ update_goal_chain (struct dep *goals)
/* If FILE is not up to date, execute the commands for it.
Return 0 if successful, 1 if unsuccessful;
but with some flag settings, just call `exit' if unsuccessful.
but with some flag settings, just call 'exit' if unsuccessful.
DEPTH is the depth in recursions of this function.
We increment it during the consideration of our dependencies,
@@ -303,7 +301,7 @@ update_file (struct file *file, unsigned int depth)
then we will have to continue. */
if (!(f->updated && f->update_status > 0 && !f->dontcare && f->no_diag))
{
DBF (DB_VERBOSE, _("Pruning file `%s'.\n"));
DBF (DB_VERBOSE, _("Pruning file '%s'.\n"));
return f->command_state == cs_finished ? f->update_status : 0;
}
}
@@ -355,11 +353,6 @@ update_file (struct file *file, unsigned int depth)
static void
complain (struct file *file)
{
const char *msg_noparent
= _("%sNo rule to make target `%s'%s");
const char *msg_parent
= _("%sNo rule to make target `%s', needed by `%s'%s");
/* If this file has no_diag set then it means we tried to update it
before in the dontcare mode and failed. The target that actually
failed is not necessarily this file but could be one of its direct
@@ -379,6 +372,11 @@ complain (struct file *file)
if (d == 0)
{
const char *msg_noparent
= _("%sNo rule to make target '%s'%s");
const char *msg_parent
= _("%sNo rule to make target '%s', needed by '%s'%s");
/* Didn't find any dependencies to complain about. */
if (!keep_going_flag)
{
@@ -397,7 +395,7 @@ complain (struct file *file)
}
}
/* Consider a single `struct file' and update it as appropriate. */
/* Consider a single 'struct file' and update it as appropriate. */
static int
update_file_1 (struct file *file, unsigned int depth)
@@ -410,14 +408,14 @@ update_file_1 (struct file *file, unsigned int depth)
struct dep amake;
int running = 0;
DBF (DB_VERBOSE, _("Considering target file `%s'.\n"));
DBF (DB_VERBOSE, _("Considering target file '%s'.\n"));
if (file->updated)
{
if (file->update_status > 0)
{
DBF (DB_VERBOSE,
_("Recently tried and failed to update file `%s'.\n"));
_("Recently tried and failed to update file '%s'.\n"));
/* If the file we tried to make is marked no_diag then no message
was printed about it when it failed during the makefile rebuild.
@@ -429,7 +427,7 @@ update_file_1 (struct file *file, unsigned int depth)
return file->update_status;
}
DBF (DB_VERBOSE, _("File `%s' was considered already.\n"));
DBF (DB_VERBOSE, _("File '%s' was considered already.\n"));
return 0;
}
@@ -439,10 +437,10 @@ update_file_1 (struct file *file, unsigned int depth)
case cs_deps_running:
break;
case cs_running:
DBF (DB_VERBOSE, _("Still updating file `%s'.\n"));
DBF (DB_VERBOSE, _("Still updating file '%s'.\n"));
return 0;
case cs_finished:
DBF (DB_VERBOSE, _("Finished updating file `%s'.\n"));
DBF (DB_VERBOSE, _("Finished updating file '%s'.\n"));
return file->update_status;
default:
abort ();
@@ -471,14 +469,14 @@ update_file_1 (struct file *file, unsigned int depth)
check_renamed (file);
noexist = this_mtime == NONEXISTENT_MTIME;
if (noexist)
DBF (DB_BASIC, _("File `%s' does not exist.\n"));
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)
{
/* Avoid spurious rebuilds due to low resolution time stamps. */
int ns = FILE_TIMESTAMP_NS (this_mtime);
if (ns != 0)
error (NILF, _("*** Warning: .LOW_RESOLUTION_TIME file `%s' has a high resolution time stamp"),
error (NILF, _("*** Warning: .LOW_RESOLUTION_TIME file '%s' has a high resolution time stamp"),
file->name);
this_mtime += FILE_TIMESTAMPS_PER_S - 1 - ns;
}
@@ -491,15 +489,15 @@ update_file_1 (struct file *file, unsigned int depth)
if (!file->phony && file->cmds == 0 && !file->tried_implicit)
{
if (try_implicit_rule (file, depth))
DBF (DB_IMPLICIT, _("Found an implicit rule for `%s'.\n"));
DBF (DB_IMPLICIT, _("Found an implicit rule for '%s'.\n"));
else
DBF (DB_IMPLICIT, _("No implicit rule found for `%s'.\n"));
DBF (DB_IMPLICIT, _("No implicit rule found for '%s'.\n"));
file->tried_implicit = 1;
}
if (file->cmds == 0 && !file->is_target
&& default_file != 0 && default_file->cmds != 0)
{
DBF (DB_IMPLICIT, _("Using default recipe for `%s'.\n"));
DBF (DB_IMPLICIT, _("Using default recipe for '%s'.\n"));
file->cmds = default_file->cmds;
}
@@ -614,6 +612,10 @@ update_file_1 (struct file *file, unsigned int depth)
d->file->dontcare = file->dontcare;
}
/* We may have already considered this file, when we didn't know
we'd need to update it. Force update_file() to consider it and
not prune it. */
d->file->considered = !considered;
dep_status |= update_file (d->file, depth);
@@ -648,13 +650,13 @@ update_file_1 (struct file *file, unsigned int depth)
finish_updating (file);
finish_updating (ofile);
DBF (DB_VERBOSE, _("Finished prerequisites of target file `%s'.\n"));
DBF (DB_VERBOSE, _("Finished prerequisites of target file '%s'.\n"));
if (running)
{
set_command_state (file, cs_deps_running);
--depth;
DBF (DB_VERBOSE, _("The prerequisites of `%s' are being made.\n"));
DBF (DB_VERBOSE, _("The prerequisites of '%s' are being made.\n"));
return 0;
}
@@ -667,12 +669,12 @@ update_file_1 (struct file *file, unsigned int depth)
--depth;
DBF (DB_VERBOSE, _("Giving up on target file `%s'.\n"));
DBF (DB_VERBOSE, _("Giving up on target file '%s'.\n"));
if (depth == 0 && keep_going_flag
&& !just_print_flag && !question_flag)
error (NILF,
_("Target `%s' not remade because of errors."), file->name);
_("Target '%s' not remade because of errors."), file->name);
return dep_status;
}
@@ -724,20 +726,20 @@ update_file_1 (struct file *file, unsigned int depth)
if (d->ignore_mtime)
{
if (ISDB (DB_VERBOSE))
fmt = _("Prerequisite `%s' is order-only for target `%s'.\n");
fmt = _("Prerequisite '%s' is order-only for target '%s'.\n");
}
else if (d_mtime == NONEXISTENT_MTIME)
{
if (ISDB (DB_BASIC))
fmt = _("Prerequisite `%s' of target `%s' does not exist.\n");
fmt = _("Prerequisite '%s' of target '%s' does not exist.\n");
}
else if (d->changed)
{
if (ISDB (DB_BASIC))
fmt = _("Prerequisite `%s' is newer than target `%s'.\n");
fmt = _("Prerequisite '%s' is newer than target '%s'.\n");
}
else if (ISDB (DB_VERBOSE))
fmt = _("Prerequisite `%s' is older than target `%s'.\n");
fmt = _("Prerequisite '%s' is older than target '%s'.\n");
if (fmt)
{
@@ -755,19 +757,19 @@ update_file_1 (struct file *file, unsigned int depth)
{
must_make = 1;
DBF (DB_BASIC,
_("Target `%s' is double-colon and has no prerequisites.\n"));
_("Target '%s' is double-colon and has no prerequisites.\n"));
}
else if (!noexist && file->is_target && !deps_changed && file->cmds == 0
&& !always_make_flag)
{
must_make = 0;
DBF (DB_VERBOSE,
_("No recipe for `%s' and no prerequisites actually changed.\n"));
_("No recipe for '%s' and no prerequisites actually changed.\n"));
}
else if (!must_make && file->cmds != 0 && always_make_flag)
{
must_make = 1;
DBF (DB_VERBOSE, _("Making `%s' due to always-make flag.\n"));
DBF (DB_VERBOSE, _("Making '%s' due to always-make flag.\n"));
}
if (!must_make)
@@ -775,9 +777,9 @@ update_file_1 (struct file *file, unsigned int depth)
if (ISDB (DB_VERBOSE))
{
print_spaces (depth);
printf (_("No need to remake target `%s'"), file->name);
printf (_("No need to remake target '%s'"), file->name);
if (!streq (file->name, file->hname))
printf (_("; using VPATH name `%s'"), file->hname);
printf (_("; using VPATH name '%s'"), file->hname);
puts (".");
fflush (stdout);
}
@@ -797,13 +799,13 @@ update_file_1 (struct file *file, unsigned int depth)
return 0;
}
DBF (DB_BASIC, _("Must remake target `%s'.\n"));
DBF (DB_BASIC, _("Must remake target '%s'.\n"));
/* It needs to be remade. If it's VPATH and not reset via GPATH, toss the
VPATH. */
if (!streq(file->name, file->hname))
{
DB (DB_BASIC, (_(" Ignoring VPATH name `%s'.\n"), file->hname));
DB (DB_BASIC, (_(" Ignoring VPATH name '%s'.\n"), file->hname));
file->ignore_vpath = 1;
}
@@ -812,20 +814,20 @@ 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"));
DBF (DB_VERBOSE, _("Recipe of '%s' is being run.\n"));
return 0;
}
switch (file->update_status)
{
case 2:
DBF (DB_BASIC, _("Failed to remake target file `%s'.\n"));
DBF (DB_BASIC, _("Failed to remake target file '%s'.\n"));
break;
case 0:
DBF (DB_BASIC, _("Successfully remade target file `%s'.\n"));
DBF (DB_BASIC, _("Successfully remade target file '%s'.\n"));
break;
case 1:
DBF (DB_BASIC, _("Target file `%s' needs remade under -q.\n"));
DBF (DB_BASIC, _("Target file '%s' needs remade under -q.\n"));
break;
default:
assert (file->update_status >= 0 && file->update_status <= 2);
@@ -836,8 +838,8 @@ update_file_1 (struct file *file, unsigned int depth)
return file->update_status;
}
/* Set FILE's `updated' flag and re-check its mtime and the mtime's of all
files listed in its `also_make' member. Under -t, this function also
/* Set FILE's 'updated' flag and re-check its mtime and the mtime's of all
files listed in its 'also_make' member. Under -t, this function also
touches FILE.
On return, FILE->update_status will no longer be -1 if it was. */
@@ -882,7 +884,7 @@ notice_finished_file (struct file *file)
file->update_status = touch_file (file);
/* Pretend we ran a real touch command, to suppress the
"`foo' is up to date" message. */
"'foo' is up to date" message. */
commands_started++;
/* Request for the timestamp to be updated (and distributed
@@ -1013,15 +1015,15 @@ check_dep (struct file *file, unsigned int depth,
if (!file->phony && file->cmds == 0 && !file->tried_implicit)
{
if (try_implicit_rule (file, depth))
DBF (DB_IMPLICIT, _("Found an implicit rule for `%s'.\n"));
DBF (DB_IMPLICIT, _("Found an implicit rule for '%s'.\n"));
else
DBF (DB_IMPLICIT, _("No implicit rule found for `%s'.\n"));
DBF (DB_IMPLICIT, _("No implicit rule found for '%s'.\n"));
file->tried_implicit = 1;
}
if (file->cmds == 0 && !file->is_target
&& default_file != 0 && default_file->cmds != 0)
{
DBF (DB_IMPLICIT, _("Using default commands for `%s'.\n"));
DBF (DB_IMPLICIT, _("Using default commands for '%s'.\n"));
file->cmds = default_file->cmds;
}
@@ -1113,6 +1115,10 @@ touch_file (struct file *file)
if (!silent_flag)
message (0, "touch %s", file->name);
/* Print-only (-n) takes precedence over touch (-t). */
if (just_print_flag)
return 0;
#ifndef NO_ARCHIVES
if (ar_name (file->name))
return ar_touch (file->name);
@@ -1198,7 +1204,7 @@ remake_file (struct file *file)
notice_finished_file (file);
}
/* Return the mtime of a file, given a `struct file'.
/* Return the mtime of a file, given a 'struct file'.
Caches the time in the struct file to avoid excess stat calls.
If the file is not found, and SEARCH is nonzero, VPATH searching and
@@ -1354,7 +1360,7 @@ f_mtime (struct file *file, int search)
if (adjusted_now < adjusted_mtime)
{
#ifdef NO_FLOAT
error (NILF, _("Warning: File `%s' has modification time in the future"),
error (NILF, _("Warning: File '%s' has modification time in the future"),
file->name);
#else
double from_now =
@@ -1367,7 +1373,7 @@ f_mtime (struct file *file, int search)
sprintf (from_now_string, "%lu", (unsigned long) from_now);
else
sprintf (from_now_string, "%.2g", from_now);
error (NILF, _("Warning: File `%s' has modification time %s s in the future"),
error (NILF, _("Warning: File '%s' has modification time %s s in the future"),
file->name, from_now_string);
#endif
clock_skew_detected = 1;
@@ -1534,8 +1540,7 @@ library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr)
unsigned int liblen;
/* Information about the earliest (in the vpath sequence) match. */
unsigned int best_vpath, best_path;
unsigned int std_dirs = 0;
unsigned int best_vpath = 0, best_path = 0;
char **dp;
@@ -1554,6 +1559,7 @@ library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr)
static char *buf = NULL;
static unsigned int buflen = 0;
static int libdir_maxlen = -1;
static unsigned int std_dirs = 0;
char *libbuf = variable_expand ("");
/* Expand the pattern using LIB as a replacement. */
@@ -1566,7 +1572,7 @@ library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr)
if (!p3)
{
/* Give a warning if there is no pattern. */
error (NILF, _(".LIBPATTERNS element `%s' is not a pattern"), p);
error (NILF, _(".LIBPATTERNS element '%s' is not a pattern"), p);
p[len] = c;
continue;
}
@@ -1576,7 +1582,7 @@ library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr)
p[len] = c;
}
/* Look first for `libNAME.a' in the current directory. */
/* Look first for 'libNAME.a' in the current directory. */
mtime = name_mtime (libbuf);
if (mtime != NONEXISTENT_MTIME)
{

View File

@@ -3,9 +3,7 @@
Please do not send bug reports or questions about it to
the Make maintainers.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
Copyright (C) 1988-2012 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -34,7 +32,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
char *remote_description = "Customs";
/* File name of the Customs `export' client command.
/* File name of the Customs 'export' client command.
A full path name can be used to avoid some path-searching overhead. */
#define EXPORT_COMMAND "/usr/local/bin/export"
@@ -175,7 +173,7 @@ start_remote_job (char **argv, char **envp, int stdin_fd,
len = Customs_MakeWayBill (&permit, normalized_cwd, argv[0], argv,
envp, retport, waybill);
/* Modify the waybill as if the remote child had done `child_access ()'. */
/* Modify the waybill as if the remote child had done 'child_access ()'. */
{
WayBill *wb = (WayBill *) waybill;
wb->ruid = wb->euid;
@@ -232,7 +230,7 @@ start_remote_job (char **argv, char **envp, int stdin_fd,
}
else if (pid == 0)
{
/* Child side. Run `export' to handle the connection. */
/* Child side. Run 'export' to handle the connection. */
static char sock_buf[20], retsock_buf[20], id_buf[20];
static char *new_argv[6] =
{ EXPORT_COMMAND, "-id", sock_buf, retsock_buf, id_buf, 0 };
@@ -253,7 +251,7 @@ start_remote_job (char **argv, char **envp, int stdin_fd,
exec_command (new_argv, envp);
}
/* Parent side. Return the `export' process's ID. */
/* Parent side. Return the 'export' process's ID. */
(void) close (retsock);
(void) close (sock);
*is_remote = 0;

View File

@@ -1,7 +1,5 @@
/* Template for the remote job exportation interface to GNU Make.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
Copyright (C) 1988-2012 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the

31
rule.c
View File

@@ -1,7 +1,5 @@
/* Pattern and suffix rule internals for GNU Make.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
Copyright (C) 1988-2012 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
@@ -126,7 +124,7 @@ count_implicit_rule_limits (void)
memcpy (name, dname, p - dname);
name[p - dname] = '\0';
/* In the deps of an implicit rule the `changed' flag
/* In the deps of an implicit rule the 'changed' flag
actually indicates that the dependency is in a
nonexistent subdirectory. */
@@ -151,7 +149,7 @@ count_implicit_rule_limits (void)
/* Create a pattern rule from a suffix rule.
TARGET is the target suffix; SOURCE is the source suffix.
CMDS are the commands.
If TARGET is nil, it means the target pattern should be `(%.o)'.
If TARGET is nil, it means the target pattern should be '(%.o)'.
If SOURCE is nil, it means there should be no deps. */
static void
@@ -166,8 +164,8 @@ convert_suffix_rule (const char *target, const char *source,
if (target == 0)
{
/* Special case: TARGET being nil means we are defining a `.X.a' suffix
rule; the target pattern is always `(%.o)'. */
/* Special case: TARGET being nil means we are defining a '.X.a' suffix
rule; the target pattern is always '(%.o)'. */
#ifdef VMS
*names = strcache_add_len ("(%.obj)", 7);
#else
@@ -261,14 +259,14 @@ convert_to_pattern (void)
continue;
if (s2len == 2 && rulename[slen] == '.' && rulename[slen + 1] == 'a')
/* A suffix rule `.X.a:' generates the pattern rule `(%.o): %.X'.
It also generates a normal `%.a: %.X' rule below. */
convert_suffix_rule (NULL, /* Indicates `(%.o)'. */
/* A suffix rule '.X.a:' generates the pattern rule '(%.o): %.X'.
It also generates a normal '%.a: %.X' rule below. */
convert_suffix_rule (NULL, /* Indicates '(%.o)'. */
dep_name (d),
f->cmds);
/* The suffix rule `.X.Y:' is converted
to the pattern rule `%.Y: %.X'. */
/* The suffix rule '.X.Y:' is converted
to the pattern rule '%.Y: %.X'. */
convert_suffix_rule (dep_name (d2), dep_name (d), f->cmds);
}
}
@@ -355,7 +353,7 @@ new_pattern_rule (struct rule *rule, int override)
/* Install an implicit pattern rule based on the three text strings
in the structure P points to. These strings come from one of
the arrays of default implicit pattern rules.
TERMINAL specifies what the `terminal' field of the rule should be. */
TERMINAL specifies what the 'terminal' field of the rule should be. */
void
install_pattern_rule (struct pspec *p, int terminal)
@@ -389,6 +387,7 @@ install_pattern_rule (struct pspec *p, int terminal)
anyway because somebody might want to free them later. */
r->cmds->commands = xstrdup (p->commands);
r->cmds->command_lines = 0;
r->cmds->recipe_prefix = RECIPEPREFIX_DEFAULT;
}
}
@@ -412,13 +411,13 @@ freerule (struct rule *rule, struct rule *lastrule)
/* We can't free the storage for the commands because there
are ways that they could be in more than one place:
* If the commands came from a suffix rule, they could also be in
the `struct file's for other suffix rules or plain targets given
the 'struct file's for other suffix rules or plain targets given
on the same makefile line.
* If two suffixes that together make a two-suffix rule were each
given twice in the .SUFFIXES list, and in the proper order, two
identical pattern rules would be created and the second one would
be discarded here, but both would contain the same `struct commands'
pointer from the `struct file' for the suffix rule. */
be discarded here, but both would contain the same 'struct commands'
pointer from the 'struct file' for the suffix rule. */
free (rule);

6
rule.h
View File

@@ -1,7 +1,5 @@
/* Definitions for using pattern rules in GNU Make.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 Free Software Foundation, Inc.
Copyright (C) 1988-2012 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
@@ -24,7 +22,7 @@ struct rule
struct rule *next;
const char **targets; /* Targets of the rule. */
unsigned int *lens; /* Lengths of each target. */
const char **suffixes; /* Suffixes (after `%') of each target. */
const char **suffixes; /* Suffixes (after '%') of each target. */
struct dep *deps; /* Dependencies of the rule. */
struct commands *cmds; /* Commands to execute. */
unsigned short num; /* Number of targets. */

View File

@@ -1,7 +1,5 @@
/* Convert between signal names and numbers.
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
Foundation, Inc.
Copyright (C) 1990-2012 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

View File

@@ -1,5 +1,5 @@
/* Constant string caching for GNU Make.
Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 2006-2012 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -16,29 +16,40 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include "make.h"
#include <stddef.h>
#include <assert.h>
#include "hash.h"
/* The size (in bytes) of each cache buffer.
Try to pick something that will map well into the heap. */
#define CACHE_BUFFER_SIZE (8192 - 16)
/* A string cached here will never be freed, so we don't need to worry about
reference counting. We just store the string, and then remember it in a
hash so it can be looked up again. */
typedef unsigned short int sc_buflen_t;
struct strcache {
struct strcache *next; /* The next block of strings. */
char *end; /* Pointer to the beginning of the free space. */
int count; /* # of strings in this buffer (for stats). */
int bytesfree; /* The amount of the buffer that is free. */
struct strcache *next; /* The next block of strings. Must be first! */
sc_buflen_t end; /* Offset to the beginning of free space. */
sc_buflen_t bytesfree; /* Free space left in this buffer. */
sc_buflen_t count; /* # of strings in this buffer (for stats). */
char buffer[1]; /* The buffer comes after this. */
};
static int bufsize = CACHE_BUFFER_SIZE;
/* The size (in bytes) of each cache buffer.
Try to pick something that will map well into the heap.
This must be able to be represented by a short int (<=65535). */
#define CACHE_BUFFER_BASE (8192)
#define CACHE_BUFFER_ALLOC(_s) ((_s) - (2 * sizeof (size_t)))
#define CACHE_BUFFER_OFFSET (offsetof (struct strcache, buffer))
#define CACHE_BUFFER_SIZE(_s) (CACHE_BUFFER_ALLOC(_s) - CACHE_BUFFER_OFFSET)
static sc_buflen_t bufsize = CACHE_BUFFER_SIZE (CACHE_BUFFER_BASE);
static struct strcache *strcache = NULL;
static struct strcache *fullcache = NULL;
static unsigned long total_buffers = 0;
static unsigned long total_strings = 0;
static unsigned long total_size = 0;
/* Add a new buffer to the cache. Add it at the front to reduce search time.
This can also increase the overhead, since it's less likely that older
@@ -49,50 +60,65 @@ static struct strcache *
new_cache()
{
struct strcache *new;
new = xmalloc (sizeof (*new) + bufsize);
new->end = new->buffer;
new = xmalloc (bufsize + CACHE_BUFFER_OFFSET);
new->end = 0;
new->count = 0;
new->bytesfree = bufsize;
new->next = strcache;
strcache = new;
++total_buffers;
return new;
}
static const char *
add_string(const char *str, int len)
add_string (const char *str, unsigned int len)
{
struct strcache *best = NULL;
char *res;
struct strcache *sp;
const char *res;
struct strcache **spp = &strcache;
/* We need space for the nul char. */
unsigned int sz = len + 1;
/* If the string we want is too large to fit into a single buffer, then
we're screwed; nothing will ever fit! Change the maximum size of the
cache to be big enough. */
if (len > bufsize)
bufsize = len * 2;
/* First, find a cache with enough free space. We always look through all
the blocks and choose the one with the best fit (the one that leaves the
least amount of space free). */
for (sp = strcache; sp != NULL; sp = sp->next)
if (sp->bytesfree > len && (!best || best->bytesfree > sp->bytesfree))
best = sp;
no existing cache is large enough. Change the maximum size. */
if (sz > bufsize)
bufsize = CACHE_BUFFER_SIZE ((((sz + 1) / CACHE_BUFFER_BASE) + 1)
* CACHE_BUFFER_BASE);
else
/* Find the first cache with enough free space. */
for (; *spp != NULL; spp = &(*spp)->next)
if ((*spp)->bytesfree > sz)
break;
/* If nothing is big enough, make a new cache. */
if (!best)
best = new_cache();
sp = *spp;
if (sp == NULL)
{
sp = new_cache ();
spp = &sp;
}
assert (best->bytesfree > len);
/* Add the string to this cache. */
res = &sp->buffer[sp->end];
memmove (res, str, len);
res[len] = '\0';
sp->end += sz;
sp->bytesfree -= sz;
++sp->count;
/* Add the string to the best cache. */
res = best->end;
memcpy (best->end, str, len);
best->end += len;
*(best->end++) = '\0';
best->bytesfree -= len + 1;
++best->count;
/* If the amount free in this cache is less than the average string size,
consider it full and move it to the full list. */
++total_strings;
total_size += sz;
if (sp->bytesfree < (total_size / total_strings) + 1)
{
*spp = (*spp)->next;
sp->next = fullcache;
fullcache = sp;
}
return res;
}
@@ -128,7 +154,7 @@ add_hash (const char *str, int len)
char *const *slot = (char *const *) hash_find_slot (&strings, str);
const char *key = *slot;
/* Count the total number of adds we performed. */
/* Count the total number of add operations we performed. */
++total_adds;
if (!HASH_VACANT (key))
@@ -147,7 +173,10 @@ strcache_iscached (const char *str)
struct strcache *sp;
for (sp = strcache; sp != 0; sp = sp->next)
if (str >= sp->buffer && str < sp->end)
if (str >= sp->buffer && str < sp->buffer + sp->end)
return 1;
for (sp = fullcache; sp != 0; sp = sp->next)
if (str >= sp->buffer && str < sp->buffer + sp->end)
return 1;
return 0;
@@ -163,7 +192,7 @@ strcache_add (const char *str)
}
const char *
strcache_add_len (const char *str, int len)
strcache_add_len (const char *str, unsigned int len)
{
/* If we're not given a nul-terminated string we have to create one, because
the hashing functions expect it. */
@@ -179,7 +208,7 @@ strcache_add_len (const char *str, int len)
}
int
strcache_setbufsize(int size)
strcache_setbufsize(unsigned int size)
{
if (size > bufsize)
bufsize = size;
@@ -198,49 +227,65 @@ strcache_init (void)
void
strcache_print_stats (const char *prefix)
{
int numbuffs = 0, numstrs = 0;
int totsize = 0, avgsize, maxsize = 0, minsize = bufsize;
int totfree = 0, avgfree, maxfree = 0, minfree = bufsize;
int lastused = 0, lastfree = 0;
const struct strcache *sp;
unsigned long numbuffs = 0, fullbuffs = 0;
unsigned long totfree = 0, maxfree = 0, minfree = bufsize;
if (strcache)
if (! strcache)
{
const struct strcache *sp;
/* Count the first buffer separately since it's not full. */
lastused = strcache->end - strcache->buffer;
lastfree = strcache->bytesfree;
for (sp = strcache->next; sp != NULL; sp = sp->next)
{
int bf = sp->bytesfree;
int sz = sp->end - sp->buffer;
++numbuffs;
numstrs += sp->count;
totsize += sz;
maxsize = (sz > maxsize ? sz : maxsize);
minsize = (sz < minsize ? sz : minsize);
totfree += bf;
maxfree = (bf > maxfree ? bf : maxfree);
minfree = (bf < minfree ? bf : minfree);
}
printf(_("\n%s No strcache buffers\n"), prefix);
return;
}
avgsize = numbuffs ? (int)(totsize / numbuffs) : 0;
avgfree = numbuffs ? (int)(totfree / numbuffs) : 0;
/* Count the first buffer separately since it's not full. */
for (sp = strcache->next; sp != NULL; sp = sp->next)
{
sc_buflen_t bf = sp->bytesfree;
printf (_("\n%s # of strings in strcache: %d / lookups = %lu / hits = %lu\n"),
prefix, numstrs, total_adds, (total_adds - numstrs));
printf (_("%s # of strcache buffers: %d (* %d B/buffer = %d B)\n"),
prefix, (numbuffs + 1), bufsize, ((numbuffs + 1) * bufsize));
printf (_("%s strcache used: total = %d (%d) / max = %d / min = %d / avg = %d\n"),
prefix, totsize, lastused, maxsize, minsize, avgsize);
printf (_("%s strcache free: total = %d (%d) / max = %d / min = %d / avg = %d\n"),
prefix, totfree, lastfree, maxfree, minfree, avgfree);
totfree += bf;
maxfree = (bf > maxfree ? bf : maxfree);
minfree = (bf < minfree ? bf : minfree);
fputs (_("\n# strcache hash-table stats:\n# "), stdout);
++numbuffs;
}
for (sp = fullcache; sp != NULL; sp = sp->next)
{
sc_buflen_t bf = sp->bytesfree;
totfree += bf;
maxfree = (bf > maxfree ? bf : maxfree);
minfree = (bf < minfree ? bf : minfree);
++numbuffs;
++fullbuffs;
}
/* Make sure we didn't lose any buffers. */
assert (total_buffers == numbuffs + 1);
printf (_("\n%s strcache buffers: %lu (%lu) / strings = %lu / storage = %lu B / avg = %lu B\n"),
prefix, numbuffs + 1, fullbuffs, total_strings, total_size,
(total_size / total_strings));
printf (_("%s current buf: size = %hu B / used = %hu B / count = %hu / avg = %hu B\n"),
prefix, bufsize, strcache->end, strcache->count,
(strcache->end / strcache->count));
if (numbuffs)
{
unsigned long sz = total_size - bufsize;
unsigned long cnt = total_strings - strcache->count;
sc_buflen_t avgfree = totfree / numbuffs;
printf (_("%s other used: total = %lu B / count = %lu / avg = %lu B\n"),
prefix, sz, cnt, sz / cnt);
printf (_("%s other free: total = %lu B / max = %lu B / min = %lu B / avg = %hu B\n"),
prefix, totfree, maxfree, minfree, avgfree);
}
printf (_("\n%s strcache performance: lookups = %lu / hit rate = %lu%%\n"),
prefix, total_adds, (long unsigned)(100.0 * (total_adds - total_strings) / total_adds));
fputs (_("# hash-table stats:\n# "), stdout);
hash_print_stats (&strings, stdout);
}

View File

@@ -1,6 +1,5 @@
@echo off
rem Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
rem 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
rem Copyright (C) 1996-2012 Free Software Foundation, Inc.
rem This file is part of GNU Make.
rem
rem GNU Make is free software; you can redistribute it and/or modify it under

View File

@@ -1 +1,3 @@
work
.*gdbinit
.gdb_history

View File

@@ -1,3 +1,147 @@
2012-10-29 Paul Smith <psmith@gnu.org>
* scripts/features/load: New test suite for the "load" directive.
2012-09-09 Paul Smith <psmith@gnu.org>
* scripts/functions/file: Get errors in the C locale, not the
current locale. Fixes Savannah bug #35764.
* scripts/features/escape: Check that backslashes before
non-special characters are not removed.
* scripts/features/utf8: New test for UTF-8 support.
See Savannah bug #36529.
* scripts/targets/POSIX: Add tests for default macro values as
specified by IEEE Std 1003.1-2008. See Savannah bug #37069.
2012-03-04 Paul Smith <psmith@gnu.org>
* scripts/features/se_explicit: Test $(x:%=%) format in secondary
expansion prerequisite lists. See Savannah bug #16545.
* scripts/features/escape: Test escaped ":" in prerequisite lists.
See Savannah bug #12126.
* scripts/variables/private: Test appending private variables in
pattern-specific target rules. See Savannah bug #35468.
2012-03-03 Paul Smith <psmith@gnu.org>
* scripts/variables/SHELL: Ensure .SHELLFLAGS works with options
separated by whitespace.
* scripts/targets/ONESHELL: Try .ONESHELL in combination with
whitespace-separated options in .SHELLFLAGS. See Savannah bug #35397.
* scripts/functions/filter-out: Add filter tests and test escape
operations. See Savannah bug #35410.
* guile.supp: Suppress valgrind errors from Guile
* run_make_tests.pl: Use the Guile suppression file.
* scripts/misc/bs-nl: Check for POSIX and non-POSIX
backslash/newline handling. Addresses Savannah bug #16670.
2012-01-29 Paul Smith <psmith@gnu.org>
* scripts/variables/flavors: Add tests for ::=
* scripts/variables/define: Ditto
* scripts/functions/file: Test the new $(file ...) function.
2012-01-12 Paul Smith <psmith@gnu.org>
* scripts/functions/guile: New regression tests for Guile support.
2011-12-10 Paul Smith <psmith@gnu.org>
* scripts/targets/SECONDARY: Add prereq statements to ensure rules
are printed in the right order for test #9
2011-11-14 Paul Smith <psmith@gnu.org>
* scripts/features/double_colon: Check double-colon with escaped
filenames. See Savannah bug #33399.
2011-09-18 Paul Smith <psmith@gnu.org>
* scripts/features/parallelism: On re-exec make sure we preserve
the value of MAKEFLAGS when necessary. See Savannah bug #33873.
* scripts/features/vpath3: Verify handling of -lfoo libraries
found via vpath vs. the standard directory search.
See Savannah bug #32511.
2011-09-12 Paul Smith <psmith@gnu.org>
* scripts/functions/call: Verify that using export in a $(call ...)
context creates a global variable. See Savannah bug #32498.
2011-09-02 Paul Smith <psmith@gnu.org>
* scripts/options/dash-n: Verify that in "-n -t", the -n takes
priority. Patch from Michael Witten <mfwitten@gmail.com>.
2011-08-29 Paul Smith <psmith@gnu.org>
* scripts/features/varnesting: Test resetting of variables while
expanding them. See Savannah patch #7534
2011-06-12 Paul Smith <psmith@gnu.org>
* scripts/features/archives: Check archives with whitespace at the
beginning, end, and extra in the middle.
Another test for Savannah bug #30612.
2011-05-07 Paul Smith <psmith@gnu.org>
* scripts/variables/private: Ensure we skip private variables when
appending. Test for Savannah bug #32872.
* scripts/functions/wildcard: Verify wildcard used to test for
file existence/non-existence.
2011-05-02 Paul Smith <psmith@gnu.org>
* scripts/functions/sort: Add a test for Savannah bug #33125.
2011-04-17 David A. Wheeler <dwheeler@dwheeler.com>
* scripts/features/shell_assignment: Regression for "!=" feature
2010-11-06 Paul Smith <psmith@gnu.org>
* scripts/features/targetvars: Fix known-good output for BS/NL changes.
* scripts/functions/call: Ditto.
* scripts/variables/special: Ditto.
* scripts/misc/bs-nl: New test suite for backslash/newline testing.
2010-08-29 Paul Smith <psmith@gnu.org>
* scripts/features/errors: Add new error message to output text.
* scripts/variables/SHELL: Ditto.
* scripts/targets/POSIX: Ditto.
* scripts/options/dash-k: Ditto.
* scripts/features/vpathplus: Ditto.
* scripts/features/patternrules: Ditto.
* scripts/features/parallelism: Ditto.
2010-08-13 Paul Smith <psmith@gnu.org>
* scripts/features/archives: New regression tests for archive
support. Test for fix to Savannah bug #30612.
* run_make_tests.pl (set_more_defaults): Set a %FEATURES hash to
the features available in $(.FEATURES).
2010-08-10 Paul Smith <psmith@gnu.org>
* scripts/features/reinvoke: Ensure command line variable settings
are preserved across make re-exec. Tests Savannah bug #30723.
2010-07-28 Paul Smith <psmith@gnu.org>
* scripts/targets/POSIX: Compatibility issues with Solaris (and
@@ -1062,8 +1206,7 @@
ChangeLog file for the test suite created.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
Copyright (C) 1992-2012 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

View File

@@ -162,8 +162,7 @@ Changes from 0.1 to 0.2 (5-4-92):
-------------------------------------------------------------------------------
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
Copyright (C) 1992-2012 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

View File

@@ -7,8 +7,7 @@ This entire test suite, including all test files, are copyright and
distributed under the following terms:
-----------------------------------------------------------------------------
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
Copyright (C) 1992-2012 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the

31
tests/guile.supp Normal file
View File

@@ -0,0 +1,31 @@
# Guile valgrind suppression file
# Created with Guile 1.8.7
# --- Garbage collection
{
guilegc
Memcheck:Cond
...
fun:scm_gc_for_newcell
}
{
guilegc
Memcheck:Value4
...
fun:scm_gc_for_newcell
}
{
guilegc
Memcheck:Value8
...
fun:scm_gc_for_newcell
}
# -- scm_alloc_struct
{
guileheap
Memcheck:Leak
...
fun:scm_alloc_struct
}

View File

@@ -3,9 +3,7 @@
# Simple script to make a "shadow" test directory, using symbolic links.
# Typically you'd put the shadow in /tmp or another local disk
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
# Foundation, Inc.
# Copyright (C) 1992-2012 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
@@ -28,7 +26,7 @@ esac
dest="$1"
if [ ! -d "$dest" ]; then
echo "Destination directory \`$dest' must exist!"
echo "Destination directory '$dest' must exist!"
exit 1
fi
@@ -55,5 +53,5 @@ done
rm -rf work
echo "Shadow test suite created in \`$dest/$name'."
echo "Shadow test suite created in '$dest/$name'."
exit 0

View File

@@ -11,9 +11,7 @@
# [-make <make prog>]
# (and others)
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
# Foundation, Inc.
# Copyright (C) 1992-2012 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
@@ -29,10 +27,11 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
%FEATURES = ();
$valgrind = 0; # invoke make with valgrind
$valgrind_args = '';
$memcheck_args = '--num-callers=15 --tool=memcheck --leak-check=full';
$memcheck_args = '--num-callers=15 --tool=memcheck --leak-check=full --suppressions=guile.supp';
$massif_args = '--num-callers=15 --tool=massif --alloc-fn=xmalloc --alloc-fn=xcalloc --alloc-fn=xrealloc --alloc-fn=xstrdup --alloc-fn=xstrndup';
$pure_log = undef;
@@ -98,6 +97,17 @@ sub valid_option
$old_makefile = undef;
sub subst_make_string
{
local $_ = shift;
$makefile and s/#MAKEFILE#/$makefile/g;
s/#MAKEPATH#/$mkpath/g;
s/#MAKE#/$make_name/g;
s/#PERL#/$perl_name/g;
s/#PWD#/$pwd/g;
return $_;
}
sub run_make_test
{
local ($makestring, $options, $answer, $err_code, $timeout) = @_;
@@ -115,16 +125,9 @@ sub run_make_test
$makefile = &get_tmpfile();
}
# Make sure it ends in a newline.
# Make sure it ends in a newline and substitute any special tokens.
$makestring && $makestring !~ /\n$/s and $makestring .= "\n";
# Replace @MAKEFILE@ with the makefile name and @MAKE@ with the path to
# make
$makestring =~ s/#MAKEFILE#/$makefile/g;
$makestring =~ s/#MAKEPATH#/$mkpath/g;
$makestring =~ s/#MAKE#/$make_name/g;
$makestring =~ s/#PERL#/$perl_name/g;
$makestring =~ s/#PWD#/$pwd/g;
$makestring = subst_make_string($makestring);
# Populate the makefile!
open(MAKEFILE, "> $makefile") || die "Failed to open $makefile: $!\n";
@@ -133,13 +136,8 @@ sub run_make_test
}
# Do the same processing on $answer as we did on $makestring.
$answer && $answer !~ /\n$/s and $answer .= "\n";
$answer =~ s/#MAKEFILE#/$makefile/g;
$answer =~ s/#MAKEPATH#/$mkpath/g;
$answer =~ s/#MAKE#/$make_name/g;
$answer =~ s/#PERL#/$perl_name/g;
$answer =~ s/#PWD#/$pwd/g;
$answer = subst_make_string($answer);
run_make_with_options($makefile, $options, &get_logfile(0),
$err_code, $timeout);
@@ -317,7 +315,7 @@ sub set_more_defaults
$mk or die "FATAL ERROR: Cannot determine the value of \$(MAKE):\n
'echo \"all:;\@echo \\\$(MAKE)\" | $make_path -f-' failed!\n";
$make_path = $mk;
print "Make\t= `$make_path'\n" if $debug;
print "Make\t= '$make_path'\n" if $debug;
$string = `$make_path -v -f /dev/null 2> /dev/null`;
@@ -367,6 +365,8 @@ sub set_more_defaults
$parallel_jobs = 1;
}
%FEATURES = map { $_ => 1 } split /\s+/, `sh -c "echo '\\\$(info \\\$(.FEATURES))' | $make_path -f- 2>/dev/null"`;
# Set up for valgrind, if requested.
if ($valgrind) {

View File

@@ -0,0 +1,47 @@
# -*-mode: perl-*-
$description = "Test GNU make's archive management features.";
$details = "\
This only works on systems that support it.";
# If this instance of make doesn't support archives, skip it
exists $FEATURES{archives} or return -1;
# Create some .o files to work with
utouch(-60, qw(a1.o a2.o a3.o));
# Very simple
run_make_test('all: libxx.a(a1.o)',
'', "ar rv libxx.a a1.o\nar: creating libxx.a\na - a1.o\n");
# Multiple .o's. Add a new one to the existing library
run_make_test('all: libxx.a(a1.o a2.o)',
'', "ar rv libxx.a a2.o\na - a2.o\n");
# Touch one of the .o's so it's rebuilt
utouch(-40, 'a1.o');
run_make_test(undef, '', "ar rv libxx.a a1.o\nr - a1.o\n");
# Use wildcards
run_make_test('all: libxx.a(*.o)',
'', "#MAKE#: Nothing to be done for 'all'.\n");
# Touch one of the .o's so it's rebuilt
utouch(-30, 'a1.o');
run_make_test(undef, '', "ar rv libxx.a a1.o\nr - a1.o\n");
# Use both wildcards and simple names
utouch(-50, 'a2.o');
run_make_test('all: libxx.a(a3.o *.o)', '',
"ar rv libxx.a a3.o\na - a3.o\nar rv libxx.a a2.o\nr - a2.o\n");
# Check whitespace handling
utouch(-40, 'a2.o');
run_make_test('all: libxx.a( a3.o *.o )', '',
"ar rv libxx.a a2.o\nr - a2.o\n");
rmfiles(qw(a1.o a2.o a3.o libxx.a));
# This tells the test driver that the perl test script executed properly.
1;

View File

@@ -151,5 +151,14 @@ two');
unlink('result','one','two');
# TEST 10: check for proper backslash handling
# Savannah bug #33399
run_make_test('
a\ xb :: ; @echo one
a\ xb :: ; @echo two
',
'', "one\ntwo\n");
# This tells the test driver that the perl test script executed properly.
1;

View File

@@ -42,15 +42,17 @@ close(MAKEFILE);
unlink("cleanit");
$cleanit_error = `sh -c "$rm_command cleanit 2>&1"`;
chomp $cleanit_error;
$delete_error_code = $? >> 8;
# TEST #1
# -------
$answer = "$rm_command cleanit\n"
. $cleanit_error
."$make_name: [clean] Error $delete_error_code (ignored)\n"
."$rm_command foo\n";
$answer = "$rm_command cleanit
$cleanit_error
$makefile:2: recipe for target 'clean' failed
$make_name: [clean] Error $delete_error_code (ignored)
$rm_command foo\n";
&run_make_with_options($makefile,"",&get_logfile);
@@ -74,10 +76,11 @@ if (!$vos)
# TEST #2
# -------
$answer = "$rm_command cleanit\n"
. $cleanit_error
."$make_name: [clean2] Error $delete_error_code (ignored)\n"
."$rm_command foo\n";
$answer = "$rm_command cleanit
$cleanit_error
$makefile:5: recipe for target 'clean2' failed
$make_name: [clean2] Error $delete_error_code (ignored)
$rm_command foo\n";
&run_make_with_options($makefile,"clean2 -i",&get_logfile);

View File

@@ -2,12 +2,10 @@
$description = "Test various types of escaping in makefiles.";
$details = "\
Make sure that escaping of `:' works in target names.
Make sure that escaping of ':' works in target names.
Make sure escaping of whitespace works in target names.
Make sure that escaping of '#' works.";
close(MAKEFILE);
Make sure that escaping of '#' works.
Make sure that backslash before non-special characters are kept.";
# TEST 1
@@ -26,7 +24,7 @@ foo\#bar.ext: ; @echo "foo#bar.ext = ($@)"',
run_make_test(undef,
'path=pre:',
"#MAKEFILE#:2: *** target pattern contains no `%'. Stop.",
"#MAKEFILE#:2: *** target pattern contains no '%'. Stop.",
512);
# TEST 3: This one should work, since we escape the ":".
@@ -39,7 +37,7 @@ run_make_test(undef,
run_make_test(undef,
"'path=pre\\\\:'",
"#MAKEFILE#:2: *** target pattern contains no `%'. Stop.",
"#MAKEFILE#:2: *** target pattern contains no '%'. Stop.",
512);
# TEST 5: This one should work
@@ -54,5 +52,21 @@ run_make_test(undef,
'sharp',
'foo#bar.ext = (foo#bar.ext)');
# Test escaped colons in prerequisites
# Quoting of backslashes in q!! is kind of messy.
run_make_test(q!
foo: foo\\:bar foo\\\\\\:bar foo\\\\\\\\\\:bar
foo foo\\:bar foo\\\\\\:bar foo\\\\\\\\\\:bar: ; @echo '$@'
!,
'', "foo:bar\nfoo\\:bar\nfoo\\\\:bar\nfoo\n");
# Test backslash before non-special chars: should be kept as-is
run_make_test(q!
all: ..\foo
.DEFAULT: ; @echo '$@'
!,
'', '..\foo');
# This tells the test driver that the perl test script executed properly.
1;

View File

@@ -1,6 +1,6 @@
# -*-mode: perl; rm-trailing-spaces: nil-*-
$description = "Test various forms of the GNU make `include' command.";
$description = "Test various forms of the GNU make 'include' command.";
$details = "\
Test include, -include, sinclude and various regressions involving them.
@@ -60,7 +60,7 @@ run_make_test
error: foo.mk ; @echo $@
',
'',
"#MAKE#: *** No rule to make target `foo.mk', needed by `error'. Stop.\n",
"#MAKE#: *** No rule to make target 'foo.mk', needed by 'error'. Stop.\n",
512
);
@@ -128,7 +128,7 @@ foo: baz
bar: baz
',
'',
"#MAKE#: *** No rule to make target `baz', needed by `bar'. Stop.\n",
"#MAKE#: *** No rule to make target 'baz', needed by 'bar'. Stop.\n",
512);
# Test that the diagnostics is issued even if the target has been
@@ -144,7 +144,7 @@ bar: baz
baz: end
',
'',
"#MAKE#: *** No rule to make target `end', needed by `baz'. Stop.\n",
"#MAKE#: *** No rule to make target 'end', needed by 'baz'. Stop.\n",
512);
# Test that the diagnostics is issued even if the target has been
@@ -162,7 +162,7 @@ baz: end
',
'',
"#MAKEFILE#:2: bar: No such file or directory
#MAKE#: *** No rule to make target `end', needed by `baz'. Stop.\n",
#MAKE#: *** No rule to make target 'end', needed by 'baz'. Stop.\n",
512);
if ($all_tests) {
@@ -172,7 +172,7 @@ if ($all_tests) {
include foo
foo: ; @echo foo = bar > $@
!,
'', "#MAKE#: `foo' is up to date.\n");
'', "#MAKE#: 'foo' is up to date.\n");
rmfiles('foo');
}

View File

@@ -0,0 +1,84 @@
# -*-perl-*-
$description = "Test the load operator.";
$details = "Test dynamic loading of modules.";
# Don't do anything if this system doesn't support "load"
exists $FEATURES{load} or return -1;
# First build a shared object
# Provide both a default and non-default load symbol
unlink(qw(testload.c testload.so));
open(my $F, '> testload.c') or die "open: testload.c: $!\n";
print $F <<'EOF' ;
#include <string.h>
#include <stdio.h>
void define_new_function (void *, const char *, int, int, int,
char *(*)(char *, char **, const char *));
char *variable_buffer_output (char *, const char *, unsigned int);
static char *
func_test(char *o, char **argv, const char *funcname)
{
return variable_buffer_output (o, funcname, strlen (funcname));
}
int
testload_gmake_setup ()
{
define_new_function (0, "func-a", 1, 1, 1, func_test);
return 1;
}
int
explicit_setup ()
{
define_new_function (0, "func-b", 1, 1, 1, func_test);
return 1;
}
EOF
close($F) or die "close: testload.c: $!\n";
run_make_test('testload.so: testload.c ; @$(CC) -g -shared -fPIC -o $@ $<',
'', '');
# TEST 1
run_make_test(q!
all: ; @echo $(func-a foo) $(func-b bar)
load ./testload.so
!,
'', "func-a\n");
# TEST 2
# Load a different function
run_make_test(q!
all: ; @echo $(func-a foo) $(func-b bar)
load ./testload.so(explicit_setup)
!,
'', "func-b\n");
# TEST 3
# Verify the .LOADED variable
run_make_test(q!
all: ; @echo $(filter ./testload.so,$(.LOADED)) $(func-a foo) $(func-b bar)
load ./testload.so(explicit_setup)
!,
'', "./testload.so func-b\n");
# TEST 4
# Check multiple loads
run_make_test(q!
all: ; @echo $(filter ./testload.so,$(.LOADED)) $(func-a foo) $(func-b bar)
load ./testload.so
load ./testload.so(explicit_setup)
!,
'', "./testload.so func-a\n");
unlink(qw(testload.c testload.so)) unless $keep;
# This tells the test driver that the perl test script executed properly.
1;

View File

@@ -47,7 +47,7 @@ else
$error_code);
# Create the answer to what should be produced by this Makefile
$answer = "$make_name: *** No rule to make target `extra.h', needed by `foo.o'. Stop.\n";
$answer = "$make_name: *** No rule to make target 'extra.h', needed by 'foo.o'. Stop.\n";
&compare_output($answer,&get_logfile(1));

View File

@@ -98,14 +98,17 @@ fail.1 fail.2 fail.3:
ok:
\@sleep 4
\@echo Ok done",
'-rR -j5', 'Fail
'-rR -j5', "Fail
#MAKEFILE#:6: recipe for target 'fail.1' failed
#MAKE#: *** [fail.1] Error 1
#MAKE#: *** Waiting for unfinished jobs....
Fail
#MAKEFILE#:6: recipe for target 'fail.2' failed
#MAKE#: *** [fail.2] Error 1
Fail
#MAKEFILE#:6: recipe for target 'fail.3' failed
#MAKE#: *** [fail.3] Error 1
Ok done',
Ok done",
512);
@@ -164,6 +167,23 @@ inc.mk:
rmfiles('inc.mk');
# TEST #11: Make sure -jN from MAKEFLAGS is processed even when we re-exec
# See Savannah bug #33873
$extraENV{MAKEFLAGS} = '-j4';
run_make_test(q!
things = thing1 thing2
all: $(things)
$(things):; @echo '$@ start'; sleep 1; echo '$@ end'
-include inc.mk
inc.mk: ; @touch $@
!,
'', "thing1 start\nthing2 start\nthing1 end\nthing2 end\n");
delete $extraENV{MAKEFLAGS};
rmfiles('inc.mk');
if ($all_tests) {
# Implicit files aren't properly recreated during parallel builds
# Savannah bug #26864
@@ -194,6 +214,23 @@ rm main.x");
rmfiles(qw(foo.y foo.y.in main.bar));
}
# Ensure intermediate/secondary files are not pruned incorrectly.
# See Savannah bug #30653
utouch(-15, 'file2');
utouch(-10, 'file4');
utouch(-5, 'file1');
run_make_test(q!
.INTERMEDIATE: file3
file4: file3 ; @mv -f $< $@
file3: file2 ; touch $@
file2: file1 ; @touch $@
!,
'--no-print-directory -j2', "touch file3");
rmfiles('file1', 'file2', 'file3', 'file4');
if ($all_tests) {
# Jobserver FD handling is messed up in some way.
# Savannah bug #28189

View File

@@ -110,7 +110,8 @@ $(dir)/foo.bar:
',
"dir=$dir",
"#MAKE#: *** [$dir/foo.bar] Error 1",
"#MAKEFILE#:6: recipe for target '$dir/foo.bar' failed
#MAKE#: *** [$dir/foo.bar] Error 1",
512);
unlink("$dir/foo.bar");
@@ -203,7 +204,7 @@ CWEAVE := :
%.tex : %.w %.ch
!,
'foo.tex',
"#MAKE#: *** No rule to make target `foo.tex'. Stop.", 512);
"#MAKE#: *** No rule to make target 'foo.tex'. Stop.", 512);
unlink(@f);

Some files were not shown because too many files have changed in this diff Show More