Compare commits

...

238 Commits

Author SHA1 Message Date
Paul Smith
1d4c15b4e1 Release GNU Make version 3.99.93. 2013-10-01 00:33:01 -04:00
Paul Smith
b1c7f0df4e Fix portability issues for Guile 1.8. 2013-09-30 10:56:20 -04:00
Paul Smith
8e12202870 Final fixes for obscure output-sync errors. 2013-09-30 00:12:36 -04:00
Paul Smith
1f4ca0539b Fixes for building with MSVC. 2013-09-30 00:12:36 -04:00
Paul Smith
d0944ee2e8 Solaris /bin/sh can't handle multiple options ("-e -c"). 2013-09-30 00:12:18 -04:00
Paul Smith
38066b6f19 Fix build failures on EMX for output-sync support. 2013-09-29 13:17:56 -04:00
Paul Smith
3bf3fde984 Portability for Guile 1.8. Force UTF-8 encoding. 2013-09-29 13:16:21 -04:00
Paul Smith
543521cd47 Reset GNUMAKEFLAGS after parsing.
If we don't do this we'll continually add flags on recursion.  This
is mainly for users to set in their environment before invoking make.
2013-09-29 13:15:00 -04:00
Paul Smith
e8122ecb5d Rename dash-w to print-directory.
Avoid conflicts with dash-W on case-insensitive filesystems.
2013-09-23 11:24:51 -04:00
Eli Zaretskii
55a0c0e414 Fix broken w32 build due to OUTPUT_SYNC -> NO_OUTPUT_SYNC inversion.
w32/compat/posixfcn.c: Fix the forgotten OUTPUT_SYNC conditional.
 job.h: Ditto, but in a comment.
2013-09-23 10:56:51 +03:00
Paul Smith
8a3436c65d Release GNU Make version 3.99.92. 2013-09-23 00:55:55 -04:00
Paul Smith
fd30db1290 [SV 31155] Parse order-only tokens in second expansion results. 2013-09-22 17:10:35 -04:00
Paul Smith
c3524b83b9 Use explicit cast between void* and pointer-to-function. 2013-09-22 17:10:35 -04:00
Paul Smith
0296e40fc7 Allow loaded objects to opt out of the "auto-rebuild" feature. 2013-09-22 17:10:35 -04:00
Paul Smith
f69922b335 Defer Guile initialization until the first $(guile...) call. 2013-09-22 17:10:35 -04:00
Paul Smith
65931ce7a9 Regression test portability to Solaris. 2013-09-22 17:10:34 -04:00
Paul Smith
1a991ada47 Add VMS port updates from Hartmut Becker. 2013-09-22 17:10:34 -04:00
Paul Smith
7e77685bc3 Portability enhancements for Mac OSX.
Don't dup stdout into stderr in the test suite.
Don't rely on $port_type eq "UNIX" to mean case-preserving.
Check against the real output of ar when creating archives.
2013-09-22 17:09:46 -04:00
Paul Smith
300d1296fb Create a target that tests alternative configurations. 2013-09-21 18:10:08 -04:00
Paul Smith
822f8dae41 Remove obsolete tests. 2013-09-21 17:41:11 -04:00
Paul Smith
d2d44f76c4 Invert the #define for output-sync: turn it off with NO_OUTPUT_SYNC 2013-09-21 17:37:59 -04:00
Paul Smith
6c3e88e60f Ensure that output generated while reading makefiles is synced. 2013-09-21 17:24:59 -04:00
Paul Smith
9cd01958da Ensure that stderr from shell functions in recipes is synced. 2013-09-21 17:08:42 -04:00
Paul Smith
4120f91846 Don't write "Entering" every time we re-exec for remake makefiles. 2013-09-21 14:24:44 -04:00
Paul Smith
30a5ee0d85 [SV 40043] Set the current directory before printing errors. 2013-09-18 19:29:28 -04:00
Eli Zaretskii
8a6205b43f Fix a typo in a comment. 2013-09-16 11:42:20 +03:00
Eli Zaretskii
bc120f27bd Avoid compiler warnings in output.c on MS-Windows.
output.c [WINDOWS32]: Include windows.h and sub_proc.h, to avoid
 compiler warnings for CLOSE_ON_EXEC.
2013-09-16 11:30:01 +03:00
Paul Smith
5c0fba7240 Release GNU Make version 3.99.91. 2013-09-16 00:30:01 -04:00
Paul Smith
fa0f2c516a Small cleanup defining MAKEFLAGS. 2013-09-16 00:12:09 -04:00
Paul Smith
20ecc58126 [SV 31326] Enhance the info on static pattern errors. 2013-09-15 17:53:30 -04:00
Paul Smith
1b90248893 [SV 27374] Fatal immediately on unrecoverable fopen() errors. 2013-09-15 17:09:01 -04:00
Paul Smith
a4d8444b59 [SV 39934] Verify jobserver FDs before something else uses them. 2013-09-15 15:21:33 -04:00
Paul Smith
0a81d50d66 [SV 39203] Don't set MAKEFLAGS when restarting.
We are restarting with the original command line flags, so if we set
MAKEFLAGS as well that will cause double flags.
2013-09-15 13:30:21 -04:00
Paul Smith
3aa2aa7e82 [SV 35248] Add --debug "n" flag to turn off current debug options. 2013-09-14 21:01:10 -04:00
Paul Smith
29a94ceb76 [SV 33134] Don't try to close stdout when it's already closed. 2013-09-14 20:40:30 -04:00
Petr Machata
ab78cbc71c [SV 39851] Reinstate stack size limit for processes spawned via $(shell) 2013-09-14 20:38:06 -04:00
Paul Smith
c5bfa40044 Support the -Orecurse option properly.
In this mode we still collect all the output from a given target and
dump it at once.  However we don't treat recursive lines any differently
from non-recursive lines.  Also we don't print enter/leave messages
after every dump.  However we do ensure that we always print them once
to stdout, so the parent make will collect it properly.
2013-09-14 01:04:04 -04:00
Paul Smith
deff9dacc9 Enhance the output sync mode.
Create a new file, output.c, and collect functions that generate output there.
We introduce a new global context specifying where output should go (to stdout
or to a sync file), and the lowest level output generator chooses where to
write output based on that context.

This allows us to set the context globally, and all operations that write
output (including functions like $(info ...) etc.) will use it.

Removed the "--trace=dir" capability.  It was too confusing.  If you have
directory tracking enabled then output sync will print the enter/leave message
for each synchronized block.  If you don't want that, disable directory
tracking.
2013-09-12 04:07:52 -04:00
Paul Smith
40a49f244d [Bug #39310] Parse simple pattern prereqs for globbing.
We tried to get some efficiency by avoiding a parse_file_seq() for simple
pattern prerequisites, but this also means no wildcard expansion was
happening, so add it back.  Add regression tests for wildcards in target and
prerequisite lists.
2013-07-22 02:23:02 -04:00
Paul Smith
87ac68fe79 [Bug #39158] Source cleanups suggested by cppcheck utility. 2013-07-21 17:52:13 -04:00
Paul Smith
72462ef1e1 Safety cleanups: ensure OUTFD is -1 when closed. 2013-07-21 16:56:00 -04:00
Paul Smith
f80222c15b Notify the compiler that exec_command() won't return. 2013-07-14 19:18:46 -04:00
Paul Smith
4b81f5ca92 Modify the update_status field in struct file to be an enum.
Makes the code a little clearer/cleaner, and solves a problem on systems
where a char is unsigned by default.
2013-07-14 19:18:21 -04:00
Paul Smith
5601726151 Keep a local count of the max dependency list size.
This global variable could be modified during recursion so keep our
own local copy to compare against.
2013-07-09 19:14:40 -04:00
Paul Smith
9453a7451d Set O_APPEND mode for stdout/stderr and output-sync temporary files.
POSIX does not guarantee that writes will be atomic if a file is
opened for normal (non-append) output.  That means if multiple processes
are writing to the same file, output could be lost.  I can't think of
a real use-case where we would NOT want append for stdout/stderr, so
force it if we can.
2013-06-28 21:57:59 -04:00
Eli Zaretskii
5e7bf7c554 Minor fix in build_w32.bat.
build_w32.bat (LinkGCC): Prevent a comment from being displayed
 at build time.
2013-06-22 17:32:46 +03:00
Eli Zaretskii
138d020e1b Compare internal commands of non-Unix shells on Windows case-insensitively.
job.c (construct_command_argv_internal) [WINDOWS32]: Use
 case-insensitive comparison with internal commands of non-Unix
 shells.
2013-06-22 16:22:25 +03:00
Eli Zaretskii
5b65c5b916 Fix a fatal error at startup on Windows due to non-ASCII characters in PATH.
main.c (find_and_set_default_shell): Don't use file_exists_p or
 dir_file_exists_p, as those call readdir, which can fail if PATH
 includes directories with non-ASCII characters, and that would
 cause Make to fail at startup with confusing diagnostics.  See
 https://sourceforge.net/mailarchive/message.php?msg_id=30846737
 for the details.
2013-06-22 16:16:56 +03:00
Paul Smith
cc85b927cd Create a character map to use for locating stop-points in strings.
In various places we were passing flags and characters to compare, then
using complex conditionals to see where to stop in string searches.
Performance numbers reveal that we were spending as much as 23% of our
processing time in these functions, most of it in the comparison lines.
Instead create a character map and use a single bitwise comparison to
determine if this is any one of the stop characters.
2013-06-22 00:22:08 -04:00
Paul Smith
bee4d93a59 Disable database verification unless debug enabled.
The database verification can take a long time.  Only enable it if debug mode
is enabled.  If MAKE_MAINTAINER_MODE is set, it's also enabled by default.
2013-06-21 23:59:38 -04:00
Paul Smith
353fcfdb30 Add job.h to POTFILES as it now has a translation. 2013-06-21 21:57:35 -04:00
Paul Smith
d4043519f7 Cleanups. 2013-05-27 13:52:15 -04:00
Paul Smith
ef11217de7 Create a new variable MAKE_HOST providing the host architecture. 2013-05-27 13:52:08 -04:00
Paul Smith
e8f5d322cf Porting to VMS, from Hartmut Becker. 2013-05-27 13:01:48 -04:00
Paul Smith
dc922e3f4c [SV #38442] Add library names to the string cache. 2013-05-26 16:53:17 -04:00
Paul Smith
c11024b3b3 [SV #38945] Copy the entire buffer back when overwriting CR 2013-05-26 14:41:45 -04:00
Paul Smith
2fc0f614be [SV #39028] Fix some small typos in messages. 2013-05-26 14:06:25 -04:00
Paul Smith
bf60bbd67a [SV #39035] Compare OUT to the beginning of the OUT var/func, not IN. 2013-05-26 13:56:51 -04:00
Paul Smith
d2eaed1f0a Add dates to the NEWS file to make things simpler. 2013-05-26 13:53:21 -04:00
Paul Smith
8ab3564a71 Fix regression tests after MAKEFLAGS enhancements. 2013-05-22 07:51:46 -04:00
Paul Smith
ecf307bb0b Force version printing whenever we print the database. 2013-05-22 02:51:45 -04:00
Paul Smith
a674abe702 Make MFLAGS and MAKEFLAGS more reliable and predictable.
Ensure all simple flags are kept in the initial batch of flags.
Do not allow any flags with options in that batch.
If there are only non-simple flags ensure MAKEFLAGS begins with " ".
Don't let MFLAGS start with "- ".
2013-05-22 02:14:19 -04:00
Alexey Pavlov
80183457ad Fix the MS-Windows build using the Posix configury.
w32/Makefile.am (libw32_a_SOURCES): Add compat/posixfcn.c.

 configure.ac (OUTPUT_SYNC): Define for mingw32 target.
2013-05-18 17:58:10 +03:00
Eli Zaretskii
cece7ad61f Support "move" as internal shell command on Windows with cmd.exe.
job.c (construct_command_argv_internal) <sh_cmds_dos> [WINDOWS32]: Add
 "move".  Fixes Savannah bug #30714.
2013-05-18 14:07:36 +03:00
Eli Zaretskii
943c06de47 Fix MS-Windows build with Guile.
guile.c: Move inclusion of makeint.h before gnumake.h.  This
 order must be observed when building Make, because gnumake.h must
 be included with GMK_BUILDING_MAKE defined, which makeint.h
 already does.  Otherwise, the linker will look for, and fail to
 find, gmk_* functions in some external dynamic library.
2013-05-18 14:03:26 +03:00
Eli Zaretskii
171eb41908 Fix MS-Windows compilation when OUTPUT_SYNC is not defined.
main.c (prepare_mutex_handle_string): Define conditioned on OUTPUT_SYNC.
2013-05-17 16:24:13 +03:00
Eli Zaretskii
9babfe49a5 Fix a bug in build_w32.bat when building a released tarball.
build_w32.bat: Copy config.h.W32 to config.h regardless of
 whether or not we are building from SCM.
2013-05-17 13:34:24 +03:00
Paul Smith
b16852a77f Update for GNU make release candidate 3.99.90. 2013-05-17 02:40:37 -04:00
Paul Smith
96cf67bd29 Update source file format: remove TABs, use GNU coding styles. 2013-05-17 02:29:46 -04:00
Paul Smith
5370238316 Update copyright for changes in 2013. 2013-05-17 01:47:42 -04:00
Paul Smith
398058a873 Use xcalloc() in hash.c to handle out of memory errors. 2013-05-17 01:24:19 -04:00
Paul Smith
b730fbc6b8 Remove the dlopen() pointer from struct filedef.
This pointer is almost never needed, and it increases the size of the filedef
struct for all files (of which there are a huge number for large builds).
Instead keep a bit field marking whether the file is a loaded object and if so
call a new function to unload it.  In load.c we keep a simple linked list of
loaded objects (of which there will be very few typically) and their dlopen()
pointers.
2013-05-17 01:20:39 -04:00
Paul Smith
c21c1455fd Add requirement for plugin_is_GPL_compatible symbol in loaded objects. 2013-05-14 22:53:42 -04:00
Paul Smith
58dae24352 [Savannah #20501] Handle adding -r/-R to MAKEFLAGS in the makefile.
If -R is set in the makefile and not the command line, then go through all the
default variables and undefine them.  If -r is set in the makefile and not in
the command line, then remove all .SUFFIX prefixes (unless the user set it)
and SUFFIX variable setting.  In -p mode don't print builtins.
2013-05-13 04:30:20 -04:00
Paul Smith
c7732bd5ad Add a new variable: GNUMAKEFLAGS
This allows you to write portable makefiles that set GNU make-specific command
line options in the environment or makefile: add them to GNUMAKEFLAGS instead
of MAKEFLAGS and they will be seen by GNU make but ignored by other
implementations of make.
2013-05-13 02:48:18 -04:00
Paul Smith
2627d83221 Use level o_env_override for MAKEFLAGS so it's reset even with -e.
Fixes Savannah bug #2216.
2013-05-13 02:30:14 -04:00
Paul Smith
381baeef7a Add new --trace[=MODE] flags, with --trace=dir
This mode replaces the previous heuristic setting enabled with -O, where we
would log directory enter/leave for each synchronized output.  Now we only
do that if --trace=dir is given.
2013-05-13 01:30:24 -04:00
Eli Zaretskii
5367d393dd Avoid printing stdout and stderr messages without a newline between them.
job.c (child_out): Output the newline following the message
 before fllush-ing the stream.  Avoids displaying the following
 failure message, which goes to stderr, on the same line.
2013-05-11 17:42:56 +03:00
Eli Zaretskii
f0529daced Rearrange dllimport/dllexport declarations for MS-Windows.
gnumake.h (GMK_EXPORT) [_WIN32]: Move the dllexport declaration
 here from makeint.h.
 makeint.h (GMK_BUILDING_MAKE) [WINDOWS32]: Define before
 including gnumake.h.
2013-05-06 20:18:58 +03:00
Eli Zaretskii
a668c520b2 doc/make.texi (Loaded Object Example): Add a note about building
shared objects on MS-Windows.
2013-05-06 20:16:40 +03:00
Stefano Lattarini
c8bf04e141 build: enable 'subdir-objects' and 'silent-rules' automake options
On 04/30/2013 05:11 PM, Stefano Lattarini wrote:
> * configure.ac (AM_INIT_AUTOMAKE): Here.  The future major Automake
> version 2.0 (ETA about one, one and half year from now) will likely
> enable them by default, so better prepare ourselves.
>
Please drop this patch.  Enabling 'subdir-objects' would require
sublter changes to several other parts of the build system that I
don't know how to test properly.  We should only enable the
'silent-rules' option for the moment.  The updated patch below
does this.

Sorry for the noise,
  Stefano

---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ----

>From 46623411f017a447caa8fe75b3b42ec2fbeac458 Mon Sep 17 00:00:00 2001
Message-Id: <46623411f017a447caa8fe75b3b42ec2fbeac458.1367335124.git.stefano.lattarini@gmail.com>
From: Stefano Lattarini <stefano.lattarini@gmail.com>
Date: Tue, 30 Apr 2013 16:30:04 +0200
Subject: [PATCH] build: enable the 'silent-rules' automake options

* configure.ac (AM_INIT_AUTOMAKE): Here.  The future major Automake
version 2.0 (ETA about one, one and half year from now) will enable
it by default, so better prepare ourselves.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2013-05-06 00:30:19 -04:00
Stefano Lattarini
0a56034aac build: require Autoconf >= 2.62 and Automake >= 1.11.1
Older versions of those tools should be considered fully obsolete.
Also, GNU make already requires Gettext >= 0.18.1, which has been
released six months after Automake 1.11.1 and two years after
Autoconf 2.62; so the new requirement shouldn't be problematic
for people already bootstrapping GNU make from the Git repository.

* configure.ac (AC_PREREQ): Require Autoconf 2.62 or later.
(AM_INIT_AUTOMAKE): Require Automake 1.11.1 or later (1.11 had
some serious bugs, and should not be used).

Copyright-paperwork-exempt: yes
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2013-05-06 00:26:29 -04:00
Paul Smith
94735f0ad7 Remove use of vfork().
GCC was giving us warnings, most OS's now just run fork() when you call
vfork(), and looking at the standard definition of vfork() we are a long way
from using it safely anyway: you're not allowed to even call a function before
you exec().
2013-05-06 00:22:27 -04:00
Stefano Lattarini
7c77486d1f docs: port manual to Texinfo 5.x
* doc/make.texi: Here.  It was sufficient to change an '@itemx'
into an '@item'.

Copyright-paperwork-exempt: yes
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2013-05-05 20:51:05 -04:00
Stefano Lattarini
13f13b96b3 cosmetics: fix few innocuous typos
Most of these were found using Lucas De Marchi's 'codespell' tool.

* ChangeLog: Fix minor typos.
* ChangeLog.2: Likewise.
* README.Amiga: Likewise.
* TODO.private: Likewise.
* function.c: Likewise.
* glob/glob.h: Likewise.
* job.c: Likewise.
* main.c: Likewise.
* readme.vms: Likewise.
* remake.c: Likewise.
* tests/ChangeLog: Likewise.
* tests/NEWS: Likewise.
* tests/README: Likewise.
* tests/scripts/variables/private: Likewise.
* vmsdir.h: Likewise.
* signame.c: Likewise.  While at it, improve line wrapping in the
touched comment.

Copyright-paperwork-exempt: yes
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2013-05-05 20:50:37 -04:00
Stefano Lattarini
c3cd78066c build: get rid of 'HAVE_ANSI_COMPILER' C preprocessor conditional
GNU make already assume C89 or later throughout the codebase, and
that preprocessor conditional was no longer used anyway.

* configure.ac: Remove AC_DEFINE of HAVE_ANSI_COMPILER.
* config.ami.template: Remove #define of HAVE_ANSI_COMPILER.
* config.h-vms.template: Likewise.
* config.h.W32.template: Likewise.
* configh.dos.template: Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2013-05-05 20:45:44 -04:00
Paul Smith
15f7957939 Rename the -O "job" mode to "line" and "make" to "recurse". 2013-05-05 20:19:00 -04:00
Paul Smith
1d992d8fe7 Ensure command lines are written synchronously with -O.
If output-sync is enabled, have make write the command line to the temp file
instead of printing it directly to the screen to ensure that the output is
ordered properly.  Also, remove extraneous enter/leave operations by having
them printed directly when dumping temp file output.
2013-05-05 17:03:51 -04:00
Paul Smith
3484c9675a Add memory allocation cleanup to loadable objects.
Add gmk_alloc() and gmk_free() functions so loadable objects can access our
memory model.  Also provide a more extensive example in the manual.
2013-05-04 17:38:53 -04:00
Paul Smith
a0c5d0c63f Don't pump output to the descriptor, as we use FILE* elsewhere. 2013-05-04 17:31:20 -04:00
Eli Zaretskii
64dd61bcb8 Minor portabiulity fixes for MS-Windows.
makeint.h (ftruncate) [_MSC_VER]: Redirect to _chsize.
 (_S_ISDIR): If not defined (MinGW64), define to S_ISDIR.
2013-05-04 21:03:55 +03:00
Paul Smith
75336026ae Merge branch 'master' of git.savannah.gnu.org:/srv/git/make 2013-05-04 13:14:39 -04:00
Paul Smith
b8467292c9 Improve sync handling for -Ojob/-Otarget and recursion.
If we are not going to sync a command line then dump any collected output
first to preserve ordering.  Do some code cleanup:
  * Move the handle init to a separate function.
  * Move the temp file truncation to the output function.
  * Remember whether we sync in a variable for readability.
  * Handle EINTR and short writes in child_out().
  * Always call sync_output() in case output_sync was changed due to error.
2013-05-04 13:10:56 -04:00
Eli Zaretskii
e44c51ce41 Fix a typo in the manual. 2013-05-04 17:19:56 +03:00
Eli Zaretskii
cb2be0db36 Fix a possibly confusing comment at end of pump_from_tmp_fd. 2013-05-04 10:56:32 +03:00
Eli Zaretskii
01bad6f73a Fix the MS-Windows branch of output_sync code.
job.c (start_job_command): Make the condition for creating a
 temporary output file be identical to the Posix code branch.
 Suggested by Frank Heckenbach <f.heckenbach@fh-soft.de>.
2013-05-04 10:41:11 +03:00
Eli Zaretskii
82793f85f5 Fix invocation of Windows batch files with whitespace in their names.
w32/subproc/sub_proc.c: Include makeint.h.  Remove a private
 incompatible prototype of xmalloc.
 (batch_file_with_spaces): New function, detects Windows batch
 files whose names include whitespace characters.
 (process_begin): If exec_name is a batch file with whitespace
 characters in its name, pass NULL as the first argument to
 CreateProcess.  This avoids weird failures due to buggy quoting by
 CreateProcess.  For the details, see the discussion starting at
 http://lists.gnu.org/archive/html/make-w32/2013-04/msg00008.html.
2013-05-03 16:24:24 +03:00
Eli Zaretskii
a66469e003 Fix interfacing with and remaking dynamic objects on MS-Windows.
load.c (load_object, load_file): Accept an additional argument
 DLP and return in it a pointer that can be used to unload the
 dynamic object.
 read.c (eval): Call load_file with an additional argument, and
 record the pointer returned there in the 'struct file' object of
 dynamic objects in that object's 'struct file'.
 commands.c (execute_file_commands): Unload dynamic objects
 before remaking them, to avoid failure to remake if the OS doesn't
 allow overwriting objects that are in use.
 filedef.h (struct file): New member dlopen_ptr.
 gnumake.h (GMK_EXPORT): Define to dllexport/dllimport
 decorations for Windows and to nothing on other platforms.
 (gmk_eval, gmk_expand, gmk_add_function): Add GMK_EXPORT qualifier
 to prototypes.
 makeint.h (MAIN): Define before including gnumake.h, to give
 correct dllexport decorations to exported functions.
 (load_file): Adjust prototype.
 loadapi.c: Don't include gnumake.h, since makeint.h already
 includes it, and takes care of defining MAIN before doing so.
 build_w32.bat (LinkGCC): Produce an import library for functions
 exported by Make for loadable dynamic objects.

 w32/compat/posixfcn.c (dlclose): New function.
 w32/include/dlfcn.h (dlclose): Add prototype.

 scripts/features/load: Fix signatures of testload_gmk_setup and
 explicit_setup, to bring them in line with the documentation.
2013-05-03 16:09:12 +03:00
Eli Zaretskii
b5ea49bae7 Mention in NEWS change on Windows with quotes in command lines. 2013-05-01 18:41:14 +03:00
Eli Zaretskii
2926f7b466 Fix treatment of whitespace after a backslash on MS-Windows.
job.c (construct_command_argv_internal): Don't treat a backslash as an
 escape character before whitespace, if the shell is not a Posix
 shell.   For the description of the problem, see
 http://lists.gnu.org/archive/html/make-w32/2013-04/msg00014.html.
2013-05-01 18:31:53 +03:00
Eli Zaretskii
a87ff20158 job.c (start_job_command) [WINDOWS32]: Make the same fix for
MS-Windows as the previous commit did for Posix platforms.
2013-05-01 18:15:16 +03:00
Paul Smith
9acb657eb1 Don't synchronize output for recursive make unless -Omake 2013-05-01 07:59:24 -04:00
Eli Zaretskii
19a69bafc0 Support dynamic object loading on MS-Windows.
w32/include/dlfcn.h: New file.
 w32/compat/posixfcn.c: Include dlfcn.h.
 (dlopen, dlerror, dlsym) [MAKE_LOAD]: New functions, in support of
 dynamic loading.

 config.h.W32.template (MAKE_LOAD): Define.
 load.c (load_object) [HAVE_DOS_PATHS]: Support backslashes and
 drive letters in file names of dynamic objects.
2013-04-29 19:26:06 +03:00
Eli Zaretskii
9a7fe22b19 Fix the .ONESHELL operation on MS-Windows.
job.c (construct_command_argv_internal) [WINDOWS32]: Return
 right after generating new_argv for one_shell case.  This fixes
 the Windows build for both Unixy shell and stock Windows shells.
2013-04-29 19:17:07 +03:00
Paul Smith
9253a34a57 Merge branch 'master' of git.savannah.gnu.org:/srv/git/make 2013-04-28 19:25:24 -04:00
Paul Smith
f88eb23b02 Ensure error messages are printed with sync'd output.
Enhance the child_error() function so that it will write error output to the
child's sync output buffer, if it exists.  If it doesn't the output goes to
stdout/stderr.
2013-04-28 19:09:20 -04:00
Paul Smith
441b643355 Remove support for pre-ANSI variadic function calls.
We've required support for ANSI C (ISO C 89) or better for quite a while.  Get
rid of the old varags.h, doprnt() stuff and simply assume ANSI C variadic
function capability and basic C runtime library support (vfprintf, vsprintf,
etc.)
2013-04-28 17:59:28 -04:00
Paul Smith
8b034b7d18 Small cleanups and fixes. 2013-04-28 17:31:46 -04:00
Eli Zaretskii
5667376edc Fix Savannah bug #37065 with $(wildcard foo/*/.) returning non-directories.
dir.c (local_stat) [WINDOWS32]: Use the wrapper on MS-Windows.
 If the argument ends in "dir/.", make sure the parent dir exists
 and is indeed a directory.  Fixes Savannah bug #37065.
2013-04-28 20:53:36 +03:00
Paul Smith
93843ccd08 Fix a few compiler warnings found by Eli. 2013-04-28 01:41:47 -04:00
Paul Smith
7f01830927 Add support for per-job output sync.
A new flag to the -O/--output-sync, "job", selects a per-job (that is, per
line of a recipe) output synchronization.  To support this move the close of
the temp file out of the sync_output() function and don't do it until we free
the child, since we may call sync_output() multiple times in a given recipe.
When we set up for a new temp file, if we're in per-job mode we truncate the
file and seek to the beginning to re-use it for every job.
2013-04-28 01:19:19 -04:00
Paul Smith
30843dea3a Fix support for .ONESHELL when dealing with non-POSIX shells. 2013-04-27 17:28:05 -04:00
Paul Smith
14d7654551 Rework the implementation of load.c to increase portability.
It should be sufficient, now, to write a new version of the load_object()
function.  That function won't be called unless we really want to load, so all
checking and parsing is taken care of before that.
2013-04-27 16:57:05 -04:00
Paul Smith
054d6d91e7 Merge branch 'master' of git.savannah.gnu.org:/srv/git/make 2013-04-27 16:24:08 -04:00
Eli Zaretskii
e56aad4061 Support .ONESHELL on MS-Windows, for default Windows shells.
read.c (record_files): Pay attention to .ONESHELL in MS-Windows.
 job.c (construct_command_argv_internal): Support .ONESHELL on
 MS-Windows, when the shell is not a Unixy shell.
2013-04-27 19:12:01 +03:00
Eli Zaretskii
049f8e88fc job.c: Fix compilation error on GNU/Linux due to "label at end of compound statement". 2013-04-27 14:30:01 +03:00
Eli Zaretskii
da7df54309 Support --output-sync on MS-Windows.
w32/compat/posixfcn.c: New file, with emulations of Posix
 functions and Posix functionality for MS-Windows.
 w32/subproc/sub_proc.c: Include io.h.
 (process_noinherit): New function, forces a file descriptor to not
 be inherited by child processes.
 (process_easy): Accept two additional arguments, and use them to
 set up the standard output and standard error handles of the child
 process.
 w32/include/sub_proc.h (process_easy): Adjust prototype.
 (process_noinherit): Add prototype.

 read.c [WINDOWS32]: Include windows.h and sub_proc.h.
 makeint.h (LOCALEDIR) [WINDOWS32}: Define to NULL if not
 defined.  This is needed because the MS-Windows build doesn't have
 a canonical place for LOCALEDIR.
 (WIN32_LEAN_AND_MEAN) [WINDOWS32]: Define, to avoid getting from
 windows.h header too much stuff that could conflict with the code.
 main.c <sync_mutex>: New static variable.
 <switches>: Add support for "--sync-mutex" switch.
 (decode_output_sync_flags): Decode the --sync-mutex= switch.
 (prepare_mutex_handle_string) [WINDOWS32]: New function.
 (main): Add "output-sync" to .FEATURES.
 job.h (CLOSE_ON_EXEC) [WINDOWS32]: Define to call
 process_noinherit.
 (F_GETFD, F_SETLKW, F_WRLCK, F_UNLCK, struct flock) [WINDOWS32]:
 New macros.
 (RECORD_SYNC_MUTEX): New macro, a no-op for Posix platforms.
 (sync_handle_t): New typedef.
 job.c <sync_handle>: Change type to sync_handle_t.
 (FD_NOT_EMPTY): Seek to the file's end.  Suggested by Frank
 Heckenbach <f.heckenbach@fh-soft.de>.
 (pump_from_tmp_fd) [WINDOWS32]: Switch to_fd to binary mode for
 the duration of this function, and then change back before
 returning.
 (start_job_command) [WINDOWS32]: Support output_sync mode on
 MS-Windows.  Use a system-wide mutex instead of locking
 stdout/stderr.  Call process_easy with two additional arguments:
 child->outfd and child->errfd.
 (exec_command) [WINDOWS32]: Pass two additional arguments, both
 -1, to process_easy, to adjust for the changed function signature.
 function.c (windows32_openpipe) [WINDOWS32]: This function now
 returns an int, which is -1 if it fails and zero otherwise.  It
 also calls 'error' instead of 'fatal', to avoid exiting
 prematurely.
 (func_shell_base) [WINDOWS32]: Call perror_with_name if
 windows32_openpipe fails, now that it always returns.  This avoids
 a compiler warning that error_prefix is not used in the MS-Windows
 build.
 config.h.W32.template (OUTPUT_SYNC): Define.
 build_w32.bat: Add w32/compat/posixfcn.c to compilation and
 linking commands.

 From Frank Heckenbach <f.heckenbach@fh-soft.de>:
 job.c (sync_output): Don't discard the output if
 acquire_semaphore fails; instead, dump the output unsynchronized.
2013-04-27 14:20:49 +03:00
Eli Zaretskii
f3a4b4ce6f Improve MS-Windows build scripts.
build_w32.bat: Improve.  Remove 'setlocal', as it isn't
 supported on Windows 9X.  Add --help and usage instructions.
 Support both debug and optimized builds with GCC under --debug.
 If building out of Git repo, always produce config.h, and edit
 gmk-default.scm into gmk-default.h.
 w32/subproc/build.bat: Support debug and optimized builds with
 GCC.
2013-04-25 20:41:53 +03:00
Stefano Lattarini
0daa9d37c4 Reflect the 'configure.in' -> 'configure.ac' rename throughout
In README, code comments, and auxiliary files.

Copyright-paperwork-exempt: yes
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2013-04-21 19:21:43 -04:00
Paul Smith
50e2cb1b1a Some cleanups for Windows builds after the output-sync option.
Note currently output-sync is not supported on Windows.
2013-04-16 19:51:29 -04:00
Paul Smith
330d97a9ba Cleanup some source and fix autoconf warnings. 2013-04-16 01:47:05 -04:00
Paul Smith
b5d017c624 Create an open_tmpfd() function to return temp files by FD. Use it. 2013-04-16 01:03:59 -04:00
Paul Smith
79e9347892 Save the output from the entire recipe, not per-job. 2013-04-15 19:17:19 -04:00
Paul Smith
2bd957a89d Change the arg option for -O from numeric to string. 2013-04-15 13:22:51 -04:00
Paul Smith
7f7e6f80c5 Modify output-sync tests to be more reliable. 2013-04-15 10:33:42 -04:00
Paul Smith
af87d56157 Handle test timeouts in a more understandable way. 2013-04-14 19:11:47 -04:00
Paul Smith
4bf3c33f83 Rename the "parallel-sync" option to "output-sync". 2013-04-14 16:31:18 -04:00
Frank Heckenbach
cb64352c75 Initial patch for output synchronization. See Savannah bug #33138.
Based on work by David Boyce <David.S.Boyce@gmail.com>.
2013-04-14 15:38:07 -04:00
Paul Smith
6a52395ed1 Clarify LDFLAGS vs. LDLIBS. Fixes Savannah bug #37970. 2013-04-06 10:51:57 -04:00
Paul Smith
29cd1e9699 Reconsider targets waiting for prerequisites. Fixes Savannah bug #37703. 2013-04-06 10:29:20 -04:00
Paul Smith
450b7e1a3d Use ENULLLOOP to handle EINTR during realpath(). Fixes Savannah bug #38420 2013-02-28 00:55:15 -05:00
Paul Smith
5058a94ee7 Expand the loadable object support.
Provide a simple API for loaded objects to interact with GNU make.  I still
won't guarantee that this API won't change but it's much closer to something
that's supported and provides easy-to-use interfaces with a public header
file.
2013-02-25 01:38:36 -05:00
Paul Smith
4baf9ab456 Adding new file. 2013-01-20 16:36:28 -05:00
Paul Smith
ac1c6b404a Create externally referencable header file "gnumake.h".
Move the gmk_floc type to gnumake.h.
2013-01-20 13:39:54 -05:00
Paul Smith
51fb930ef2 Rename struct floc to typedef gmk_floc as an externally scoped symbol. 2013-01-20 13:16:46 -05:00
Paul Smith
a45f25ece3 Rename the make.h file to makeint.h for internal use only. 2013-01-20 11:33:20 -05:00
Paul Smith
b70aa3709e Allow dynamically loaded objects to be rebuilt by make. 2013-01-20 00:55:57 -05:00
Paul Smith
8e0a5645b8 Add more documentation on Git workflow and rules. 2013-01-19 17:11:23 -05:00
Eli Zaretskii
7899c6f383 Fix a typo in ChangeLog. 2013-01-18 18:02:16 +02:00
Paul Smith
6ca41d9b17 [SV #37878] Add a check for targets with parens that are not archives. 2013-01-13 12:40:13 -05:00
Paul Smith
686a74bfb2 [SV #38051] Recover all MAKEFLAGS after makefile rebuild step is complete.
Patch suggested by Frank Heckenbach <f.heckenbach@fh-soft.de>.
2013-01-13 12:21:01 -05:00
Paul Smith
ca17e5538f Add ChangeLog entries for Git migration. 2013-01-13 12:17:03 -05:00
Paul Smith
5c69b3fe53 Change configure.in to configure.ac, and other Git fixes. 2013-01-12 22:38:17 -05:00
Paul Smith
1d298acf9d Ensure parallel test works properly. 2013-01-12 21:54:41 -05:00
Paul Smith
5a5a1aff6a Fix clean rules. 2013-01-12 21:53:15 -05:00
Paul Smith
002702c89c Modify instructions, etc. for Git support. 2013-01-12 19:31:13 -05:00
Paul Smith
a3bd466e25 Modify .gitignore for proper formatting. 2013-01-12 17:56:25 -05:00
Paul Smith
97fe6e7dd1 Rename CVS ignore files to .gitignore 2013-01-12 17:48:58 -05:00
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
194 changed files with 16546 additions and 8757 deletions

View File

@@ -1,35 +0,0 @@
*.gz *.Z *.tar *.tgz
=*
TODO COPYING* ABOUT-NLS
make-3* make-test*
*.info *.info-*
stamp-*
makebook*
.*gdbinit
.gdb_history
*.dep *.dvi *.toc *.aux *.log
*.cp *.cps *.fn *.fns *.vr *.vrs *.tp *.tps *.ky *.kys *.pg *.pgs
README README.DOS README.W32 README.OS2
aclocal.m4 autom4te.cache
config.h.in config.h config.status config.cache configure
Makefile.in Makefile
build.sh.in build.sh
SMakefile NMakefile Makefile.DOS
config.ami configh.dos config.h.W32 config.h-vms
loadavg loadavg.c make
.deps .dep_segment ID TAGS
_*
sun4 i386 i386-netbsd hp300-netbsd hp300 rs6000 sun3 news800 amiga
hp700 hp834 mips sol2 i486-linux
customs
install-sh mkinstalldirs
.directive.asc

46
.gitignore vendored Normal file
View File

@@ -0,0 +1,46 @@
# Development artifacts
ID
TAGS
.*gdbinit
.gdb_history
*~
#*
.#*
# Configure artifacts
ABOUT-NLS
Makefile
Makefile.in
aclocal.m4
autom4te.cache
config.h
config.h.in
config.log
config.status
configure
stamp-h1
# Build artifacts
.deps
gmk-default.h
loadavg
make
*.o
# Distribution artifacts
.dep_segment
Makefile.DOS
NMakefile
README
README.DOS
README.OS2
README.W32
SMakefile
build.sh
build.sh.in
config.ami
config.h-vms
config.h.W32
configh.dos
make-[0-9]*/
make-[0-9]*.tar.*

13
AUTHORS
View File

@@ -37,17 +37,20 @@ GNU make porting efforts:
Port to MS-DOS (DJGPP), OS/2, and MS-Windows (native/MinGW) by:
DJ Delorie <dj@delorie.com>
Rob Tulloh <rob_tulloh@tivoli.com>
Eli Zaretskii <eliz@is.elta.co.il>
Eli Zaretskii <eliz@gnu.org>
Jonathan Grant <jg@jguk.org>
Andreas Beuning <andreas.buening@nexgo.de>
Earnie Boyd <earnie@uses.sf.net>
Troy Runkel <Troy.Runkel@mathworks.com>
-----------------------------------
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 +58,21 @@ 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>
David Boyce <dsb@boyski.com>
Frank Heckenbach <f.heckenbach@fh-soft.de>
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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the

1565
ChangeLog

File diff suppressed because it is too large Load Diff

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

@@ -3080,7 +3080,7 @@ Sun May 12 19:19:43 1996 Aaron Digulla <digulla@fh-konstanz.de>
* main.c: (main), variable.c Changed handling of ENV-vars. Make
stores now the names of the variables only and reads their contents
when they are accessed to reflect that these variables are really
global (ie. they CAN change WHILE make runs !) This handling is
global (i.e., they CAN change WHILE make runs !) This handling is
made in lookup_variable()
* Makefile.ami: renamed file.h to filedep.h
@@ -6630,15 +6630,14 @@ Fri Nov 1 19:34:28 1991 Roland McGrath (roland@churchy.gnu.ai.mit.edu)
See ChangeLog.1, available in the CVS repository at:
See ChangeLog.1, available in the Git repository at:
http://savannah.gnu.org/cvs/?group=make
http://git.savannah.gnu.org/cgit/make.git/tree/
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-2013 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
@@ -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
@@ -123,7 +122,7 @@ man1dir = $(mandir)/man1
MANS = $(man_MANS)
NROFF = nroff
DIST_COMMON = README ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 alloca.c build.sh-in config.h-in configure configure.in getloadavg.c
DIST_COMMON = README ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 alloca.c build.sh-in config.h-in configure configure.ac getloadavg.c
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
@@ -507,7 +506,7 @@ html
#
dist-hook:
(cd $(srcdir); \
w32=`find w32 -follow \( -name CVS -prune \) -o -type f -print`; \
w32=`find w32 -follow \( -name .git -prune \) -o -type f -print`; \
tar chf - $$w32) \
| (cd $(distdir); tar xfBp -)

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-2013 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
@@ -32,6 +31,7 @@ endif
SUBDIRS = glob config po doc $(MAYBE_W32)
bin_PROGRAMS = make
include_HEADERS = gnumake.h
if USE_CUSTOMS
remote = remote-cstms.c
@@ -39,18 +39,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 \
loadapi.c main.c misc.c output.c read.c remake.c rule.c \
signame.c strcache.c variable.c version.c vpath.c hash.c \
$(remote)
if HAVE_GUILE
make_SOURCES += guile.c
endif
EXTRA_make_SOURCES = vmsjobs.c remote-stub.c remote-cstms.c
noinst_HEADERS = commands.h dep.h filedef.h job.h make.h rule.h variable.h \
debug.h getopt.h gettext.h hash.h
noinst_HEADERS = commands.h dep.h filedef.h job.h makeint.h rule.h variable.h \
debug.h getopt.h gettext.h hash.h output.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 +66,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)
@@ -76,8 +82,9 @@ EXTRA_DIST = README build.sh.in $(man_MANS) \
README.DOS Makefile.DOS configure.bat dosbuild.bat configh.dos\
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
README.VMS makefile.vms makefile.com config.h-vms \
vmsdir.h vmsfunctions.c vmsify.c \
gmk-default.scm gmk-default.h
# This is built during configure, but behind configure's back
@@ -100,8 +107,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 +124,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 .git -o -name .deps -o -name work -o -name .gitignore -o -name \*.orig -o -name \*.rej -o -name \*~ -o -name Makefile \) -prune -o -type f -print`; \
tar chf - $$sub) \
| (cd $(distdir); tar xfBp -)
@@ -168,18 +184,18 @@ loadavg_LDADD = @GETLOADAVG_LIBS@
MAKETESTFLAGS =
check-regression:
@if test -f "$(srcdir)/tests/run_make_tests"; then \
@if test -f '$(srcdir)/tests/run_make_tests'; then \
if $(PERL) -v >/dev/null 2>&1; then \
case `cd $(srcdir); pwd` in `pwd`) : ;; \
case `cd '$(srcdir)'; pwd` in `pwd`) : ;; \
*) test -d tests || mkdir tests; \
rm -f srctests; \
if ln -s "$(srcdir)/tests" srctests; then \
if ln -s '$(srcdir)/tests' srctests; then \
for f in run_make_tests run_make_tests.pl test_driver.pl scripts; do \
rm -f tests/$$f; ln -s ../srctests/$$f tests; \
done; fi ;; \
esac; \
echo "cd tests && $(PERL) ./run_make_tests.pl -make ../make$(EXEEXT) $(MAKETESTFLAGS)"; \
cd tests && $(PERL) ./run_make_tests.pl -make ../make$(EXEEXT) $(MAKETESTFLAGS); \
echo "cd tests && $(PERL) ./run_make_tests.pl -srcdir $(abs_srcdir) -make ../make$(EXEEXT) $(MAKETESTFLAGS)"; \
cd tests && $(PERL) ./run_make_tests.pl -srcdir '$(abs_srcdir)' -make '../make$(EXEEXT)' $(MAKETESTFLAGS); \
else \
echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
fi; \
@@ -191,7 +207,7 @@ check-regression:
# --------------- Maintainer's Section
# Tell automake that I haven't forgotten about this file and it will be
# created before we build a distribution (see maintMakefile in the CVS
# created before we build a distribution (see maintMakefile in the Git
# distribution).
README:

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-2013 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
@@ -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,21 +117,24 @@ 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)job.h $(srcdir)make.h $(srcdir)rule.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)makeint.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,42 +266,43 @@ 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.
# Automatically generated dependencies.
commands.o: commands.c make.h dep.h filedef.h variable.h job.h \
commands.o: commands.c makeint.h dep.h filedef.h variable.h job.h \
commands.h
job.o: job.c make.h job.h filedef.h commands.h variable.h
dir.o: dir.c make.h
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 \
job.o: job.c makeint.h job.h filedef.h commands.h variable.h
dir.o: dir.c makeint.h
file.o: file.c makeint.h dep.h filedef.h job.h commands.h variable.h
misc.o: misc.c makeint.h dep.h
main.o: main.c makeint.h dep.h filedef.h variable.h job.h commands.h \
getopt.h
read.o: read.c make.h dep.h filedef.h job.h commands.h variable.h \
guile.o: guile.c makeint.h dep.h debug.h variable.h gmk-default.h
read.o: read.c makeint.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
rule.o: rule.c make.h dep.h filedef.h job.h commands.h variable.h \
remake.o: remake.c makeint.h filedef.h job.h commands.h dep.h
rule.o: rule.c makeint.h dep.h filedef.h job.h commands.h variable.h \
rule.h
implicit.o: implicit.c make.h rule.h dep.h filedef.h
default.o: default.c make.h rule.h dep.h filedef.h job.h commands.h \
implicit.o: implicit.c makeint.h rule.h dep.h filedef.h
default.o: default.c makeint.h rule.h dep.h filedef.h job.h commands.h \
variable.h
variable.o: variable.c make.h dep.h filedef.h job.h commands.h \
variable.o: variable.c makeint.h dep.h filedef.h job.h commands.h \
variable.h
expand.o: expand.c make.h filedef.h job.h commands.h variable.h
function.o: function.c make.h filedef.h variable.h dep.h job.h \
expand.o: expand.c makeint.h filedef.h job.h commands.h variable.h
function.o: function.c makeint.h filedef.h variable.h dep.h job.h \
commands.h amiga.h
vpath.o: vpath.c make.h filedef.h variable.h
strcache.o: strcache.c make.h hash.h
vpath.o: vpath.c makeint.h filedef.h variable.h
strcache.o: strcache.c makeint.h hash.h
version.o: version.c
ar.o: ar.c make.h filedef.h dep.h
arscan.o: arscan.c make.h
ar.o: ar.c makeint.h filedef.h dep.h
arscan.o: arscan.c makeint.h
signame.o: signame.c signame.h
remote-stub.o: remote-stub.c make.h filedef.h job.h commands.h
remote-stub.o: remote-stub.c makeint.h filedef.h job.h commands.h
getopt.o: getopt.c
getopt1.o : getopt1.c getopt.h
getloadavg.o: getloadavg.c
amiga.o: amiga.c make.h variable.h amiga.h
amiga.o: amiga.c makeint.h variable.h amiga.h

178
NEWS
View File

@@ -1,6 +1,6 @@
GNU make NEWS -*-indented-text-*-
History of user-visible changes.
28 July 2010
1 Oct 2013
See the end of this file for copyrights and conditions.
@@ -9,7 +9,111 @@ 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.82
Version 3.99.93
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 feature: GNU Guile integration
This version of GNU make can be compiled with GNU Guile integration.
GNU Guile serves as an embedded extension language for make.
See the "Guile Function" section in the GNU Make manual for details.
Currently GNU Guile 1.8 and 2.0+ are supported. In Guile 1.8 there is no
support for internationalized character sets. In Guile 2.0+, scripts can be
encoded in UTF-8.
* New command line option: --output-sync (-O) enables grouping of output by
target or by recursive make. This is useful during parallel builds to avoid
mixing output from different jobs together giving hard-to-understand
results. Original implementation by David Boyce <dsb@boyski.com>.
Reworked and enhanced by Frank Heckenbach <f.heckenbach@fh-soft.de>.
Windows support by Eli Zaretskii <eliz@gnu.org>.
* 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 command line option argument: --debug now accepts a "n" (none) flag
which disables all debugging settings that are currently enabled.
* New feature: The "job server" capability is now supported on Windows.
Implementation contributed by Troy Runkel <Troy.Runkel@mathworks.com>
* New feature: The .ONESHELL capability is now supported on Windows. Support
added by Eli Zaretskii <eliz@gnu.org>.
* New feature: "!=" shell assignment operator as an alternative to the
$(shell ...) function. Implemented for compatibility with BSD makefiles.
Note there are subtle differences between "!=" and $(shell ...). See the
description in the GNU make manual.
WARNING: Backward-incompatibility!
Variables ending in "!" previously defined as "variable!= value" will now be
interpreted as shell assignment. Change your assignment to add whitespace
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: 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.
* New variable: $(GNUMAKEFLAGS) will be parsed for make flags, just like
MAKEFLAGS is. It can be set in the environment or the makefile, containing
GNU make-specific flags to allow your makefile to be portable to other
versions of make. Once this variable is parsed, GNU make will set it to the
empty string so that flags will not be duplicated on recursion.
* New variable: `MAKE_HOST' gives the name of the host architecture
make was compiled for. This is the same value you see after 'Built for'
when running 'make --version'.
* Behavior of MAKEFLAGS and MFLAGS is more rigorously defined. All simple
flags are grouped together in the first word of MAKEFLAGS. No options that
accept arguments appear in the first word. If no simple flags are present
MAKEFLAGS begins with a space. Flags with both short and long versions
always use the short versions in MAKEFLAGS. Flags are listed in
alphabetical order using ASCII ordering. MFLAGS never begins with "- ".
* Setting the -r and -R options in MAKEFLAGS inside a makefile now works as
expected, removing all built-in rules and variables, respectively.
* If a recipe fails, the makefile name and linenumber of the recipe 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.
* On MS-Windows, recipes that use ".." quoting will no longer force
invocation of commands via temporary batch files and stock Windows
shells, they will be short-circuited and invoked directly. (In
other words, " is no longer a special character for stock Windows
shells.) This avoids hitting shell limits for command length when
quotes are used, but nothing else in the command requires the shell.
This change could potentially mean some minor incompatibilities in
behavior when the recipe uses quoted string on shell command lines.
Version 3.82 (28 Jul 2010)
A complete list of bugs fixed in this version is available here:
@@ -18,14 +122,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 +137,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
@@ -115,7 +226,7 @@ http://sv.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=104&set
multi-line variable assignment.
Version 3.81
Version 3.81 (01 Apr 2006)
* GNU make is ported to OS/2.
@@ -238,7 +349,7 @@ Version 3.81
could be found on the system.
* On VMS there is now support for case-sensitive filesystems such as ODS5.
See the readme.vms file for information.
See the README.VMS file for information.
* Parallel builds (-jN) no longer require a working Bourne shell on
Windows platforms. They work even with the stock Windows shells, such
@@ -256,7 +367,7 @@ A complete list of bugs fixed in this version is available here:
http://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=103
Version 3.80
Version 3.80 (03 Oct 2002)
* A new feature exists: order-only prerequisites. These prerequisites
affect the order in which targets are built, but they do not impact
@@ -338,7 +449,7 @@ A complete list of bugs fixed in this version is available here:
http://savannah.gnu.org/bugs/index.php?group=make&report_id=111&fix_release_id=102
Version 3.79.1
Version 3.79.1 (23 Jun 2000)
* .SECONDARY with no prerequisites now prevents any target from being
removed because make thinks it's an intermediate file, not just those
@@ -347,7 +458,7 @@ Version 3.79.1
* New configure option --disable-nsec-timestamps, but this was
superseded in later versions by the .LOW_RESOLUTION_TIME pseudo-target.
Version 3.79
Version 3.79 (04 Apr 2000)
* GNU make optionally supports internationalization and locales via the
GNU gettext (or local gettext if suitable) package. See the ABOUT-NLS
@@ -388,9 +499,9 @@ Version 3.79
returned.
* Hartmut Becker provided many updates for the VMS port of GNU make.
See the readme.vms file for more details.
See the README.VMS file for more details.
Version 3.78
Version 3.78 (22 Sep 1999)
* Two new functions, $(error ...) and $(warning ...) are available. The
former will cause make to fail and exit immediately upon expansion of
@@ -446,7 +557,7 @@ Version 3.78
by running "make check" in the distribution. Note that it requires
Perl (either Perl 4 or Perl 5) to run.
Version 3.77
Version 3.77 (28 Jul 1998)
* Implement BSD make's "?=" variable assignment operator. The variable
is assigned the specified value only if that variable is not already
@@ -492,11 +603,11 @@ Version 3.77
* Updates to the Windows 95/NT port from Rob Tulloh (see README.W32),
and to the DOS port from Eli Zaretski (see README.DOS).
Version 3.76.1
Version 3.76.1 (19 Sep 1997)
* Small (but serious) bug fix. Quick rollout to get into the GNU source CD.
Version 3.76
Version 3.76 (16 Sep 1997)
* GNU make now uses automake to control Makefile.in generation. This
should make it more consistent with the GNU standards.
@@ -541,7 +652,7 @@ Version 3.76
* John W. Eaton has updated the VMS port to support libraries and VPATH.
Version 3.75
Version 3.75 (27 Aug 1996)
* The directory messages printed by `-w' and implicitly in sub-makes,
are now omitted if Make runs no commands and has no other messages to print.
@@ -562,7 +673,7 @@ Version 3.75
See README.W32 for details, and direct all Windows-related questions to
<rob_tulloh@tivoli.com>.
Version 3.73
Version 3.73 (05 Apr 1995)
* Converted to use Autoconf version 2, so `configure' has some new options.
See INSTALL for details.
@@ -570,7 +681,7 @@ Version 3.73
* You can now send a SIGUSR1 signal to Make to toggle printing of debugging
output enabled by -d, at any time during the run.
Version 3.72
Version 3.72 (04 Nov 1994)
* DJ Delorie has ported Make to MS-DOS using the GO32 extender.
He is maintaining the DOS port, not the GNU Make maintainer;
@@ -604,7 +715,7 @@ Version 3.72
of `.SILENT', then the recipe to update that file will not be printed
before it is run. (This change was made to conform to POSIX.2.)
Version 3.71
Version 3.71 (21 May 1994)
* The automatic variables `$(@D)', `$(%D)', `$(*D)', `$(<D)', `$(?D)', and
`$(^D)' now omit the trailing slash from the directory name. (This change
@@ -626,7 +737,7 @@ Version 3.71
The exit status is 1 only when using -q and some target is not up to date.
(This change was made to comply with POSIX.2.)
Version 3.70
Version 3.70 (03 Jan 1994)
* It is no longer a fatal error to have a NUL character in a makefile.
You should never put a NUL in a makefile because it can have strange
@@ -637,7 +748,7 @@ Version 3.70
makefile name and line number where the `include' appeared, so Emacs's
C-x ` command takes you there (in case it's a typo you need to fix).
Version 3.69
Version 3.69 (07 Nov 1993)
* Implicit rule search for archive member references is now done in the
opposite order from previous versions: the whole target name `LIB(MEM)'
@@ -667,7 +778,7 @@ Version 3.69
* The recipe given for `.DEFAULT' is now used for phony targets with no
recipe.
Version 3.68
Version 3.68 (28 Jul 1993)
* You can list several archive member names inside parenthesis:
`lib(mem1 mem2 mem3)' is equivalent to `lib(mem1) lib(mem2) lib(mem3)'.
@@ -693,16 +804,16 @@ Version 3.68
to set up variables for them. They used to run with the environment
that `make' started with.
Version 3.66
Version 3.66 (21 May 1993)
* `make --version' (or `make -v') now exits immediately after printing
the version number.
Version 3.65
Version 3.65 (09 May 1993)
* Make now supports long-named members in `ar' archive files.
Version 3.64
Version 3.64 (21 Apr 1993)
* Make now supports the `+=' syntax for a variable definition which appends
to the variable's previous value. See the section `Appending More Text
@@ -716,7 +827,7 @@ Version 3.64
* The built-in implicit rules now support the alternative extension
`.txinfo' for Texinfo files, just like `.texinfo' and `.texi'.
Version 3.63
Version 3.63 (22 Jan 1993)
* Make now uses a standard GNU `configure' script. See the new file
INSTALL for the new (and much simpler) installation procedure.
@@ -1096,9 +1207,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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software

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-2013 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
@@ -73,6 +72,8 @@ $(OUTDIR):
LIBS = kernel32.lib user32.lib advapi32.lib
#guile = $(OUTDIR)/guile.obj
OBJS = \
$(OUTDIR)/ar.obj \
$(OUTDIR)/arscan.obj \
@@ -90,6 +91,7 @@ OBJS = \
$(OUTDIR)/job.obj \
$(OUTDIR)/main.obj \
$(OUTDIR)/misc.obj \
$(OUTDIR)/output.obj \
$(OUTDIR)/read.obj \
$(OUTDIR)/remake.obj \
$(OUTDIR)/remote-stub.obj \
@@ -102,7 +104,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

@@ -11,7 +11,7 @@ GNU make):
- Can run multi-line statements
- Allows to use Device-Names in targets:
c:make : make.o
c:make : make.o
is ok. To distinguish between device-names and target : or ::, MAKE
looks for spaces. If there are any around :, it's taken as a target
@@ -19,14 +19,14 @@ GNU make):
that "make:make.o" tries to create "make.o" on the device "make:".
- Replaces @@ by a newline in any command line:
if exists make @@\
delete make.bak quiet @@\
rename make make.bak @@\
endif @@\
$(CC) Link Make.o To make
if exists make @@\
delete make.bak quiet @@\
rename make make.bak @@\
endif @@\
$(CC) Link Make.o To make
works. Note that the @@ must stand alone (ie. "make@@\" is illegal).
Also be carefull that there is a space after the "\" (ie, at the
works. Note that the @@ must stand alone (i.e., "make@@\" is illegal).
Also be careful that there is a space after the "\" (i.e., at the
beginning of the next line).
- Can be made resident to save space and time
- Amiga specific wildcards can be used in $(wildcard ...)
@@ -36,17 +36,17 @@ BUGS:
dummy.h : src/*.c
tries to make dummy.h from "src/*.c" (ie. no wildcard-expansion takes
tries to make dummy.h from "src/*.c" (i.e., no wildcard-expansion takes
place). You have to use "$(wildcard src/*.c)" instead.
COMPILING FROM SCRATCH
----------------------
To recompile, you need SAS/C 6.51. make itself is not neccessary, there
To recompile, you need SAS/C 6.51. make itself is not necessary, there
is an smakefile.
1. Copy config.ami to config.h
2. If you use make to compie, copy Makefile.ami to Makefile and
2. If you use make to compile, copy Makefile.ami to Makefile and
glob/Makefile.ami to glob/Makefile. Copy make into the current
directory.
@@ -54,15 +54,14 @@ is an smakefile.
INSTALLATION
Copy make somewhere in your search path (eg. sc:c or sc:bin).
Copy make somewhere in your search path (e.g., sc:c or sc:bin).
If you plan to use recursive makes, install make resident:
Resident make Add
-------------------------------------------------------------------------------
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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the

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,20 +55,20 @@ 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
[Enter]. Otherwise, you need to supply the path to the source
directory as an argument to the batch file, like this:
c:\djgpp\gnu\make-%VERSION%\configure.bat c:/djgpp/gnu/make-%VERSION%
c:\djgpp\gnu\make-%VERSION%\configure.bat c:/djgpp/gnu/make-%VERSION%
Note the forward slashes in the source path argument: you MUST
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.
@@ -84,14 +84,14 @@ To build from sources:
If you are building from outside of the source directory, you
need to tell Make where the sources are, like this:
make srcdir=c:/djgpp/gnu/make-%VERSION%
make srcdir=c:/djgpp/gnu/make-%VERSION%
(configure.bat will tell you this when it finishes). You MUST
use a full, not relative, name of the source directory here, or
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).
@@ -99,7 +99,7 @@ To build from sources:
area. If you wish to use a different directory, override the
DESTDIR variable when invoking "make install", like this:
make install DESTDIR=c:/other/dir
make install DESTDIR=c:/other/dir
This causes the make executable to be placed in c:/other/dir/bin,
the man pages in c:/other/dir/man, etc.
@@ -107,21 +107,21 @@ 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.
* 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
install-info --info-dir=c:/djgpp/info c:/djgpp/info/make.info
(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,17 +315,16 @@ 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.
Enjoy,
Eli Zaretskii <eliz@is.elta.co.il>
Eli Zaretskii <eliz@is.elta.co.il>
-------------------------------------------------------------------------------
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 1996-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the

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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the

View File

@@ -1,23 +1,33 @@
This is the VMS version of GNU Make, updated by Hartmut Becker
Changes are based on GNU make 3.82.
This version was built and tested on OpenVMS V7.3 (VAX), V7.3-2 (Alpha) and
V8.3-1H1 (I64).
This version of GNU make has been tested on
OpenVMS V8.3 (Alpha) and V8.4 (Integrity).
Build instructions
------------------
Make a 1st version
$ @makefile.com ! ignore any compiler and/or linker warning
$ rena make.exe 1st-make.exe
Use the 1st version to generate a 2nd version
$ mc sys$disk:[]1st-make clean
$ copy make.exe 1st-make.exe
Use the 1st version to generate a 2nd version
$ mc sys$disk:[]1st-make clean ! ignore any file not found messages
$ mc sys$disk:[]1st-make
Verify your 2nd version
$ rena make.exe 2nd-make.exe
Verify your 2nd version
$ copy make.exe 2nd-make.exe
$ mc sys$disk:[]2nd-make clean
$ mc sys$disk:[]2nd-make
Don't use the HP C V7.2-001 compiler, which has an incompatible change
how __STDC__ is defined. This results at least in compile time warnings.
Changes since GNU make 3.82
---------------------------
Changes (3.81.90)
Fix build problems.
The new feature "Loadable objects" is not yet supported. If you need it,
please send a change request or submit a bug report.
The new option --output-sync (-O) is accepted but has no effect: GNU make
for VMS does not support running multiple commands simultaneously.
Changes for GNU make 3.82
Michael Gehre (at VISTEC-SEMI dot COM) supplied a fix for a problem with
timestamps of object modules in OLBs. The timestamps were not correctly
@@ -34,30 +44,6 @@ systems.
Build fixes for const-ified code in VMS specific sources.
Build notes:
- Try to avoid HP C V7.2-001, which has an incompatible change
how __STDC__ is defined. This results at least in compile time warnings.
- On V8.3-1H1, if you press Ctrl+C you may see a traceback, starting with
%SYSTEM-F-CONTROLC, operation completed under CTRL/C
%TRACE-F-TRACEBACK, symbolic stack dump follows
image module routine line rel PC abs PC
DECC$SHR C$SIGNAL gsignal 27991 0000000000001180
FFFFFFFF84AB2DA0
DECC$SHR C$SIGNAL raise 28048 0000000000001280
FFFFFFFF84AB2EA0
DECC$SHR C$SIGPENDING decc$$deliver_signals
12475 0000000000000890
FFFFFFFF84C13690
...
This looks like an incompatibility to the Alpha and VAX behavior, so it looks
like a problem in I64 VMS version(s).
- There is no clean build on VAX. In the environment I tested, I had to use GNU
make's alloca which produced a couple of compile time warnings. It seems too
much effort to work on a clean build on VAX.
A note on appending the redirected output. With this change, a simple mechanism
is implemented to make ">>" work in action lines. In VMS there is no simple
feature like ">>" to have DCL command or program output redirected and appended
@@ -78,117 +64,24 @@ happens. Pressing Ctrl+Y to abort make is one case. In case of Ctrl+Y the
associated command procedure is left in SYS$SCRATCH as well. Its name is
CMDxxxxx.COM.
Change in the Ctrl+Y handling
Change in the Ctrl+Y handling. The CtrlY handler now uses $delprc to delete all
children. This way also actions with DCL commands will be stopped. As before
the CtrlY handler then sends SIGQUIT to itself, which is handled in common
code.
Ctrl+Y was: The CtrlY handler called $forcex for the current child.
Ctrl+Y changed: The CtrlY handler uses $delprc to delete all children. This way
also actions with DCL commands will be stopped. As before Ctrl+Y then sends
SIGQUIT to itself, which is handled in common code.
Change in deleteing temporary command files
Temporary command files were deleted in the main line, after returning from the
vms child termination handler. If Ctrl+C was pressed, the handler is called but
did not return to main line.
Now, temporary command files are deleted in the vms child termination
handler. That deletes the them even if a Ctrl+C was pressed.
Change in deleteing temporary command files. Temporary command files are now
deleted in the vms child termination handler. That deletes them even if
a Ctrl+C was pressed.
The behavior of pressing Ctrl+C is not changed. It still has only an effect,
after the current action is terminated. If that doesn't happen or takes too
long, Ctrl+Y should be used instead.
Changes (3.80)
Changes for GNU make 3.80
. In default.c define variable ARCH as IA64 for VMS on Itanium systems.
. In makefile.vms avoid name collision for glob and globfree.
In newer version of the VMS CRTL there are glob and globfree implemented.
Compiling and linking may result in
%ILINK-W-MULDEFLNKG, symbol DECC$GLOBFREE has subsequent linkage definition
in module DECC$SHR file SYS$COMMON:[SYSLIB]DECC$SHR.EXE;1
%ILINK-W-MULDEF, symbol DECC$GLOBFREE multiply defined
in module DECC$SHR file SYS$COMMON:[SYSLIB]DECC$SHR.EXE;1
linker messages (and similar for DECC$GLOB). The messages just say, that
globfree is a known CRTL whose name was mapped by the compiler to
DECC$GLOBFREE. This is done in glob.c as well, so this name is defined
twice. One possible solution is to use the VMS versions of glob and
globfree. However, then the build environment needs to figure out if
there is a new CRTL supporting these or not. This adds complexity. Even
more, these functions return VMS file specifications, which is not
expected by the other make sources. There is a switch at run time (a VMS
logical DECC$GLOB_UNIX_STYLE), which can be set to get Unix style
names. This may conflict with other software. The recommended solution
for this is to set this switch just prior to calling main: in an
initialization routine. This adds more complexity and more VMS specific
code. It is easier to tell the compiler NOT to map the routine names
with a simple change in makefile.vms.
Some notes on case sensitive names in rules and on the disk. In the VMS
template for CONFIG.H case sensitive rules can be enabled with defining
WANT_CASE_SENSITIVE_TARGETS. For recent version of VMS there is a case
sensitive file system: ODS5. To make use of that, additionally un-defining
the HAVE_CASE_INSENSITIVE_FS is required. As these are C macros, different
versions of make need to be built to have any case sensitivity for VMS
working. Unfortunately, for ODS5 disks that's not all.
- Usually DCL upcases command line tokens (except strings) and usually the
file system is case blind (similar to how Windows systems work)
$ set proc/parse=extended/case=sensitive
preserves lower and UPPER on the command line and (for this process and all
sub-processes) enables case sensitivity in the file system
- Usually the CRTL tries to reverse what DCL did with command line tokens, it
lowercases all tokens (except strings)
$ define DECC$ARGV_PARSE_STYLE enable
passes (the now preserved) lower and UPPER from the command line to main()
- Usually the CRTL upcases the arguments to open() and friends
$ define DECC$EFS_CASE_PRESERVE enable
preserves the names as is.
It is important to know that not all VMS tools are ready for case sensitivity.
With this setup some tools may not work as expected. The setup should not
blindly be applied for all users in default login procedures.
Example? The poor coding gives a compiler message, showing that there are
different files:
$ dir
Directory ODS5DISK[HB]
A.c;1 B.c;1 c.c;1 X.c;1
x.c;1
Total of 5 files.
$ ods5make x.obj
cc /obj=x.obj x.c
foo(){lowercase_x();}
......^
%CC-I-IMPLICITFUNC, In this statement, the identifier "lowercase_x" is implicitly declared as a function.
at line number 1 in file ODS5DISK[HB]x.c;1
$ mc SYS$SYSDEVICE:[HARTMUT.MAKE_3_80P]ods5make X.obj
cc /obj=X.obj X.c
foo() {UPPERCASE_X();}
.......^
%CC-I-IMPLICITFUNC, In this statement, the identifier "UPPERCASE_X" is implicitly declared as a function.
at line number 1 in file ODS5DISK[HB]X.c;1
$ dir
Directory ODS5DISK[HB]
A.c;1 B.c;1 c.c;1 X.c;1
x.c;1 X.obj;1 x.obj;1
Total of 7 files.
$
This is the VMS port of GNU Make done by Hartmut.Becker@compaq.com.
@@ -212,7 +105,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.
@@ -353,7 +246,7 @@ replaced it with a hack in vmsfunctions.c. I will provide a full rewrite
somewhere in the future. Be warned, the time resolution inside make is
less than what vms provides. This might be a problem on the faster Alphas.
You can use a : in a filename only if you preceed it with a backslash ('\').
You can use a : in a filename only if you precede it with a backslash ('\').
E.g.- hobbes\:[bogas.files]
Make ignores success, informational, or warning errors (-S-, -I-, or
@@ -375,8 +268,7 @@ Long command lines are now converted to command files.
Comma (',') as a separator is now allowed. See makefile.vms for an example.
-------------------------------------------------------------------------------
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 1996-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the

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 4.0, a build with Guile is supported (tested with Guile
2.0.3). To build with Guile, you will need, in addition to Guile
itself, its dependency libraries and the pkg-config program. The
latter is used to figure out which compilation and link switches and
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.
@@ -37,10 +55,16 @@ Building with (MinGW-)GCC using build_w32.bat
2. Open a W32 command prompt for your installed (MinGW-)GCC, setup a
correct PATH and other environment variables for it, then execute ...
build_w32.bat gcc
build_w32.bat gcc
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
----------------------------------------------------------
@@ -51,16 +75,21 @@ Building with (MSVC++-)cl using build_w32.bat or NMakefile
e.g. "%VS71COMNTOOLS%vsvars32.bat"; or using a corresponding start
menue entry from the cl-installation), then execute EITHER ...
build_w32.bat
build_w32.bat
(this produces WinDebug/gnumake.exe and WinRel/gnumake.exe)
... OR ...
nmake /f NMakefile
nmake /f 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 --
@@ -68,212 +97,203 @@ Building with (MSVC++-)cl using build_w32.bat or NMakefile
GNU make on Windows 32-bit platforms:
This version of make is ported natively to Windows32 platforms
(Windows NT 3.51, Windows NT 4.0, Windows 2000, Windows XP,
Windows 95, and Windows 98). It does not rely on any 3rd party
software or add-on packages for building. The only thing
needed is a Windows compiler. Two compilers supported
officially are the MinGW port of GNU GCC, and the various
versions of the Microsoft C compiler.
This version of make is ported natively to Windows32 platforms
(Windows NT 3.51, Windows NT 4.0, Windows 2000, Windows XP,
Windows 95, and Windows 98). It does not rely on any 3rd party
software or add-on packages for building. The only thing
needed is a Windows compiler. Two compilers supported
officially are the MinGW port of GNU GCC, and the various
versions of the Microsoft C compiler.
Do not confuse this port of GNU make with other Windows32 projects
which provide a GNU make binary. These are separate projects
and are not connected to this port effort.
Do not confuse this port of GNU make with other Windows32 projects
which provide a GNU make binary. These are separate projects
and are not connected to this port effort.
GNU make and sh.exe:
This port prefers if you have a working sh.exe somewhere on
your system. If you don't have sh.exe, the port falls back to
MSDOS mode for launching programs (via a batch file). The
MSDOS mode style execution has not been tested that carefully
though (The author uses GNU bash as sh.exe).
This port prefers if you have a working sh.exe somewhere on
your system. If you don't have sh.exe, the port falls back to
MSDOS mode for launching programs (via a batch file). The
MSDOS mode style execution has not been tested that carefully
though (The author uses GNU bash as sh.exe).
There are very few true ports of Bourne shell for NT right now.
There is a version of GNU bash available from Cygnus "Cygwin"
porting effort (http://www.cygwin.com/).
Other possibilities are the MKS version of sh.exe, or building
There are very few true ports of Bourne shell for NT right now.
There is a version of GNU bash available from Cygnus "Cygwin"
porting effort (http://www.cygwin.com/).
Other possibilities are the MKS version of sh.exe, or building
your own with a package like NutCracker (DataFocus) or Portage
(Consensys). Also MinGW includes sh (http://mingw.org/).
GNU make and brain-dead shells (BATCH_MODE_ONLY_SHELL):
Some versions of Bourne shell do not behave well when invoked
as 'sh -c' from CreateProcess(). The main problem is they seem
to have a hard time handling quoted strings correctly. This can
be circumvented by writing commands to be executed to a batch
file and then executing the command by calling 'sh file'.
Some versions of Bourne shell do not behave well when invoked
as 'sh -c' from CreateProcess(). The main problem is they seem
to have a hard time handling quoted strings correctly. This can
be circumvented by writing commands to be executed to a batch
file and then executing the command by calling 'sh file'.
To work around this difficulty, this version of make supports
a batch mode. When BATCH_MODE_ONLY_SHELL is defined at compile
time, make forces all command lines to be executed via script
files instead of by command line. In this mode you must have a
working sh.exe in order to use parallel builds (-j).
To work around this difficulty, this version of make supports
a batch mode. When BATCH_MODE_ONLY_SHELL is defined at compile
time, make forces all command lines to be executed via script
files instead of by command line. In this mode you must have a
working sh.exe in order to use parallel builds (-j).
A native Windows32 system with no Bourne shell will also run
in batch mode. All command lines will be put into batch files
and executed via $(COMSPEC) (%COMSPEC%). However, parallel
builds ARE supported with Windows shells (cmd.exe and
command.com). See the next section about some peculiarities
of parallel builds on Windows.
A native Windows32 system with no Bourne shell will also run
in batch mode. All command lines will be put into batch files
and executed via $(COMSPEC) (%COMSPEC%). However, parallel
builds ARE supported with Windows shells (cmd.exe and
command.com). See the next section about some peculiarities
of parallel builds on Windows.
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:
Good news! Make now has native support for Cygwin sh. To enable,
define the HAVE_CYGWIN_SHELL in config.h and rebuild make
from scratch. This version of make tested with B20.1 of Cygwin.
Do not define BATCH_MODE_ONLY_SHELL if you use HAVE_CYGWIN_SHELL.
Good news! Make now has native support for Cygwin sh. To enable,
define the HAVE_CYGWIN_SHELL in config.h and rebuild make
from scratch. This version of make tested with B20.1 of Cygwin.
Do not define BATCH_MODE_ONLY_SHELL if you use HAVE_CYGWIN_SHELL.
GNU make and the MKS shell:
There is now semi-official support for the MKS shell. To turn this
support on, define HAVE_MKS_SHELL in the config.h.W32 before you
build make. Do not define BATCH_MODE_ONLY_SHELL if you turn
on HAVE_MKS_SHELL.
There is now semi-official support for the MKS shell. To turn this
support on, define HAVE_MKS_SHELL in the config.h.W32 before you
build make. Do not define BATCH_MODE_ONLY_SHELL if you turn
on HAVE_MKS_SHELL.
GNU make handling of drive letters in pathnames (PATH, vpath, VPATH):
There is a caveat that should be noted with respect to handling
single character pathnames on Windows systems. When colon is
used in PATH variables, make tries to be smart about knowing when
you are using colon as a separator versus colon as a drive
letter. Unfortunately, something as simple as the string 'x:/'
could be interpreted 2 ways: (x and /) or (x:/).
There is a caveat that should be noted with respect to handling
single character pathnames on Windows systems. When colon is
used in PATH variables, make tries to be smart about knowing when
you are using colon as a separator versus colon as a drive
letter. Unfortunately, something as simple as the string 'x:/'
could be interpreted 2 ways: (x and /) or (x:/).
Make chooses to interpret a letter plus colon (e.g. x:/) as a
drive letter pathname. If it is necessary to use single
character directories in paths (VPATH, vpath, Path, PATH), the
user must do one of two things:
Make chooses to interpret a letter plus colon (e.g. x:/) as a
drive letter pathname. If it is necessary to use single
character directories in paths (VPATH, vpath, Path, PATH), the
user must do one of two things:
a. Use semicolon as the separator to disambiguate colon. For
example use 'x;/' if you want to say 'x' and '/' are
separate components.
a. Use semicolon as the separator to disambiguate colon. For
example use 'x;/' if you want to say 'x' and '/' are
separate components.
b. Qualify the directory name so that there is more than
one character in the path(s) used. For example, none
of these settings are ambiguous:
b. Qualify the directory name so that there is more than
one character in the path(s) used. For example, none
of these settings are ambiguous:
./x:./y
/some/path/x:/some/path/y
x:/some/path/x:x:/some/path/y
./x:./y
/some/path/x:/some/path/y
x:/some/path/x:x:/some/path/y
Please note that you are free to mix colon and semi-colon in the
specification of paths. Make is able to figure out the intended
result and convert the paths internally to the format needed
when interacting with the operating system, providing the path
is not within quotes, e.g. "x:/test/test.c".
Please note that you are free to mix colon and semi-colon in the
specification of paths. Make is able to figure out the intended
result and convert the paths internally to the format needed
when interacting with the operating system, providing the path
is not within quotes, e.g. "x:/test/test.c".
You are encouraged to use colon as the separator character.
This should ease the pain of deciding how to handle various path
problems which exist between platforms. If colon is used on
both Unix and Windows systems, then no ifdef'ing will be
necessary in the makefile source.
You are encouraged to use colon as the separator character.
This should ease the pain of deciding how to handle various path
problems which exist between platforms. If colon is used on
both Unix and Windows systems, then no ifdef'ing will be
necessary in the makefile source.
GNU make test suite:
I verified all functionality with a slightly modified version
of make-test-%VERSION% (modifications to get test suite to run
on Windows NT). All tests pass in an environment that includes
sh.exe. Tests were performed on both Windows NT and Windows 95.
I verified all functionality with a slightly modified version
of make-test-%VERSION% (modifications to get test suite to run
on Windows NT). All tests pass in an environment that includes
sh.exe. Tests were performed on both Windows NT and Windows 95.
Pathnames and white space:
Unlike Unix, Windows 95/NT systems encourage pathnames which
contain white space (e.g. C:\Program Files\). These sorts of
pathnames are valid on Unix too, but are never encouraged.
There is at least one place in make (VPATH/vpath handling) where
paths containing white space will simply not work. There may be
others too. I chose to not try and port make in such a way so
that these sorts of paths could be handled. I offer these
suggestions as workarounds:
Unlike Unix, Windows 95/NT systems encourage pathnames which
contain white space (e.g. C:\Program Files\). These sorts of
pathnames are valid on Unix too, but are never encouraged.
There is at least one place in make (VPATH/vpath handling) where
paths containing white space will simply not work. There may be
others too. I chose to not try and port make in such a way so
that these sorts of paths could be handled. I offer these
suggestions as workarounds:
1. Use 8.3 notation. i.e. "x:/long~1/", which is actually
"x:\longpathtest". Type "dir /x" to view these filenames
within the cmd.exe shell.
2. Rename the directory so it does not contain white space.
1. Use 8.3 notation. i.e. "x:/long~1/", which is actually
"x:\longpathtest". Type "dir /x" to view these filenames
within the cmd.exe shell.
2. Rename the directory so it does not contain white space.
If you are unhappy with this choice, this is free software
and you are free to take a crack at making this work. The code
in w32/pathstuff.c and vpath.c would be the places to start.
If you are unhappy with this choice, this is free software
and you are free to take a crack at making this work. The code
in w32/pathstuff.c and vpath.c would be the places to start.
Pathnames and Case insensitivity:
Unlike Unix, Windows 95/NT systems are case insensitive but case
preserving. For example if you tell the file system to create a
file named "Target", it will preserve the case. Subsequent access to
the file with other case permutations will succeed (i.e. opening a
file named "target" or "TARGET" will open the file "Target").
Unlike Unix, Windows 95/NT systems are case insensitive but case
preserving. For example if you tell the file system to create a
file named "Target", it will preserve the case. Subsequent access to
the file with other case permutations will succeed (i.e. opening a
file named "target" or "TARGET" will open the file "Target").
By default, GNU make retains its case sensitivity when comparing
target names and existing files or directories. It can be
configured, however, into a case preserving and case insensitive
mode by adding a define for HAVE_CASE_INSENSITIVE_FS to
config.h.W32.
By default, GNU make retains its case sensitivity when comparing
target names and existing files or directories. It can be
configured, however, into a case preserving and case insensitive
mode by adding a define for HAVE_CASE_INSENSITIVE_FS to
config.h.W32.
For example, the following makefile will create a file named
Target in the directory subdir which will subsequently be used
to satisfy the dependency of SUBDIR/DepTarget on SubDir/TARGET.
Without HAVE_CASE_INSENSITIVE_FS configured, the dependency link
will not be made:
For example, the following makefile will create a file named
Target in the directory subdir which will subsequently be used
to satisfy the dependency of SUBDIR/DepTarget on SubDir/TARGET.
Without HAVE_CASE_INSENSITIVE_FS configured, the dependency link
will not be made:
subdir/Target:
touch $@
subdir/Target:
touch $@
SUBDIR/DepTarget: SubDir/TARGET
cp $^ $@
SUBDIR/DepTarget: SubDir/TARGET
cp $^ $@
Reliance on this behavior also eliminates the ability of GNU make
to use case in comparison of matching rules. For example, it is
not possible to set up a C++ rule using %.C that is different
than a C rule using %.c. GNU make will consider these to be the
same rule and will issue a warning.
Reliance on this behavior also eliminates the ability of GNU make
to use case in comparison of matching rules. For example, it is
not possible to set up a C++ rule using %.C that is different
than a C rule using %.c. GNU make will consider these to be the
same rule and will issue a warning.
SAMBA/NTFS/VFAT:
I have not had any success building the debug version of this
package using SAMBA as my file server. The reason seems to be
related to the way VC++ 4.0 changes the case name of the pdb
filename it is passed on the command line. It seems to change
the name always to to lower case. I contend that the VC++
compiler should not change the casename of files that are passed
as arguments on the command line. I don't think this was a
problem in MSVC 2.x, but I know it is a problem in MSVC 4.x.
I have not had any success building the debug version of this
package using SAMBA as my file server. The reason seems to be
related to the way VC++ 4.0 changes the case name of the pdb
filename it is passed on the command line. It seems to change
the name always to to lower case. I contend that the VC++
compiler should not change the casename of files that are passed
as arguments on the command line. I don't think this was a
problem in MSVC 2.x, but I know it is a problem in MSVC 4.x.
The package builds fine on VFAT and NTFS filesystems.
The package builds fine on VFAT and NTFS filesystems.
Most all of the development I have done to date has been using
NTFS and long file names. I have not done any considerable work
under VFAT. VFAT users may wish to be aware that this port of
make does respect case sensitivity.
Most all of the development I have done to date has been using
NTFS and long file names. I have not done any considerable work
under VFAT. VFAT users may wish to be aware that this port of
make does respect case sensitivity.
FAT:
Version 3.76 added support for FAT filesystems. Make works
around some difficulties with stat'ing of files and caching of
filenames and directories internally.
Version 3.76 added support for FAT filesystems. Make works
around some difficulties with stat'ing of files and caching of
filenames and directories internally.
Bug reports:
Please submit bugs via the normal bug reporting mechanism which
is described in the GNU make manual and the base README.
Please submit bugs via the normal bug reporting mechanism which
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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the

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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the

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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -17,35 +17,65 @@ You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
-------------------------------------------------------------------------------
Obtaining CVS Code
Obtaining Git Code
------------------
This seems redundant, since if you're reading this you most likely have
already performed this step; however, for completeness, you can obtain
the GNU make source code via anonymous CVS from the FSF's Savannah
project <http://savannah.gnu.org/projects/make/>:
already performed this step; however, for completeness, you can obtain the GNU
make source code via Git from the FSF's Savannah project
<http://savannah.gnu.org/projects/make/>:
$ cvs -d:pserver:anoncvs@cvs.savannah.gnu.org:/sources/make co make
You might want to use the "-z3" option to get compression, and you most
certainly will want the -P option to avoid unneeded directories
cluttering up your source. Personally I add these (as well as -dP for
update) to my ~/.cvsrc file.
$ git clone git://git.savannah.gnu.org/make.git
If you have an older version of CVS, you might have to login first.
There is no password; just hit the ENTER key if you are asked for one.
Building From CVS
Changes using Git
-----------------
To build GNU make from CVS, you will need Autoconf, Automake, and
For non-developers, please continue to provide patches as before, or if you
make a public repository I can pull from that if you prefer.
For developers, I'm still new to Git myself, so I don't have a ton of advice.
In this release we will continue to create ChangeLog files by hand so please
don't forget to update the ChangeLog.
Rule #1: Don't rewrite pushed history (don't use "git push --force").
Typical simple workflow might be:
* Edit files
* Use "git status" and "git diff" to verify your changes
* Use "git add" to stage the changes you want to make
* Use "git commit" to commit the staged changes to your local repository
* Use "git pull" to accept & merge new changes from the Savannah repository
* Use "git push" to push your commits back to the Savannah repository
For Emacs users, there are many options for Git integration but I strongly
recommend the Magit package: http://www.emacswiki.org/emacs/Magit
It makes the workflow much clearer, and has advanced features such as
constructing multiple commits from various files and even from different
diff chunks in the same file. There is a video available which helps a lot.
Coding Standards
----------------
GNU make code adheres to the GNU Coding Standards. Additionally, GNU make is
a foundational bootstrap package for the GNU project; as such it is very
conservative about language features it expects. It should build with any C
compiler conforming to the ANSI C89 / ISO C90 standard.
Please use only spaces and no TAB characters in source code.
Building From Git
-----------------
To build GNU make from Git, you will need Autoconf, Automake, and
Gettext, and any tools that those utilities require (GNU m4, Perl,
etc.). See the configure.in file to find the minimum versions of each
etc.). See the configure.ac file to find the minimum versions of each
of these tools. You will also need a copy of wget.
When building from CVS you must build in the source directory: "VPATH
When building from Git you must build in the source directory: "VPATH
builds" from remote directories are not supported. Once you've created
a distribution, of course, you can unpack it and do a VPATH build from
there.
@@ -77,7 +107,7 @@ to the point where you can run "make".
a platform-local make you may get problems with missing files in doc/.
At this point you have successfully brought your CVS copy of the GNU
At this point you have successfully brought your Git copy of the GNU
make source directory up to the point where it can be treated
more-or-less like the official package you would get from ftp.gnu.org.
That is, you can just run:
@@ -87,7 +117,7 @@ That is, you can just run:
to build and install GNU make.
Windows builds from CVS
Windows builds from Git
-----------------------
If you have a UNIX emulation like CYGWIN you can opt to run the general
@@ -130,18 +160,27 @@ Steps to Release
Here are the things that need to be done (in more or less this order)
before making an official release:
* Update the configure.in file with the new release number.
* Update the configure.ac file with the new release number.
* Update the NEWS file with the release number and date.
* In Savannah modify the "Value", "Rank", and "Description" values for the
current "SCM" entry in both "Component Version" and "Fix Release" fields
to refer to the new release, for "Bugs" and "Patches".
* Update the Savannah bug list URL in the NEWS file to use the correct
"Fixed Release" ID number.
* In Savannah create a new entry for the "Component Version" and "Fix
Release" fields:
- Value: SCM
- Rank: 20
- Descr: Fixed in Git; will be available in the next version of Make.
* Run "make distcheck" to be sure it all works.
* git tag -u <GPGID> <VER> where GPGID is my GPG key fingerprint,
and VER is the release version.
* Push everything:
git push --tags origin master
* Create the new release in the Savannah "Bugs" Administration for
both the "Component Version" and "Fixed Release" fields.
* Create the new release in the Savannah "Patches" Administration for
the "Fixed Release" field.
* Update the Savannah bug list URL in the NEWS file to use the correct
"Fixed Release" ID number.
* Run "make distcheck" to be sure it all works.
* Commit everything.
* cvs tag <RTAG> where RTAG is constructed by replacing each "." in
the version with "-" and prefixing it with "make-".
Publishing a Package
@@ -151,12 +190,11 @@ In order to publish a package on the FSF FTP site, either the release
site ftp://ftp.gnu.org, or the prerelease site ftp://alpha.gnu.org, you
first need to have my GPG private key and my passphrase to unlock it.
And, you can't have them! So there! But, just so I remember here's
what you do:
what to do:
Make sure the "Steps to Release" are complete and committed and tagged.
cvs -d :pserver:anonymous@cvs.savannah.gnu.org:/sources/make \
export -r<RTAG> -d make-release make
git clone git://git.savannah.gnu.org/make.git make-release
cd make-release
@@ -166,14 +204,17 @@ what you do:
-OR-
make upload-ftp # for ftp.gnu.org (official releases)
It will ask for the GPG passphrase _THREE_ times. Sigh.
Depending on your distribution (whether GnuPG is integrated with your keyring
etc.) it will either pop up a window asking for your GPG key passphrase one
time, or else it will use the CLI to ask for the GPG passphrase _THREE_ times.
Sigh.
For both final releases and pre-releases, send an email with the URL of
the package to the GNU translation robot to allow the translators to
work on it:
<translation@iro.umontreal.ca>
<coordinator@translationproject.org>
Where to Announce
@@ -185,8 +226,9 @@ Create the announcement in a text file, then sign it with GPG.
Upload to gnu.org, then login and send from my account there.
Email to: make-alpha@gnu.org, bug-make@gnu.org, help-make@gnu.org, make-w32@gnu.org.
Email to: info-gnu@gnu.org
To: bug-make@gnu.org, help-make@gnu.org, make-w32@gnu.org
CC: info-gnu@gnu.org
BCC: make-alpha@gnu.org
Add a news item to the Savannah project site.
@@ -198,7 +240,7 @@ Appendix A - For The Brave
For those of you who trust me implicitly, or are just brave (or
foolhardy), here is a canned sequence of commands to build a GNU make
distribution package from a virgin CVS source checkout (assuming all the
distribution package from a virgin Git source checkout (assuming all the
prerequisites are available of course).
This list is eminently suitable for a quick swipe o' the mouse and a

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,31 +81,20 @@ 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
Git Access
----------
The GNU make source repository is available via anonymous CVS from the
GNU Subversions CVS server; look here for details:
The GNU make source repository is available via Git from the
GNU Savannah Git server; look here for details:
http://savannah.gnu.org/cvs/?group=make
http://savannah.gnu.org/git/?group=make
Please note: you won't be able to build GNU make from CVS without
Please note: you won't be able to build GNU make from Git without
installing appropriate maintainer's tools, such as GNU m4, automake,
autoconf, Perl, GNU make, and GCC. See the README.cvs file for hints on
autoconf, Perl, GNU make, and GCC. See the README.git file for hints on
how to build GNU make once these tools are available. We make no
guarantees about the contents or quality of the latest code in the CVS
guarantees about the contents or quality of the latest code in the Git
repository: it is not unheard of for code that is known to be broken to
be checked in. Use at your own risk.
@@ -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
@@ -151,7 +142,7 @@ Ports
- See README.customs for details on integrating GNU make with the
Customs distributed build environment from the Pmake distribution.
- See readme.vms for details about GNU Make on OpenVMS.
- See README.VMS for details about GNU Make on OpenVMS.
- See README.Amiga for details about GNU Make on AmigaDOS.
@@ -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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the

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-2013 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
@@ -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,21 +123,26 @@ 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 \
output.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)job.h $(srcdir)makeint.h $(srcdir)rule.h \
$(srcdir)output.c $(srcdir)output.h \
$(srcdir)variable.h $(ALLOCA_SRC) $(srcdir)config.h.in
@@ -148,7 +152,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

@@ -6,7 +6,7 @@ This list comes both from the authors and from users of GNU make.
They are listed in no particular order!
Also, I don't gaurantee that all of them will be ultimately deemed "good
Also, I don't guarantee that all of them will be ultimately deemed "good
ideas" and implemented. These are just the ones that, at first blush,
seem to have some merit (and that I can remember).
@@ -99,34 +99,9 @@ The Rest of the List
you just can't figure it out. The way variables are expanded now
means this isn't 100% trivial, but it probably won't be hard.
8) Integration of Guile as an embedded scripting language. This means:
allowing Guile functions to be declared in makefiles somehow, then
providing a syntax for invoking them. At least one formulation of
that would have the function resolve to a string which would be
substituted in the makefile, kind of like $(shell ...) does now, but
using the embedded interpreter so there's no process forked of
course. Obviously this is an optional add-on feature.
It could be more advanced than that, even, who knows? Maybe make
could provide Guile functions that allow Guile scripts more direct
access to internal make structures, somehow. This kind of thing
needs a lot of thought.
Also there's always the flip side: in some very fundamental ways
make isn't the best choice right now for a complex build tool. It's
great for simple-to-medium tasks, but there are already other tools
available for the really tough situations. Ask yourself,
realistically, how much work is worthwhile to add to make, given the
fundamentals you can't really overcome without significantly
affecting backward compatibility--and then why not use another tool
in the first place?
Something to think about.
-------------------------------------------------------------------------------
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Copyright (C) 1997-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the

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-2013 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)

87
amiga.c
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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -15,7 +14,7 @@ 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 "makeint.h"
#include "variable.h"
#include "amiga.h"
#include <assert.h>
@@ -25,7 +24,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include <proto/dos.h>
static const char Amiga_version[] = "$VER: Make 3.74.3 (12.05.96) \n"
"Amiga Port by A. Digulla (digulla@home.lake.de)";
"Amiga Port by A. Digulla (digulla@home.lake.de)";
int
MyExecute (char **argv)
@@ -37,7 +36,7 @@ MyExecute (char **argv)
for (aptr=argv; *aptr; aptr++)
{
len += strlen (*aptr) + 4;
len += strlen (*aptr) + 4;
}
buffer = AllocMem (len, MEMF_ANY);
@@ -49,41 +48,41 @@ MyExecute (char **argv)
for (aptr=argv; *aptr; aptr++)
{
if (((*aptr)[0] == ';' && !(*aptr)[1]))
{
*ptr ++ = '"';
strcpy (ptr, *aptr);
ptr += strlen (ptr);
*ptr ++ = '"';
}
else if ((*aptr)[0] == '@' && (*aptr)[1] == '@' && !(*aptr)[2])
{
*ptr ++ = '\n';
continue;
}
else
{
strcpy (ptr, *aptr);
ptr += strlen (ptr);
}
*ptr ++ = ' ';
*ptr = 0;
if (((*aptr)[0] == ';' && !(*aptr)[1]))
{
*ptr ++ = '"';
strcpy (ptr, *aptr);
ptr += strlen (ptr);
*ptr ++ = '"';
}
else if ((*aptr)[0] == '@' && (*aptr)[1] == '@' && !(*aptr)[2])
{
*ptr ++ = '\n';
continue;
}
else
{
strcpy (ptr, *aptr);
ptr += strlen (ptr);
}
*ptr ++ = ' ';
*ptr = 0;
}
ptr[-1] = '\n';
status = SystemTags (buffer,
SYS_UserShell, TRUE,
TAG_END);
SYS_UserShell, TRUE,
TAG_END);
FreeMem (buffer, len);
if (SetSignal(0L,0L) & SIGBREAKF_CTRL_C)
status = 20;
if (SetSignal (0L,0L) & SIGBREAKF_CTRL_C)
status = 20;
/* Warnings don't count */
if (status == 5)
status = 0;
status = 0;
return status;
}
@@ -91,27 +90,27 @@ MyExecute (char **argv)
char *
wildcard_expansion (char *wc, char *o)
{
# define PATH_SIZE 1024
# define PATH_SIZE 1024
struct AnchorPath * apath;
if ( (apath = AllocMem (sizeof (struct AnchorPath) + PATH_SIZE,
MEMF_CLEAR))
)
MEMF_CLEAR))
)
{
apath->ap_Strlen = PATH_SIZE;
apath->ap_Strlen = PATH_SIZE;
if (MatchFirst (wc, apath) == 0)
{
do
{
o = variable_buffer_output (o, apath->ap_Buf,
strlen (apath->ap_Buf));
o = variable_buffer_output (o, " ",1);
} while (MatchNext (apath) == 0);
}
if (MatchFirst (wc, apath) == 0)
{
do
{
o = variable_buffer_output (o, apath->ap_Buf,
strlen (apath->ap_Buf));
o = variable_buffer_output (o, " ",1);
} while (MatchNext (apath) == 0);
}
MatchEnd (apath);
FreeMem (apath, sizeof (struct AnchorPath) + PATH_SIZE);
MatchEnd (apath);
FreeMem (apath, sizeof (struct AnchorPath) + PATH_SIZE);
}
return o;

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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the

58
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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
@@ -17,18 +15,18 @@ 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 "makeint.h"
#ifndef NO_ARCHIVES
#ifndef NO_ARCHIVES
#include "filedef.h"
#include "dep.h"
#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;
}
@@ -63,20 +61,20 @@ ar_parse_name (const char *name, char **arname_p, char **memname_p)
*arname_p = xstrdup (name);
p = strchr (*arname_p, '(');
*(p++) = '\0';
p[strlen(p) - 1] = '\0';
p[strlen (p) - 1] = '\0';
*memname_p = 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
ar_member_date_1 (int desc UNUSED, const char *mem, int truncated,
long int hdrpos UNUSED, long int datapos UNUSED,
long int hdrpos UNUSED, long int datapos UNUSED,
long int size UNUSED, long int date,
int uid UNUSED, int gid UNUSED, int mode UNUSED,
const void *name)
const void *name)
{
return ar_name_equal (name, mem, truncated) ? date : 0;
}
@@ -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,12 +181,12 @@ 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
ar_glob_match (int desc UNUSED, const char *mem, int truncated UNUSED,
long int hdrpos UNUSED, long int datapos UNUSED,
long int hdrpos UNUSED, long int datapos UNUSED,
long int size UNUSED, long int date UNUSED, int uid UNUSED,
int gid UNUSED, int mode UNUSED, const void *arg)
{
@@ -220,21 +218,21 @@ glob_pattern_p (const char *pattern, int quote)
{
case '?':
case '*':
return 1;
return 1;
case '\\':
if (quote)
++p;
break;
if (quote)
++p;
break;
case '[':
opened = 1;
break;
opened = 1;
break;
case ']':
if (opened)
return 1;
break;
if (opened)
return 1;
break;
}
return 0;
@@ -284,4 +282,4 @@ ar_glob (const char *arname, const char *member_pattern, unsigned int size)
return state.chain;
}
#endif /* Not NO_ARCHIVES. */
#endif /* Not NO_ARCHIVES. */

543
arscan.c
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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -16,7 +14,7 @@ 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 "makeint.h"
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
@@ -24,7 +22,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/file.h>
#endif
#ifndef NO_ARCHIVES
#ifndef NO_ARCHIVES
#ifdef VMS
#include <lbrdef.h>
@@ -63,11 +61,11 @@ VMS_get_member_info (struct dsc$descriptor_s *module, unsigned long *rfa)
bufdesc.dsc$w_length = sizeof (filename);
status = lbr$set_module (&VMS_lib_idx, rfa, &bufdesc,
&bufdesc.dsc$w_length, 0);
&bufdesc.dsc$w_length, 0);
if (! (status & 1))
{
error (NILF, _("lbr$set_module() failed to extract module info, status = %d"),
status);
status);
lbr$close (&VMS_lib_idx);
@@ -114,7 +112,7 @@ VMS_get_member_info (struct dsc$descriptor_s *module, unsigned long *rfa)
fnval =
(*VMS_function) (-1, filename, 0, 0, 0, 0, val, 0, 0, 0,
VMS_saved_memname);
VMS_saved_memname);
if (fnval)
{
@@ -184,8 +182,8 @@ 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'"),
archive, (char *)arg);
error (NILF, _("unable to open library '%s' to lookup member '%s'"),
archive, (char *)arg);
return -1;
}
@@ -214,8 +212,8 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
#else /* !VMS */
/* SCO Unix's compiler defines both of these. */
#ifdef M_UNIX
#undef M_XENIX
#ifdef M_UNIX
#undef M_XENIX
#endif
/* On the sun386i and in System V rel 3, ar.h defines two different archive
@@ -224,7 +222,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
to have a nonzero value. */
#if (!defined (PORTAR) || PORTAR == 0) && (!defined (PORT5AR) || PORT5AR == 0)
#undef PORTAR
#undef PORTAR
#ifdef M_XENIX
/* According to Jim Sievert <jas1@rsvl.unisys.com>, for SCO XENIX defining
PORTAR to 1 gets the wrong archive format, and defining it to 0 gets the
@@ -259,17 +257,17 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
/* BeOS 5 doesn't have <ar.h> but has archives in the same format
* as many other Unices. This was taken from GNU binutils for BeOS.
*/
# define ARMAG "!<arch>\n" /* String that begins an archive file. */
# define SARMAG 8 /* Size of that string. */
# define ARFMAG "`\n" /* String in ar_fmag at end of each header. */
# define ARMAG "!<arch>\n" /* String that begins an archive file. */
# define SARMAG 8 /* Size of that string. */
# define ARFMAG "`\n" /* String in ar_fmag at end of each header. */
struct ar_hdr
{
char ar_name[16]; /* Member file name, sometimes / terminated. */
char ar_date[12]; /* File date, decimal seconds since Epoch. */
char ar_uid[6], ar_gid[6]; /* User and group IDs, in ASCII decimal. */
char ar_mode[8]; /* File mode, in ASCII octal. */
char ar_size[10]; /* File size, in ASCII decimal. */
char ar_fmag[2]; /* Always contains ARFMAG. */
char ar_name[16]; /* Member file name, sometimes / terminated. */
char ar_date[12]; /* File date, decimal seconds since Epoch. */
char ar_uid[6], ar_gid[6]; /* User and group IDs, in ASCII decimal. */
char ar_mode[8]; /* File mode, in ASCII octal. */
char ar_size[10]; /* File size, in ASCII decimal. */
char ar_fmag[2]; /* Always contains ARFMAG. */
};
# endif
# define TOCHAR(_m) (_m)
@@ -294,8 +292,8 @@ struct ar_hdr
#endif
/* Cray's <ar.h> apparently defines this. */
#ifndef AR_HDR_SIZE
# define AR_HDR_SIZE (sizeof (struct ar_hdr))
#ifndef AR_HDR_SIZE
# define AR_HDR_SIZE (sizeof (struct ar_hdr))
#endif
/* Takes three arguments ARCHIVE, FUNCTION and ARG.
@@ -330,12 +328,10 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
{
#ifdef AIAMAG
FL_HDR fl_header;
#ifdef AIAMAGBIG
# ifdef AIAMAGBIG
int big_archive = 0;
FL_HDR_BIG fl_header_big;
#endif
#else
int long_name = 0;
# endif
#endif
char *namemap = 0;
int desc = open (archive, O_RDONLY, 0);
@@ -347,8 +343,8 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
register int nread = read (desc, buf, SARMAG);
if (nread != SARMAG || memcmp (buf, ARMAG, SARMAG))
{
(void) close (desc);
return -2;
(void) close (desc);
return -2;
}
}
#else
@@ -358,39 +354,39 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
if (nread != FL_HSZ)
{
(void) close (desc);
return -2;
(void) close (desc);
return -2;
}
#ifdef AIAMAGBIG
/* If this is a "big" archive, then set the flag and
re-read the header into the "big" structure. */
if (!memcmp (fl_header.fl_magic, AIAMAGBIG, SAIAMAG))
{
big_archive = 1;
big_archive = 1;
/* seek back to beginning of archive */
if (lseek (desc, 0, 0) < 0)
{
(void) close (desc);
return -2;
}
/* seek back to beginning of archive */
if (lseek (desc, 0, 0) < 0)
{
(void) close (desc);
return -2;
}
/* re-read the header into the "big" structure */
nread = read (desc, &fl_header_big, FL_HSZ_BIG);
if (nread != FL_HSZ_BIG)
{
(void) close (desc);
return -2;
}
/* re-read the header into the "big" structure */
nread = read (desc, &fl_header_big, FL_HSZ_BIG);
if (nread != FL_HSZ_BIG)
{
(void) close (desc);
return -2;
}
}
else
#endif
/* Check to make sure this is a "normal" archive. */
if (memcmp (fl_header.fl_magic, AIAMAG, SAIAMAG))
{
{
(void) close (desc);
return -2;
}
}
}
#else
{
@@ -399,11 +395,11 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
#else
unsigned short int buf;
#endif
register int nread = read(desc, &buf, sizeof (buf));
register int nread = read (desc, &buf, sizeof (buf));
if (nread != sizeof (buf) || buf != ARMAG)
{
(void) close (desc);
return -2;
(void) close (desc);
return -2;
}
}
#endif
@@ -421,143 +417,144 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
#ifdef AIAMAGBIG
if ( big_archive )
{
sscanf (fl_header_big.fl_fstmoff, "%20ld", &member_offset);
sscanf (fl_header_big.fl_lstmoff, "%20ld", &last_member_offset);
sscanf (fl_header_big.fl_fstmoff, "%20ld", &member_offset);
sscanf (fl_header_big.fl_lstmoff, "%20ld", &last_member_offset);
}
else
#endif
{
sscanf (fl_header.fl_fstmoff, "%12ld", &member_offset);
sscanf (fl_header.fl_lstmoff, "%12ld", &last_member_offset);
sscanf (fl_header.fl_fstmoff, "%12ld", &member_offset);
sscanf (fl_header.fl_lstmoff, "%12ld", &last_member_offset);
}
if (member_offset == 0)
{
/* Empty archive. */
close (desc);
return 0;
/* Empty archive. */
close (desc);
return 0;
}
#else
#ifndef M_XENIX
#ifndef M_XENIX
register long int member_offset = sizeof (int);
#else /* Xenix. */
#else /* Xenix. */
register long int member_offset = sizeof (unsigned short int);
#endif /* Not Xenix. */
#endif /* Not Xenix. */
#endif
#endif
while (1)
{
register int nread;
struct ar_hdr member_header;
register int nread;
struct ar_hdr member_header;
#ifdef AIAMAGBIG
struct ar_hdr_big member_header_big;
struct ar_hdr_big member_header_big;
#endif
#ifdef AIAMAG
char name[256];
int name_len;
long int dateval;
int uidval, gidval;
long int data_offset;
char name[256];
int name_len;
long int dateval;
int uidval, gidval;
long int data_offset;
#else
char namebuf[sizeof member_header.ar_name + 1];
char *name;
int is_namemap; /* Nonzero if this entry maps long names. */
char namebuf[sizeof member_header.ar_name + 1];
char *name;
int is_namemap; /* Nonzero if this entry maps long names. */
int long_name = 0;
#endif
long int eltsize;
int eltmode;
long int fnval;
long int eltsize;
int eltmode;
long int fnval;
if (lseek (desc, member_offset, 0) < 0)
{
(void) close (desc);
return -2;
}
if (lseek (desc, member_offset, 0) < 0)
{
(void) close (desc);
return -2;
}
#ifdef AIAMAG
#define AR_MEMHDR_SZ(x) (sizeof(x) - sizeof (x._ar_name))
#ifdef AIAMAGBIG
if (big_archive)
{
nread = read (desc, &member_header_big,
AR_MEMHDR_SZ(member_header_big) );
if (big_archive)
{
nread = read (desc, &member_header_big,
AR_MEMHDR_SZ(member_header_big) );
if (nread != AR_MEMHDR_SZ(member_header_big))
{
(void) close (desc);
return -2;
}
if (nread != AR_MEMHDR_SZ(member_header_big))
{
(void) close (desc);
return -2;
}
sscanf (member_header_big.ar_namlen, "%4d", &name_len);
nread = read (desc, name, name_len);
sscanf (member_header_big.ar_namlen, "%4d", &name_len);
nread = read (desc, name, name_len);
if (nread != name_len)
{
(void) close (desc);
return -2;
}
if (nread != name_len)
{
(void) close (desc);
return -2;
}
name[name_len] = 0;
name[name_len] = 0;
sscanf (member_header_big.ar_date, "%12ld", &dateval);
sscanf (member_header_big.ar_uid, "%12d", &uidval);
sscanf (member_header_big.ar_gid, "%12d", &gidval);
sscanf (member_header_big.ar_mode, "%12o", &eltmode);
sscanf (member_header_big.ar_size, "%20ld", &eltsize);
sscanf (member_header_big.ar_date, "%12ld", &dateval);
sscanf (member_header_big.ar_uid, "%12d", &uidval);
sscanf (member_header_big.ar_gid, "%12d", &gidval);
sscanf (member_header_big.ar_mode, "%12o", &eltmode);
sscanf (member_header_big.ar_size, "%20ld", &eltsize);
data_offset = (member_offset + AR_MEMHDR_SZ(member_header_big)
+ name_len + 2);
}
else
data_offset = (member_offset + AR_MEMHDR_SZ(member_header_big)
+ name_len + 2);
}
else
#endif
{
nread = read (desc, &member_header,
AR_MEMHDR_SZ(member_header) );
{
nread = read (desc, &member_header,
AR_MEMHDR_SZ(member_header) );
if (nread != AR_MEMHDR_SZ(member_header))
{
(void) close (desc);
return -2;
}
if (nread != AR_MEMHDR_SZ(member_header))
{
(void) close (desc);
return -2;
}
sscanf (member_header.ar_namlen, "%4d", &name_len);
nread = read (desc, name, name_len);
sscanf (member_header.ar_namlen, "%4d", &name_len);
nread = read (desc, name, name_len);
if (nread != name_len)
{
(void) close (desc);
return -2;
}
if (nread != name_len)
{
(void) close (desc);
return -2;
}
name[name_len] = 0;
name[name_len] = 0;
sscanf (member_header.ar_date, "%12ld", &dateval);
sscanf (member_header.ar_uid, "%12d", &uidval);
sscanf (member_header.ar_gid, "%12d", &gidval);
sscanf (member_header.ar_mode, "%12o", &eltmode);
sscanf (member_header.ar_size, "%12ld", &eltsize);
sscanf (member_header.ar_date, "%12ld", &dateval);
sscanf (member_header.ar_uid, "%12d", &uidval);
sscanf (member_header.ar_gid, "%12d", &gidval);
sscanf (member_header.ar_mode, "%12o", &eltmode);
sscanf (member_header.ar_size, "%12ld", &eltsize);
data_offset = (member_offset + AR_MEMHDR_SZ(member_header)
+ name_len + 2);
}
data_offset += data_offset % 2;
data_offset = (member_offset + AR_MEMHDR_SZ(member_header)
+ name_len + 2);
}
data_offset += data_offset % 2;
fnval =
(*function) (desc, name, 0,
member_offset, data_offset, eltsize,
dateval, uidval, gidval,
eltmode, arg);
fnval =
(*function) (desc, name, 0,
member_offset, data_offset, eltsize,
dateval, uidval, gidval,
eltmode, arg);
#else /* Not AIAMAG. */
nread = read (desc, &member_header, AR_HDR_SIZE);
if (nread == 0)
/* No data left means end of file; that is OK. */
break;
#else /* Not AIAMAG. */
nread = read (desc, &member_header, AR_HDR_SIZE);
if (nread == 0)
/* No data left means end of file; that is OK. */
break;
if (nread != AR_HDR_SIZE
if (nread != AR_HDR_SIZE
#if defined(ARFMAG) || defined(ARFZMAG)
|| (
|| (
# ifdef ARFMAG
memcmp (member_header.ar_fmag, ARFMAG, 2)
# else
@@ -571,152 +568,152 @@ ar_scan (const char *archive, ar_member_func_t function, const void *arg)
# endif
)
#endif
)
{
(void) close (desc);
return -2;
}
)
{
(void) close (desc);
return -2;
}
name = namebuf;
memcpy (name, member_header.ar_name, sizeof member_header.ar_name);
{
register char *p = name + sizeof member_header.ar_name;
do
*p = '\0';
while (p > name && *--p == ' ');
name = namebuf;
memcpy (name, member_header.ar_name, sizeof member_header.ar_name);
{
register char *p = name + sizeof member_header.ar_name;
do
*p = '\0';
while (p > name && *--p == ' ');
#ifndef AIAMAG
/* If the member name is "//" or "ARFILENAMES/" this may be
a list of file name mappings. The maximum file name
length supported by the standard archive format is 14
characters. This member will actually always be the
first or second entry in the archive, but we don't check
that. */
is_namemap = (!strcmp (name, "//")
|| !strcmp (name, "ARFILENAMES/"));
#endif /* Not AIAMAG. */
/* On some systems, there is a slash after each member name. */
if (*p == '/')
*p = '\0';
/* If the member name is "//" or "ARFILENAMES/" this may be
a list of file name mappings. The maximum file name
length supported by the standard archive format is 14
characters. This member will actually always be the
first or second entry in the archive, but we don't check
that. */
is_namemap = (!strcmp (name, "//")
|| !strcmp (name, "ARFILENAMES/"));
#endif /* Not AIAMAG. */
/* On some systems, there is a slash after each member name. */
if (*p == '/')
*p = '\0';
#ifndef AIAMAG
/* If the member name starts with a space or a slash, this
is an index into the file name mappings (used by GNU ar).
Otherwise if the member name looks like #1/NUMBER the
real member name appears in the element data (used by
4.4BSD). */
if (! is_namemap
&& (name[0] == ' ' || name[0] == '/')
&& namemap != 0)
{
name = namemap + atoi (name + 1);
long_name = 1;
}
else if (name[0] == '#'
&& name[1] == '1'
&& name[2] == '/')
{
int namesize = atoi (name + 3);
/* If the member name starts with a space or a slash, this
is an index into the file name mappings (used by GNU ar).
Otherwise if the member name looks like #1/NUMBER the
real member name appears in the element data (used by
4.4BSD). */
if (! is_namemap
&& (name[0] == ' ' || name[0] == '/')
&& namemap != 0)
{
name = namemap + atoi (name + 1);
long_name = 1;
}
else if (name[0] == '#'
&& name[1] == '1'
&& name[2] == '/')
{
int namesize = atoi (name + 3);
name = alloca (namesize + 1);
nread = read (desc, name, namesize);
if (nread != namesize)
{
close (desc);
return -2;
}
name[namesize] = '\0';
name = alloca (namesize + 1);
nread = read (desc, name, namesize);
if (nread != namesize)
{
close (desc);
return -2;
}
name[namesize] = '\0';
long_name = 1;
}
long_name = 1;
}
#endif /* Not AIAMAG. */
}
}
#ifndef M_XENIX
sscanf (TOCHAR (member_header.ar_mode), "%o", &eltmode);
eltsize = atol (TOCHAR (member_header.ar_size));
#else /* Xenix. */
eltmode = (unsigned short int) member_header.ar_mode;
eltsize = member_header.ar_size;
#endif /* Not Xenix. */
#ifndef M_XENIX
sscanf (TOCHAR (member_header.ar_mode), "%o", &eltmode);
eltsize = atol (TOCHAR (member_header.ar_size));
#else /* Xenix. */
eltmode = (unsigned short int) member_header.ar_mode;
eltsize = member_header.ar_size;
#endif /* Not Xenix. */
fnval =
(*function) (desc, name, ! long_name, member_offset,
member_offset + AR_HDR_SIZE, eltsize,
#ifndef M_XENIX
atol (TOCHAR (member_header.ar_date)),
atoi (TOCHAR (member_header.ar_uid)),
atoi (TOCHAR (member_header.ar_gid)),
#else /* Xenix. */
member_header.ar_date,
member_header.ar_uid,
member_header.ar_gid,
#endif /* Not Xenix. */
eltmode, arg);
fnval =
(*function) (desc, name, ! long_name, member_offset,
member_offset + AR_HDR_SIZE, eltsize,
#ifndef M_XENIX
atol (TOCHAR (member_header.ar_date)),
atoi (TOCHAR (member_header.ar_uid)),
atoi (TOCHAR (member_header.ar_gid)),
#else /* Xenix. */
member_header.ar_date,
member_header.ar_uid,
member_header.ar_gid,
#endif /* Not Xenix. */
eltmode, arg);
#endif /* AIAMAG. */
if (fnval)
{
(void) close (desc);
return fnval;
}
if (fnval)
{
(void) close (desc);
return fnval;
}
#ifdef AIAMAG
if (member_offset == last_member_offset)
/* End of the chain. */
break;
if (member_offset == last_member_offset)
/* End of the chain. */
break;
#ifdef AIAMAGBIG
if (big_archive)
if (big_archive)
sscanf (member_header_big.ar_nxtmem, "%20ld", &member_offset);
else
else
#endif
sscanf (member_header.ar_nxtmem, "%12ld", &member_offset);
sscanf (member_header.ar_nxtmem, "%12ld", &member_offset);
if (lseek (desc, member_offset, 0) != member_offset)
{
(void) close (desc);
return -2;
}
if (lseek (desc, member_offset, 0) != member_offset)
{
(void) close (desc);
return -2;
}
#else
/* If this member maps archive names, we must read it in. The
name map will always precede any members whose names must
be mapped. */
if (is_namemap)
{
char *clear;
char *limit;
/* If this member maps archive names, we must read it in. The
name map will always precede any members whose names must
be mapped. */
if (is_namemap)
{
char *clear;
char *limit;
namemap = alloca (eltsize);
nread = read (desc, namemap, eltsize);
if (nread != eltsize)
{
(void) close (desc);
return -2;
}
namemap = alloca (eltsize);
nread = read (desc, namemap, eltsize);
if (nread != eltsize)
{
(void) close (desc);
return -2;
}
/* The names are separated by newlines. Some formats have
a trailing slash. Null terminate the strings for
convenience. */
limit = namemap + eltsize;
for (clear = namemap; clear < limit; clear++)
{
if (*clear == '\n')
{
*clear = '\0';
if (clear[-1] == '/')
clear[-1] = '\0';
}
}
/* The names are separated by newlines. Some formats have
a trailing slash. Null terminate the strings for
convenience. */
limit = namemap + eltsize;
for (clear = namemap; clear < limit; clear++)
{
if (*clear == '\n')
{
*clear = '\0';
if (clear[-1] == '/')
clear[-1] = '\0';
}
}
is_namemap = 0;
}
is_namemap = 0;
}
member_offset += AR_HDR_SIZE + eltsize;
if (member_offset % 2 != 0)
member_offset++;
member_offset += AR_HDR_SIZE + eltsize;
if (member_offset % 2 != 0)
member_offset++;
#endif
}
}
@@ -748,9 +745,9 @@ ar_name_equal (const char *name, const char *mem, int truncated)
#else
struct ar_hdr hdr;
#if !defined (__hpux) && !defined (cray)
return strneq (name, mem, sizeof(hdr.ar_name) - 1);
return strneq (name, mem, sizeof (hdr.ar_name) - 1);
#else
return strneq (name, mem, sizeof(hdr.ar_name) - 2);
return strneq (name, mem, sizeof (hdr.ar_name) - 2);
#endif /* !__hpux && !cray */
#endif /* !AIAMAG */
}
@@ -763,7 +760,7 @@ ar_name_equal (const char *name, const char *mem, int truncated)
/* ARGSUSED */
static long int
ar_member_pos (int desc UNUSED, const char *mem, int truncated,
long int hdrpos, long int datapos UNUSED, long int size UNUSED,
long int hdrpos, long int datapos UNUSED, long int size UNUSED,
long int date UNUSED, int uid UNUSED, int gid UNUSED,
int mode UNUSED, const void *name)
{
@@ -817,7 +814,7 @@ ar_member_touch (const char *arname, const char *memname)
ar_hdr.ar_date[ui] = ' ';
sprintf (TOCHAR (ar_hdr.ar_date), "%ld", (long int) statbuf.st_mtime);
#ifdef AIAMAG
ar_hdr.ar_date[strlen(ar_hdr.ar_date)] = ' ';
ar_hdr.ar_date[strlen (ar_hdr.ar_date)] = ' ';
#endif
#else
ar_hdr.ar_date = statbuf.st_mtime;
@@ -842,14 +839,14 @@ ar_member_touch (const char *arname, const char *memname)
long int
describe_member (int desc, const char *name, int truncated,
long int hdrpos, long int datapos, long int size,
long int hdrpos, long int datapos, long int size,
long int date, int uid, int gid, int mode, const void *arg)
{
extern char *ctime ();
printf (_("Member `%s'%s: %ld bytes at %ld (%ld).\n"),
name, truncated ? _(" (name might be truncated)") : "",
size, hdrpos, datapos);
printf (_("Member '%s'%s: %ld bytes at %ld (%ld).\n"),
name, truncated ? _(" (name might be truncated)") : "",
size, hdrpos, datapos);
printf (_(" Date %s"), ctime (&date));
printf (_(" uid = %d, gid = %d, mode = 0%o.\n"), uid, gid, mode);
@@ -863,5 +860,5 @@ main (int argc, char **argv)
return 0;
}
#endif /* TEST. */
#endif /* NO_ARCHIVES. */
#endif /* TEST. */
#endif /* NO_ARCHIVES. */

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-2013 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
@@ -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-2013 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
@@ -16,21 +15,84 @@ rem
rem You should have received a copy of the GNU General Public License along
rem with this program. If not, see <http://www.gnu.org/licenses/>.
if exist config.h.W32 GoTo NotCVS
sed -n "s/^AC_INIT(\[GNU make\],\[\([^]]\+\)\].*/s,%%VERSION%%,\1,g/p" configure.in > config.h.W32.sed
if "%1" == "-h" GoTo Usage
if "%1" == "--help" GoTo Usage
if not exist config.h.W32.template GoTo NotSCM
sed -n "s/^AC_INIT(\[GNU make\],\[\([^]]\+\)\].*/s,%%VERSION%%,\1,g/p" configure.ac > config.h.W32.sed
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
echo static const char *const GUILE_module_defn = ^" \> gmk-default.h
sed -e "s/;.*//" -e "/^[ \t]*$/d" -e "s/\"/\\\\\"/g" -e "s/$/ \\/" gmk-default.scm >> gmk-default.h
echo ^";>> gmk-default.h
:NotSCM
copy config.h.W32 config.h
rem Guile configuration
set GUILECFLAGS=
set GUILELIBS=
set GUILESRC=
set NOGUILE=
set OPT=-O2
set COMPILER=
set PKGMSC=
:ParseSW
if "%1" == "--debug" GoTo SetOpt
if "%1" == "--without-guile" GoTo NoGuile
if "%1" == "gcc" GoTo SetCC
if "%1" == "" GoTo ChkGuile
:SetOpt
set OPT=-O0
shift
GoTo ParseSW
:NoGuile
set NOGUILE=Y
echo "Building without Guile"
shift
GoTo ParseSW
:SetCC
set COMPILER=gcc
echo "Building with GCC"
shift
GoTo ParseSW
rem Build with Guile is supported only on NT and later versions
:ChkGuile
if "%NOGUILE%" == "Y" GoTo GuileDone
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 "%COMPILER%" == "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 GuileDone
:NoPkgCfg
echo "pkg-config not found, building without Guile"
:GuileDone
if not "%GUILECFLAGS%" == "" echo "Guile found, building with Guile"
if not "%GUILECFLAGS%" == "" set GUILESRC=guile.c
if not "%GUILECFLAGS%" == "" set GUILECFLAGS=%GUILECFLAGS% -DHAVE_GUILE
if "%COMPILER%" == "gcc" if "%OPT%" == "-O0" echo "Building without compiler optimizations"
cd w32\subproc
echo.
echo "Creating the subproc library"
%ComSpec% /c build.bat %1
%ComSpec% /c build.bat
cd ..\..
if exist link.dbg del link.dbg
if exist link.rel del link.rel
echo "Creating GNU Make for Windows 9X/NT/2K/XP"
if "%1" == "gcc" GoTo GCCBuild
echo.
echo "Creating GNU Make for Windows 9X/NT/2K/XP/Vista/7/8"
if "%COMPILER%" == "gcc" GoTo GCCBuild
set make=gnumake
echo on
if not exist .\WinDebug\nul mkdir .\WinDebug
@@ -54,12 +116,14 @@ 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
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 job.c
echo WinDebug\job.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 output.c
echo WinDebug\output.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 read.c
echo WinDebug\read.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 version.c
@@ -84,18 +148,28 @@ cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D
echo WinDebug\vpath.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 implicit.c
echo WinDebug\implicit.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 loadapi.c
echo WinDebug\loadapi.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 load.c
echo WinDebug\load.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\compat\dirent.c
echo WinDebug\dirent.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\compat\posixfcn.c
echo WinDebug\posixfcn.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 .\glob\glob.c
echo WinDebug\glob.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 .\glob\fnmatch.c
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/output.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,12 +195,14 @@ 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
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 job.c
echo WinRel\job.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 output.c
echo WinRel\output.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 read.c
echo WinRel\read.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 version.c
@@ -151,18 +227,28 @@ cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIND
echo WinRel\vpath.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 implicit.c
echo WinRel\implicit.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 loadapi.c
echo WinRel\loadapi.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 load.c
echo WinRel\load.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\compat\dirent.c
echo WinRel\dirent.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\compat\posixfcn.c
echo WinRel\posixfcn.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 .\glob\glob.c
echo WinRel\glob.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 .\glob\fnmatch.c
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/output.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!"
@@ -170,34 +256,66 @@ set make=
GoTo BuildEnd
:GCCBuild
echo on
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c variable.c
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c rule.c
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c remote-stub.c
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c commands.c
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c file.c
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c getloadavg.c
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c default.c
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 -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
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c version.c
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c getopt.c
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c arscan.c
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c remake.c
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c hash.c
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c strcache.c
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c misc.c
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ar.c
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c function.c
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c vpath.c
gcc -mthreads -Wall -gdwarf-2 -g3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c implicit.c
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
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c variable.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c rule.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c remote-stub.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c commands.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c file.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c getloadavg.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c default.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c signame.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c expand.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c dir.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H %GUILECFLAGS% -c main.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c getopt1.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c job.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c output.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c read.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c version.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c getopt.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c arscan.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c remake.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c hash.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c strcache.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c misc.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ar.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c function.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c vpath.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c implicit.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c loadapi.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c load.c
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./glob/glob.c -o glob.o
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./glob/fnmatch.c -o fnmatch.o
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./w32/pathstuff.c -o pathstuff.o
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./w32/compat/posixfcn.c -o posixfcn.o
@echo off
set GUILEOBJ=
if "%GUILESRC%" == "" GoTo LinkGCC
set GUILEOBJ=guile.o
echo on
gcc -mthreads -Wall -gdwarf-2 -g3 %OPT% %GUILECFLAGS% -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c guile.c
:LinkGCC
@echo off
Rem The version NN of libgnumake-NN.dll.a should be bumped whenever
Rem the API changes in binary-incompatible manner.
@echo on
gcc -mthreads -gdwarf-2 -g3 -o gnumake.exe variable.o rule.o remote-stub.o commands.o file.o getloadavg.o default.o signame.o expand.o dir.o main.o getopt1.o %GUILEOBJ% job.o output.o read.o version.o getopt.o arscan.o remake.o misc.o hash.o strcache.o ar.o function.o vpath.o implicit.o loadapi.o load.o glob.o fnmatch.o pathstuff.o posixfcn.o w32_misc.o sub_proc.o w32err.o %GUILELIBS% -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -Wl,--out-implib=libgnumake-1.dll.a
@GoTo BuildEnd
:Usage
echo Usage: %0 [options] [gcc]
echo Options:
echo. --debug For GCC only, make a debug build
echo. (MSVC build always makes both debug and release)
echo. --without-guile Do not compile Guile support even if found
echo. --help Display these instructions and exit
:BuildEnd
@echo off
set GUILEOBJ=
set GUILESRC=
set GUILELIBS=
set GUILECFLAGS=
set PKGMSC=
set OPT=
set COMPILER=
set NOGUILE=
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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -16,9 +14,11 @@ 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 "dep.h"
#include <dlfcn.h>
#include "makeint.h"
#include "filedef.h"
#include "dep.h"
#include "variable.h"
#include "job.h"
#include "commands.h"
@@ -35,7 +35,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
int remote_kill (int id, int sig);
#ifndef HAVE_UNISTD_H
#ifndef HAVE_UNISTD_H
int getpid ();
#endif
@@ -70,9 +70,9 @@ set_file_variables (struct file *file)
struct dep *d;
const char *at, *percent, *star, *less;
#ifndef NO_ARCHIVES
/* If the target is an archive member `lib(member)',
then $@ is `lib' and $% is `member'. */
#ifndef NO_ARCHIVES
/* If the target is an archive member 'lib(member)',
then $@ is 'lib' and $% is 'member'. */
if (ar_name (file->name))
{
@@ -92,7 +92,7 @@ set_file_variables (struct file *file)
percent = p;
}
else
#endif /* NO_ARCHIVES. */
#endif /* NO_ARCHIVES. */
{
at = file->name;
percent = "";
@@ -102,35 +102,35 @@ set_file_variables (struct file *file)
if (file->stem == 0)
{
/* 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. */
any suffix in the .SUFFIXES list stripped off for
explicit rules. We store this in the 'stem' member. */
const char *name;
unsigned int len;
#ifndef NO_ARCHIVES
#ifndef NO_ARCHIVES
if (ar_name (file->name))
{
name = strchr (file->name, '(') + 1;
len = strlen (name) - 1;
}
{
name = strchr (file->name, '(') + 1;
len = strlen (name) - 1;
}
else
#endif
{
name = file->name;
len = strlen (name);
}
{
name = file->name;
len = strlen (name);
}
for (d = enter_file (strcache_add (".SUFFIXES"))->deps; d ; d = d->next)
{
unsigned int slen = strlen (dep_name (d));
if (len > slen && strneq (dep_name (d), name + (len - slen), slen))
{
file->stem = strcache_add_len (name, len - slen);
break;
}
}
{
unsigned int slen = strlen (dep_name (d));
if (len > slen && strneq (dep_name (d), name + (len - slen), slen))
{
file->stem = strcache_add_len (name, len - slen);
break;
}
}
if (d == 0)
file->stem = "";
file->stem = "";
}
star = file->stem;
@@ -149,7 +149,7 @@ set_file_variables (struct file *file)
In this case $< is the same as $@. */
less = at;
#define DEFINE_VARIABLE(name, len, value) \
#define DEFINE_VARIABLE(name, len, value) \
(void) define_variable_for_file (name,len,value,o_automatic,0,file)
/* Define the variables. */
@@ -202,13 +202,13 @@ set_file_variables (struct file *file)
cp = plus_value;
qmark_len = plus_len + 1; /* Will be this or less. */
qmark_len = plus_len + 1; /* Will be this or less. */
for (d = file->deps; d != 0; d = d->next)
if (! d->ignore_mtime && ! d->need_2nd_expansion)
{
const char *c = dep_name (d);
#ifndef NO_ARCHIVES
#ifndef NO_ARCHIVES
if (ar_name (c))
{
c = strchr (c, '(') + 1;
@@ -222,7 +222,7 @@ set_file_variables (struct file *file)
cp += len;
*cp++ = FILE_LIST_SEPARATOR;
if (! (d->changed || always_make_flag))
qmark_len -= len + 1; /* Don't space in $? for this one. */
qmark_len -= len + 1; /* Don't space in $? for this one. */
}
/* Kill the last space and define the variable. */
@@ -277,23 +277,23 @@ set_file_variables (struct file *file)
continue;
c = dep_name (d);
#ifndef NO_ARCHIVES
#ifndef NO_ARCHIVES
if (ar_name (c))
{
c = strchr (c, '(') + 1;
len = strlen (c) - 1;
}
else
{
c = strchr (c, '(') + 1;
len = strlen (c) - 1;
}
else
#endif
len = strlen (c);
len = strlen (c);
if (d->ignore_mtime)
{
memcpy (bp, c, len);
bp += len;
*bp++ = FILE_LIST_SEPARATOR;
}
else
bp += len;
*bp++ = FILE_LIST_SEPARATOR;
}
else
{
memcpy (cp, c, len);
cp += len;
@@ -321,11 +321,11 @@ set_file_variables (struct file *file)
DEFINE_VARIABLE ("|", 1, bar_value);
}
#undef DEFINE_VARIABLE
#undef DEFINE_VARIABLE
}
/* 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 +402,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 +436,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;
}
}
@@ -456,7 +459,7 @@ execute_file_commands (struct file *file)
{
/* If there are no commands, assume everything worked. */
set_command_state (file, cs_running);
file->update_status = 0;
file->update_status = us_success;
notice_finished_file (file);
return;
}
@@ -467,6 +470,11 @@ execute_file_commands (struct file *file)
set_file_variables (file);
/* If this is a loaded dynamic object, unload it before remaking.
Some systems don't support overwriting a loaded object. */
if (file->loaded)
unload_file (file->name);
/* Start the commands running. */
new_job (file);
}
@@ -511,14 +519,14 @@ fatal_error_signal (int sig)
DWORD susp_count = SuspendThread (main_thread);
if (susp_count != 0)
fprintf (stderr, "SuspendThread: suspend count = %ld\n", susp_count);
fprintf (stderr, "SuspendThread: suspend count = %ld\n", susp_count);
else if (susp_count == (DWORD)-1)
{
DWORD ierr = GetLastError ();
{
DWORD ierr = GetLastError ();
fprintf (stderr, "SuspendThread: error %ld: %s\n",
ierr, map_windows32_error_to_string (ierr));
}
fprintf (stderr, "SuspendThread: error %ld: %s\n",
ierr, map_windows32_error_to_string (ierr));
}
}
#endif
handling_fatal_signal = 1;
@@ -534,8 +542,8 @@ fatal_error_signal (int sig)
{
struct child *c;
for (c = children; c != 0; c = c->next)
if (!c->remote)
(void) kill (c->pid, SIGTERM);
if (!c->remote)
(void) kill (c->pid, SIGTERM);
}
/* If we got a signal that means the user
@@ -553,18 +561,18 @@ fatal_error_signal (int sig)
struct child *c;
/* Remote children won't automatically get signals sent
to the process group, so we must send them. */
to the process group, so we must send them. */
for (c = children; c != 0; c = c->next)
if (c->remote)
(void) remote_kill (c->pid, sig);
if (c->remote)
(void) remote_kill (c->pid, sig);
for (c = children; c != 0; c = c->next)
delete_child_targets (c);
delete_child_targets (c);
/* Clean up the children. We don't just use the call below because
we don't want to print the "Waiting for children" message. */
we don't want to print the "Waiting for children" message. */
while (job_slots_used > 0)
reap_children (1, 0);
reap_children (1, 0);
}
else
/* Wait for our children to die. */
@@ -614,17 +622,17 @@ delete_target (struct file *file, const char *on_behalf_of)
if (ar_name (file->name))
{
time_t file_date = (file->last_mtime == NONEXISTENT_MTIME
? (time_t) -1
: (time_t) FILE_TIMESTAMP_S (file->last_mtime));
? (time_t) -1
: (time_t) FILE_TIMESTAMP_S (file->last_mtime));
if (ar_member_date (file->name) != file_date)
{
if (on_behalf_of)
error (NILF, _("*** [%s] Archive member `%s' may be bogus; not deleted"),
on_behalf_of, file->name);
else
error (NILF, _("*** Archive member `%s' may be bogus; not deleted"),
file->name);
}
{
if (on_behalf_of)
error (NILF, _("*** [%s] Archive member '%s' may be bogus; not deleted"),
on_behalf_of, file->name);
else
error (NILF, _("*** Archive member '%s' may be bogus; not deleted"),
file->name);
}
return;
}
#endif
@@ -635,12 +643,12 @@ 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);
&& errno != ENOENT) /* It disappeared; so what. */
perror_with_name ("unlink: ", file->name);
}
}
@@ -659,7 +667,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 +686,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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -21,19 +19,20 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
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 */
/* the COMMANDS_RECURSE bit set. */
gmk_floc fileinfo; /* Where commands were defined. */
char *commands; /* Commands text. */
char **command_lines; /* Commands chopped up into lines. */
char *lines_flags; /* One set of flag bits for each line. */
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'. */
#define COMMANDS_RECURSE 1 /* Recurses: + or $(MAKE). */
#define COMMANDS_SILENT 2 /* Silent: @. */
#define COMMANDS_NOERROR 4 /* No errors: -. */
/* Bits in 'lines_flags'. */
#define COMMANDS_RECURSE 1 /* Recurses: + or $(MAKE). */
#define COMMANDS_SILENT 2 /* Silent: @. */
#define COMMANDS_NOERROR 4 /* No errors: -. */
void execute_file_commands (struct file *file);
void print_commands (const struct commands *cmds);

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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -17,7 +16,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE
/* #undef _ALL_SOURCE */
#endif
@@ -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. */
@@ -54,25 +53,25 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
/* #undef HAVE_ALLOCA_H */
/* Define if you don't have vprintf but do have _doprnt. */
/* #undef HAVE_DOPRNT */
/* 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 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
@@ -85,7 +84,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define if your struct stat has st_blocks. */
/* #undef HAVE_ST_BLOCKS */
/* Define if you have the strcoll function and it is properly defined. */
/* Define if you have the strcoll function and it is properly defined. */
#define HAVE_STRCOLL 1
/* Define if your struct stat has st_rdev. */
@@ -94,7 +93,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define if you have the strftime function. */
#define HAVE_STRFTIME 1
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
/* 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. */
@@ -110,16 +109,10 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define if utime(file, NULL) sets file's timestamp to the present. */
/* #undef HAVE_UTIME_NULL */
/* Define if you have <vfork.h>. */
/* #undef HAVE_VFORK_H */
/* Define if you have the vprintf function. */
#define HAVE_VPRINTF 1
/* Define if you have the wait3 system call. */
/* #undef HAVE_WAIT3 */
/* Define if on MINIX. */
/* Define if on MINIX. */
/* #undef _MINIX */
/* Define if your struct nlist has an n_un member. */
@@ -131,7 +124,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
@@ -152,28 +145,25 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* 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.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
#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. */
#define HAVE_ANSI_COMPILER 1
/* Define if you have the ANSI C header files. */
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS
/* 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. */
@@ -183,19 +173,16 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
instead of <sys/cpustats.h>. */
/* #undef UMAX4_3 */
/* Define vfork as fork if vfork does not work. */
/* #undef vfork */
/* Name of this package (needed by automake) */
#define PACKAGE "%PACKAGE%"
/* Version of this package (needed by automake) */
#define VERSION "%VERSION%"
/* Define to the name of the SCCS `get' command. */
/* Define 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 +192,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. */
@@ -247,7 +234,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define if you have the seteuid function. */
/* #undef HAVE_SETEUID */
/* Define if you have the setlinebuf function. */
/* Define if you have the setlinebuf function. */
/* #undef HAVE_SETLINEBUF */
/* Define if you have the setregid function. */
@@ -256,7 +243,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define if you have the setreuid function. */
/* #undef HAVE_SETREUID */
/* Define if you have the sigsetmask function. */
/* Define if you have the sigsetmask function. */
/* #undef HAVE_SIGSETMASK */
/* Define if you have the socket function. */
@@ -301,9 +288,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define if you have the <ndir.h> header file. */
/* #undef HAVE_NDIR_H */
/* Define to 1 if you have the <stdarg.h> header file. */
#define HAVE_STDARG_H 1
/* Define if you have the <stdlib.h> header file. */
/* #undef HAVE_STDLIB_H */
@@ -337,6 +321,9 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define if you have the sun library (-lsun). */
/* #undef HAVE_LIBSUN */
/* Output sync sypport */
#define NO_OUTPUT_SYNC
/* Define for Case Insensitve behavior */
#define HAVE_CASE_INSENSITIVE_FS

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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -17,7 +16,7 @@ You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */
/* config.h. Generated automatically by configure. */
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* config.h.in. Generated automatically from configure.ac by autoheader. */
/* Define to 1 if on AIX 3.
System headers sometimes define this.
@@ -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. */
@@ -73,28 +75,25 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix). */
/* #undef HAVE_ALLOCA_H */
/* Define to 1 if you don't have vprintf but do have _doprnt. */
/* #undef HAVE_DOPRNT */
/* Define to 1 if you have the fdopen function. */
#define HAVE_FDOPEN 1
/* 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 +109,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 */
@@ -134,12 +138,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if utime(file, NULL) sets file's timestamp to the present. */
/* #undef HAVE_UTIME_NULL */
/* Define to 1 if you have <vfork.h>. */
/* #undef HAVE_VFORK_H */
/* Define to 1 if you have the vprintf function. */
#define HAVE_VPRINTF 1
/* Define to 1 if you have the wait3 system call. */
/* #undef HAVE_WAIT3 */
@@ -155,7 +153,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
@@ -179,13 +177,13 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* 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.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
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. */
@@ -194,10 +192,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
@@ -209,19 +207,16 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
instead of <sys/cpustats.h>. */
/* #undef UMAX4_3 */
/* Define vfork as fork if vfork does not work. */
/* #undef vfork */
/* Name of this package (needed by automake) */
#define PACKAGE "%PACKAGE%"
/* Version of this package (needed by automake) */
#define VERSION "%VERSION%"
/* Define to the name of the SCCS `get' command. */
/* Define 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 +226,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 +250,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
@@ -332,12 +324,6 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the <ndir.h> header file. */
/* #undef HAVE_NDIR_H */
/* Define to 1 if your compiler conforms to the ANSI C standard. */
#define HAVE_ANSI_COMPILER 1
/* Define to 1 if you have the <stdarg.h> header file. */
#define HAVE_STDARG_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
@@ -420,10 +406,13 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define if using alloca.c. */
/* #undef C_ALLOCA */
/* maybe this should be placed into make.h */
#if defined(__VAX) && defined(__DECC)
#define alloca(n) __ALLOCA(n)
/* maybe this should be placed into makeint.h */
#if defined(__VAX) && defined(__DECC)
#define alloca(n) __ALLOCA(n)
#endif
/* Output sync sypport */
#define NO_OUTPUT_SYNC
/* Build host information. */
#define MAKE_HOST "VMS"

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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -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,51 @@ 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 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 +106,61 @@ 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.' */
/* #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. */
/* #undef HAVE_FORK */
/* Define to 1 if you have the 'fileno' function. */
#define HAVE_FILENO 1
/* 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 +169,196 @@ 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. */
/* #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 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. */
/* #undef HAVE_WORKING_FORK */
/* 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 'load' support in GNU make. */
#define MAKE_LOAD 1
/* 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 +367,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 +391,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.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
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 +417,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 +454,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 +475,17 @@ 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
/* 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
#endif
/* 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,11 +1,11 @@
*.m4
config.*
mkinstalldirs
texinfo.tex
mdate-sh
compile
config.guess
config.rpath
config.sub
depcomp
install-sh
mdate-sh
missing
Makefile Makefile.in
texinfo.tex
*.m4
!dospaths.m4

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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the

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-2013 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
@@ -16,9 +15,4 @@
# 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
# Autoconf / automake know how to handle this directory.

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-2013 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
@@ -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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -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
@@ -77,19 +76,12 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if you have the select function. */
#define HAVE_SELECT 1
/* Define to 1 if your compiler conforms to the ANSI C standard. */
#define HAVE_ANSI_COMPILER 1
/* Define to 1 if you have the <stdarg.h> header file. */
#define HAVE_STDARG_H 1
/* Define to 1 if you have the vprintf library function. */
#undef HAVE_VPRINTF
#define HAVE_VPRINTF 1
/* 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%"
@@ -108,8 +100,8 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define to the version of this package. */
#define PACKAGE_VERSION "%VERSION%"
/* Define to 1 if the C compiler supports function prototypes. */
#define PROTOTYPES 1
/* Output sync sypport */
#define NO_OUTPUT_SYNC
/* Version number of package */
#define VERSION "%VERSION%"

519
configure.ac Normal file
View File

@@ -0,0 +1,519 @@
# Process this file with autoconf to produce a configure script.
#
# Copyright (C) 1993-2013 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 3 of the License, or (at your option) any later
# version.
#
# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
AC_INIT([GNU make],[3.99.93],[bug-make@gnu.org])
AC_PREREQ([2.62])
# Autoconf setup
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_SRCDIR([vpath.c])
AC_CONFIG_HEADERS([config.h])
# Automake setup
AM_INIT_AUTOMAKE([1.11.1 silent-rules])
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PROG_CPP
AC_CHECK_PROG([AR], [ar], [ar], [ar])
# Perl is needed for the test suite (only)
AC_CHECK_PROG([PERL], [perl], [perl], [perl])
# Specialized system macros
AC_CANONICAL_HOST
AC_AIX
AC_ISC_POSIX
AC_MINIX
# Enable gettext, in "external" mode.
AM_GNU_GETTEXT_VERSION([0.18.1])
AM_GNU_GETTEXT([external])
# This test must come as early as possible after the compiler configuration
# tests, because the choice of the file model can (in principle) affect
# whether functions and headers are available, whether they work, etc.
AC_SYS_LARGEFILE
# Checks for libraries.
AC_SEARCH_LIBS([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])
AM_PROG_CC_C_O
AC_C_CONST
AC_TYPE_SIGNAL
AC_TYPE_UID_T
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>.])
])
# Find out whether our struct stat returns nanosecond resolution timestamps.
AC_STRUCT_ST_MTIM_NSEC
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])
])])
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.])
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])
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.])
])
])
# Check for DOS-style pathnames.
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_cv_func_gettimeofday=no
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/time.h>
int main ()
{
struct timeval t; t.tv_sec = -1; t.tv_usec = -1;
exit (gettimeofday (&t, 0) != 0
|| t.tv_sec < 0 || t.tv_usec < 0);
}]])],
[ac_cv_func_gettimeofday=yes],
[ac_cv_func_gettimeofday=no],
[ac_cv_func_gettimeofday="no (cross-compiling)"])])
AS_IF([test "$ac_cv_func_gettimeofday" = yes],
[ AC_DEFINE([HAVE_GETTIMEOFDAY], [1],
[Define to 1 if you have a standard gettimeofday function])
])
AC_CHECK_FUNCS([strdup strndup mkstemp mktemp fdopen fileno \
dup dup2 getcwd realpath sigsetmask sigaction \
getgroups seteuid setegid setlinebuf setreuid setregid \
getrlimit setrlimit setvbuf pipe strerror strsignal \
lstat readlink atexit])
# 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], [], [], [[#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])
# strcoll() is used by the GNU glob library
AC_FUNC_STRCOLL
AC_FUNC_ALLOCA
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.
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])
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.])
])
])
AC_CHECK_DECLS([sys_siglist, _sys_siglist, __sys_siglist], , ,
[AC_INCLUDES_DEFAULT
#include <signal.h>
/* NetBSD declares sys_siglist in unistd.h. */
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
])
# Check out the wait reality.
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
/* Some POSIXoid systems have both the new-style macros and the old
union wait type, and they do not work together. If union wait
conflicts with WEXITSTATUS et al, we don't want to use it at all. */
if (WEXITSTATUS (status) != 0) pid = -1;
#ifdef WTERMSIG
/* If we have WEXITSTATUS and WTERMSIG, just use them on ints. */
-- blow chunks here --
#endif
#endif
#ifdef HAVE_WAITPID
/* Make sure union wait works with waitpid. */
pid = waitpid (-1, &status, 0);
#endif
]])],
[make_cv_union_wait=yes],
[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.
AS_IF([test "$PATH_SEPARATOR" = ';'],
[ AC_DEFINE([HAVE_DOS_PATHS], [1],
[Define to 1 if your system requires backslashes or drive specs in pathnames.])
])
# See if the user wants to use pmake's "customs" distributed build capability
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])],
[ 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])
# 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],
AC_HELP_STRING([--enable-case-insensitive-file-system],
[assume file systems are case insensitive]),
[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_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"])
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_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]],
[[return SA_RESTART;]])],
[make_cv_sa_restart=yes],
[make_cv_sa_restart=no])])
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.])
])
# 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])
# 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([AC_LANG_SOURCE([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([AC_LANG_SOURCE([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.
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], [
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.
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_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>
#define GLOB_INTERFACE_VERSION 1
#if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
# include <gnu-versions.h>
# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION
gnu glob
# endif
#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
])
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])
# Let the makefile know what our build host is
AC_DEFINE_UNQUOTED([MAKE_HOST],["$host"],[Build host information.])
MAKE_HOST="$host"
AC_SUBST([MAKE_HOST])
w32_target_env=no
AM_CONDITIONAL([WINDOWSENV], [false])
AS_CASE([$host],
[*-*-mingw32],
[AM_CONDITIONAL([WINDOWSENV], [true])
w32_target_env=yes
AC_DEFINE([WINDOWS32], [1], [Use platform specific coding])
AC_DEFINE([HAVE_DOS_PATHS], [1], [Use platform specific coding])
])
AC_DEFINE_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
AS_IF([test -r "$srcdir/maintMakefile"],
[ MAINT_MAKEFILE="$srcdir/maintMakefile"
])
AC_SUBST_FILE([MAINT_MAKEFILE])
# Allow building with dmalloc
AM_WITH_DMALLOC
# Forcibly disable SET_MAKE. If it's set it breaks things like the test
# scripts, etc.
SET_MAKE=
# Sanity check and inform the user of what we found
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
])
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
])])
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
])
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])
# OK, do it!
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.
AS_IF([test -f "$srcdir/build.sh.in"],
[ ./config.status --file build.sh
chmod +x build.sh
])
dnl Local Variables:
dnl comment-start: "dnl "
dnl comment-end: ""
dnl comment-start-skip: "\\bdnl\\b\\s *"
dnl compile-command: "make configure config.h.in"
dnl End:

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-2013 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,478 +0,0 @@
# 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.
# 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/>.
AC_INIT([GNU make],[3.82],[bug-make@gnu.org])
AC_PREREQ(2.59)
AC_REVISION([[$Id$]])
# Autoconf setup
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR(vpath.c)
AC_CONFIG_HEADERS(config.h)
# Automake setup
AM_INIT_AUTOMAKE([1.9])
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PROG_CPP
AC_CHECK_PROG(AR, ar, ar, ar)
# Perl is needed for the test suite (only)
AC_CHECK_PROG(PERL, perl, perl, perl)
# Specialized system macros
AC_CANONICAL_HOST
AC_AIX
AC_ISC_POSIX
AC_MINIX
# Enable gettext, in "external" mode.
AM_GNU_GETTEXT_VERSION(0.14.1)
AM_GNU_GETTEXT([external])
# This test must come as early as possible after the compiler configuration
# tests, because the choice of the file model can (in principle) affect
# whether functions and headers are available, whether they work, etc.
AC_SYS_LARGEFILE
# Checks for libraries.
AC_SEARCH_LIBS(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)
# 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
# Determine what kind of variadic function calls we support
AC_CHECK_HEADERS(stdarg.h varargs.h, break)
AM_PROG_CC_C_O
AC_C_CONST
AC_TYPE_SIGNAL
AC_TYPE_UID_T
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>.])])
# 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]],
[[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,
[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.
# 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,
[Define to 1 if you have the clock_gettime function.])
fi
fi
# Check for DOS-style pathnames.
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_cv_func_gettimeofday=no
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/time.h>
int main ()
{
struct timeval t; t.tv_sec = -1; t.tv_usec = -1;
exit (gettimeofday (&t, 0) != 0
|| t.tv_sec < 0 || t.tv_usec < 0);
}]])],
[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,
[Define to 1 if you have a standard gettimeofday function])
fi
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)
# 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_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)
# strcoll() is used by the GNU glob library
AC_FUNC_STRCOLL
AC_FUNC_ALLOCA
AC_FUNC_FORK([])
AC_FUNC_VPRINTF
AC_FUNC_CLOSEDIR_VOID
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>]],
[[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,
[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
#include <signal.h>
/* NetBSD declares sys_siglist in unistd.h. */
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
])
# 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>
#include <sys/wait.h>]],
[[union wait status; int pid; pid = wait (&status);
#ifdef WEXITSTATUS
/* Some POSIXoid systems have both the new-style macros and the old
union wait type, and they do not work together. If union wait
conflicts with WEXITSTATUS et al, we don't want to use it at all. */
if (WEXITSTATUS (status) != 0) pid = -1;
#ifdef WTERMSIG
/* If we have WEXITSTATUS and WTERMSIG, just use them on ints. */
-- blow chunks here --
#endif
#endif
#ifdef HAVE_WAITPID
/* Make sure union wait works with waitpid. */
pid = waitpid (-1, &status, 0);
#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)
# 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,
[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
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])
# Tell automake about this, so it can include the right .c files.
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,
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])
# See if we can handle the job server feature, and if the user wants it.
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
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,
[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
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
# 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
# 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"],
[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
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,[
#include <features.h>
#include <glob.h>
#include <fnmatch.h>
#define GLOB_INTERFACE_VERSION 1
#if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
# include <gnu-versions.h>
# 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'
GLOBLIB=glob/libglob.a
fi
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)
# Let the makefile know what our build host is
AC_DEFINE_UNQUOTED(MAKE_HOST,"$host",[Build host information.])
MAKE_HOST="$host"
AC_SUBST(MAKE_HOST)
w32_target_env=no
AM_CONDITIONAL([WINDOWSENV], false)
case "$host" in
*-*-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.])
# 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)
# Allow building with dmalloc
AM_WITH_DMALLOC
# Forcibly disable SET_MAKE. If it's set it breaks things like the test
# scripts, etc.
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
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
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
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
# Specify what files are to be created.
AC_CONFIG_FILES(Makefile glob/Makefile po/Makefile.in config/Makefile doc/Makefile w32/Makefile)
# OK, do it!
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
chmod +x build.sh
fi
dnl Local Variables:
dnl comment-start: "dnl "
dnl comment-end: ""
dnl comment-start-skip: "\\bdnl\\b\\s *"
dnl compile-command: "make configure config.h.in"
dnl End:

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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the

112
default.c
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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -16,7 +14,10 @@ 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 "makeint.h"
#include <assert.h>
#include "filedef.h"
#include "variable.h"
#include "rule.h"
@@ -32,8 +33,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 +54,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 +89,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 +294,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 +402,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 +420,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 +440,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 +450,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,25 +509,27 @@ 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 */
/* Make this assignment to avoid undefined variable warnings. */
"GNUMAKEFLAGS", "",
0, 0
};
@@ -536,15 +539,19 @@ void
set_default_suffixes (void)
{
suffix_file = enter_file (strcache_add (".SUFFIXES"));
suffix_file->builtin = 1;
if (no_builtin_rules_flag)
define_variable_cname ("SUFFIXES", "", o_default, 0);
else
{
struct dep *d;
char *p = default_suffixes;
suffix_file->deps = enter_prereqs(PARSE_FILE_SEQ (&p, struct dep, '\0',
NULL, 0),
NULL);
suffix_file->deps = enter_prereqs (PARSE_SIMPLE_SEQ (&p, struct dep),
NULL);
for (d = suffix_file->deps; d; d = d->next)
d->file->builtin = 1;
define_variable_cname ("SUFFIXES", default_suffixes, o_default, 0);
}
}
@@ -565,14 +572,14 @@ install_default_suffix_rules (void)
for (s = default_suffix_rules; *s != 0; s += 2)
{
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;
}
/* This function should run before any makefile is parsed. */
assert (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->recipe_prefix = RECIPEPREFIX_DEFAULT;
f->builtin = 1;
}
}
@@ -605,3 +612,12 @@ define_default_variables (void)
for (s = default_variables; *s != 0; s += 2)
define_variable (s[0], strlen (s[0]), s[1], o_default, 1);
}
void
undefine_default_variables (void)
{
const char **s;
for (s = default_variables; *s != 0; s += 2)
undefine_variable_global (s[0], strlen (s[0]), o_default);
}

45
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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -16,19 +14,19 @@ 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. */
#define RM_DONTCARE (1 << 2) /* No error if it doesn't exist. */
#define RM_NO_TILDE (1 << 3) /* Don't expand ~ in file name. */
#define RM_NOFLAG 0
#define RM_NO_DEFAULT_GOAL (1 << 0) /* Do not set default goal. */
#define RM_INCLUDED (1 << 1) /* Search makefile search path. */
#define RM_DONTCARE (1 << 2) /* No error if it doesn't exist. */
#define RM_NO_TILDE (1 << 3) /* Don't expand ~ in file name. */
#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. */
@@ -55,22 +53,23 @@ struct nameseq
const char *name;
};
#define PARSEFS_NONE (0x0000)
#define PARSEFS_NOSTRIP (0x0001)
#define PARSEFS_NOAR (0x0002)
#define PARSEFS_NOGLOB (0x0004)
#define PARSEFS_EXISTS (0x0008)
#define PARSEFS_NOCACHE (0x0010)
#define PARSEFS_NONE 0x0000
#define PARSEFS_NOSTRIP 0x0001
#define PARSEFS_NOAR 0x0002
#define PARSEFS_NOGLOB 0x0004
#define PARSEFS_EXISTS 0x0008
#define PARSEFS_NOCACHE 0x0010
#define PARSE_FILE_SEQ(_s,_t,_c,_p,_f) \
(_t *)parse_file_seq ((_s),sizeof (_t),(_c),(_p),(_f))
#define PARSE_SIMPLE_SEQ(_s,_t) \
(_t *)parse_file_seq ((_s),sizeof (_t),MAP_NUL,NULL,PARSEFS_NONE)
#ifdef VMS
void *parse_file_seq ();
#else
void *parse_file_seq (char **stringp, unsigned int size,
int stopchar, const char *prefix, int flags);
int stopmap, const char *prefix, int flags);
#endif
char *tilde_expand (const char *name);
@@ -89,5 +88,5 @@ struct dep *copy_dep_chain (const struct dep *d);
void free_dep_chain (struct dep *d);
void free_ns_chain (struct nameseq *n);
struct dep *read_all_makefiles (const char **makefiles);
void eval_buffer (char *buffer);
int update_goal_chain (struct dep *goals);
void eval_buffer (char *buffer, const gmk_floc *floc);
enum update_status update_goal_chain (struct dep *goals);

535
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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -16,10 +14,12 @@ 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 "makeint.h"
#include "hash.h"
#include "filedef.h"
#include "dep.h"
#ifdef HAVE_DIRENT_H
#ifdef HAVE_DIRENT_H
# include <dirent.h>
# define NAMLEN(dirent) strlen((dirent)->d_name)
# ifdef VMS
@@ -86,21 +86,21 @@ dosify (const char *filename)
df = dos_filename;
/* First, transform the name part. */
for (i = 0; *filename != '\0' && i < 8 && *filename != '.'; ++i)
for (i = 0; i < 8 && ! STOP_SET (*filename, MAP_DOT|MAP_NUL); ++i)
*df++ = tolower ((unsigned char)*filename++);
/* Now skip to the next dot. */
while (*filename != '\0' && *filename != '.')
while (! STOP_SET (*filename, MAP_DOT|MAP_NUL))
++filename;
if (*filename != '\0')
{
*df++ = *filename++;
for (i = 0; *filename != '\0' && i < 3 && *filename != '.'; ++i)
*df++ = tolower ((unsigned char)*filename++);
for (i = 0; i < 3 && ! STOP_SET (*filename, MAP_DOT|MAP_NUL); ++i)
*df++ = tolower ((unsigned char)*filename++);
}
/* Look for more dots. */
while (*filename != '\0' && *filename != '.')
while (! STOP_SET (*filename, MAP_DOT|MAP_NUL))
++filename;
if (*filename == '.')
return filename;
@@ -146,11 +146,11 @@ static int
vms_hash (const char *name)
{
int h = 0;
int g;
while (*name)
{
unsigned char uc = *name;
int g;
#ifdef HAVE_CASE_INSENSITIVE_FS
h = (h << 4) + (isupper (uc) ? tolower (uc) : uc);
#else
@@ -159,10 +159,10 @@ vms_hash (const char *name)
name++;
g = h & 0xf0000000;
if (g)
{
h = h ^ (g >> 24);
h = h ^ g;
}
{
h = h ^ (g >> 24);
h = h ^ g;
}
}
return h;
}
@@ -179,7 +179,7 @@ vmsstat_dir (const char *name, struct stat *st)
if (dir == 0)
return -1;
closedir (dir);
s = strchr (name, ':'); /* find device */
s = strchr (name, ':'); /* find device */
if (s)
{
/* to keep the compiler happy we said "const char *name", now we cheat */
@@ -204,13 +204,13 @@ vmsstat_dir (const char *name, struct stat *st)
/* Hash table of directories. */
#ifndef DIRECTORY_BUCKETS
#ifndef DIRECTORY_BUCKETS
#define DIRECTORY_BUCKETS 199
#endif
struct directory_contents
{
dev_t dev; /* Device and inode numbers of this dir. */
dev_t dev; /* Device and inode numbers of this dir. */
#ifdef WINDOWS32
/* Inode means nothing on WINDOWS32. Even file key information is
* unreliable because it is random per file open and undefined for remote
@@ -231,8 +231,8 @@ struct directory_contents
ino_t ino;
# endif
#endif /* WINDOWS32 */
struct hash_table dirfiles; /* Files in this directory. */
DIR *dirstream; /* Stream reading this directory. */
struct hash_table dirfiles; /* Files in this directory. */
DIR *dirstream; /* Stream reading this directory. */
};
static unsigned long
@@ -248,9 +248,9 @@ directory_contents_hash_1 (const void *key_0)
#else
# ifdef VMS
hash = (((unsigned int) key->dev << 4)
^ ((unsigned int) key->ino[0]
+ (unsigned int) key->ino[1]
+ (unsigned int) key->ino[2]));
^ ((unsigned int) key->ino[0]
+ (unsigned int) key->ino[1]
+ (unsigned int) key->ino[2]));
# else
hash = ((unsigned int) key->dev << 4) ^ (unsigned int) key->ino;
# endif
@@ -271,9 +271,9 @@ directory_contents_hash_2 (const void *key_0)
#else
# ifdef VMS
hash = (((unsigned int) key->dev << 4)
^ ~((unsigned int) key->ino[0]
+ (unsigned int) key->ino[1]
+ (unsigned int) key->ino[2]));
^ ~((unsigned int) key->ino[0]
+ (unsigned int) key->ino[1]
+ (unsigned int) key->ino[2]));
# else
hash = ((unsigned int) key->dev << 4) ^ (unsigned int) ~key->ino;
# endif
@@ -333,11 +333,11 @@ static struct hash_table directory_contents;
struct directory
{
const char *name; /* Name of the directory. */
const char *name; /* Name of the 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;
};
@@ -357,7 +357,7 @@ static int
directory_hash_cmp (const void *x, const void *y)
{
return_ISTRING_COMPARE (((const struct directory *) x)->name,
((const struct directory *) y)->name);
((const struct directory *) y)->name);
}
/* Table of directories hashed by name. */
@@ -374,9 +374,9 @@ static unsigned int open_directories = 0;
struct dirfile
{
const char *name; /* Name of the file. */
const char *name; /* Name of the file. */
short length;
short impossible; /* This file is impossible. */
short impossible; /* This file is impossible. */
};
static unsigned long
@@ -402,7 +402,7 @@ dirfile_hash_cmp (const void *xv, const void *yv)
return_ISTRING_COMPARE (x->name, y->name);
}
#ifndef DIRFILE_BUCKETS
#ifndef DIRFILE_BUCKETS
#define DIRFILE_BUCKETS 107
#endif
@@ -410,24 +410,15 @@ 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)
{
const char *p;
struct directory *dir;
struct directory **dir_slot;
struct directory dir_key;
int r;
#ifdef WINDOWS32
char* w32_path;
char fs_label[BUFSIZ];
char fs_type[BUFSIZ];
unsigned long fs_serno;
unsigned long fs_flags;
unsigned long fs_len;
#endif
#ifdef VMS
if ((*name == '.') && (*(name+1) == 0))
name = "[]";
@@ -441,20 +432,20 @@ find_directory (const char *name)
if (HASH_VACANT (dir))
{
struct stat st;
/* The directory was not found. Create a new entry for it. */
const char *p = name + strlen (name);
struct stat st;
int r;
p = name + strlen (name);
dir = xmalloc (sizeof (struct directory));
#if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
dir->name = strcache_add_len (downcase(name), p - name);
dir->name = strcache_add_len (downcase (name), p - name);
#else
dir->name = strcache_add_len (name, p - name);
#endif
hash_insert_at (&directories, dir, dir_slot);
/* The directory is not in the name hash table.
Find its device and inode numbers, and look it up by them. */
Find its device and inode numbers, and look it up by them. */
#ifdef VMS
r = vmsstat_dir (name, &st);
@@ -481,96 +472,101 @@ find_directory (const char *name)
if (r < 0)
{
/* Couldn't stat the directory. Mark this by
setting the `contents' member to a nil pointer. */
dir->contents = 0;
}
/* Couldn't stat the directory. Mark this by
setting the 'contents' member to a nil pointer. */
dir->contents = 0;
}
else
{
/* Search the contents hash table; device and inode are the key. */
{
/* Search the contents hash table; device and inode are the key. */
struct directory_contents *dc;
struct directory_contents **dc_slot;
struct directory_contents dc_key;
dc_key.dev = st.st_dev;
#ifdef WINDOWS32
dc_key.path_key = w32_path = w32ify (name, 1);
dc_key.ctime = st.st_ctime;
char *w32_path;
#endif
struct directory_contents *dc;
struct directory_contents **dc_slot;
struct directory_contents dc_key;
dc_key.dev = st.st_dev;
#ifdef WINDOWS32
dc_key.path_key = w32_path = w32ify (name, 1);
dc_key.ctime = st.st_ctime;
#else
# ifdef VMS
dc_key.ino[0] = st.st_ino[0];
dc_key.ino[1] = st.st_ino[1];
dc_key.ino[2] = st.st_ino[2];
dc_key.ino[0] = st.st_ino[0];
dc_key.ino[1] = st.st_ino[1];
dc_key.ino[2] = st.st_ino[2];
# else
dc_key.ino = st.st_ino;
dc_key.ino = st.st_ino;
# endif
#endif
dc_slot = (struct directory_contents **) hash_find_slot (&directory_contents, &dc_key);
dc = *dc_slot;
dc_slot = (struct directory_contents **) hash_find_slot (&directory_contents, &dc_key);
dc = *dc_slot;
if (HASH_VACANT (dc))
{
/* Nope; this really is a directory we haven't seen before. */
if (HASH_VACANT (dc))
{
/* Nope; this really is a directory we haven't seen before. */
#ifdef WINDOWS32
char fs_label[BUFSIZ];
char fs_type[BUFSIZ];
unsigned long fs_serno;
unsigned long fs_flags;
unsigned long fs_len;
#endif
dc = (struct directory_contents *)
xmalloc (sizeof (struct directory_contents));
dc = (struct directory_contents *)
xmalloc (sizeof (struct directory_contents));
/* Enter it in the contents hash table. */
dc->dev = st.st_dev;
/* Enter it in the contents hash table. */
dc->dev = st.st_dev;
#ifdef WINDOWS32
dc->path_key = xstrdup (w32_path);
dc->ctime = st.st_ctime;
dc->ctime = st.st_ctime;
dc->mtime = st.st_mtime;
/*
* NTFS is the only WINDOWS32 filesystem that bumps mtime
* on a directory when files are added/deleted from
* a directory.
*/
/* NTFS is the only WINDOWS32 filesystem that bumps mtime on a
directory when files are added/deleted from a directory. */
w32_path[3] = '\0';
if (GetVolumeInformation(w32_path,
fs_label, sizeof (fs_label),
&fs_serno, &fs_len,
&fs_flags, fs_type, sizeof (fs_type)) == FALSE)
if (GetVolumeInformation (w32_path, fs_label, sizeof (fs_label),
&fs_serno, &fs_len, &fs_flags, fs_type,
sizeof (fs_type)) == FALSE)
dc->fs_flags = FS_UNKNOWN;
else if (!strcmp(fs_type, "FAT"))
else if (!strcmp (fs_type, "FAT"))
dc->fs_flags = FS_FAT;
else if (!strcmp(fs_type, "NTFS"))
else if (!strcmp (fs_type, "NTFS"))
dc->fs_flags = FS_NTFS;
else
dc->fs_flags = FS_UNKNOWN;
#else
# ifdef VMS
dc->ino[0] = st.st_ino[0];
dc->ino[1] = st.st_ino[1];
dc->ino[2] = st.st_ino[2];
dc->ino[0] = st.st_ino[0];
dc->ino[1] = st.st_ino[1];
dc->ino[2] = st.st_ino[2];
# else
dc->ino = st.st_ino;
dc->ino = st.st_ino;
# endif
#endif /* WINDOWS32 */
hash_insert_at (&directory_contents, dc, dc_slot);
ENULLLOOP (dc->dirstream, opendir (name));
if (dc->dirstream == 0)
hash_insert_at (&directory_contents, dc, dc_slot);
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
{
hash_init (&dc->dirfiles, DIRFILE_BUCKETS,
dirfile_hash_1, dirfile_hash_2, dirfile_hash_cmp);
/* Keep track of how many directories are open. */
++open_directories;
if (open_directories == MAX_OPEN_DIRECTORIES)
/* We have too many directories open already.
Read the entire directory and then close it. */
dir_contents_file_exists_p (dc, 0);
}
}
else
{
hash_init (&dc->dirfiles, DIRFILE_BUCKETS,
dirfile_hash_1, dirfile_hash_2, dirfile_hash_cmp);
/* Keep track of how many directories are open. */
++open_directories;
if (open_directories == MAX_OPEN_DIRECTORIES)
/* We have too many directories open already.
Read the entire directory and then close it. */
dir_contents_file_exists_p (dc, 0);
}
}
/* Point the name-hashed entry for DIR at its contents data. */
dir->contents = dc;
}
/* Point the name-hashed entry for DIR at its contents data. */
dir->contents = dc;
}
}
return dir;
@@ -583,7 +579,6 @@ static int
dir_contents_file_exists_p (struct directory_contents *dir,
const char *filename)
{
unsigned int hash;
struct dirfile *df;
struct dirent *d;
#ifdef WINDOWS32
@@ -612,16 +607,15 @@ dir_contents_file_exists_p (struct directory_contents *dir,
filename = vmsify (filename,0);
#endif
hash = 0;
if (filename != 0)
{
struct dirfile dirfile_key;
if (*filename == '\0')
{
/* Checking if the directory exists. */
return 1;
}
{
/* Checking if the directory exists. */
return 1;
}
dirfile_key.name = filename;
dirfile_key.length = strlen (filename);
df = hash_find_item (&dir->dirfiles, &dirfile_key);
@@ -641,32 +635,32 @@ dir_contents_file_exists_p (struct directory_contents *dir,
* on directories (ugh!).
*/
if (dir->path_key)
{
{
if ((dir->fs_flags & FS_FAT) != 0)
{
dir->mtime = time ((time_t *) 0);
rehash = 1;
}
else if (stat (dir->path_key, &st) == 0 && st.st_mtime > dir->mtime)
{
/* reset date stamp to show most recent re-process. */
dir->mtime = st.st_mtime;
rehash = 1;
}
{
dir->mtime = time ((time_t *) 0);
rehash = 1;
}
else if (stat (dir->path_key, &st) == 0 && st.st_mtime > dir->mtime)
{
/* reset date stamp to show most recent re-process. */
dir->mtime = st.st_mtime;
rehash = 1;
}
/* If it has been already read in, all done. */
if (!rehash)
return 0;
if (!rehash)
return 0;
/* make sure directory can still be opened; if not return. */
dir->dirstream = opendir (dir->path_key);
if (!dir->dirstream)
return 0;
}
}
else
#endif
/* The directory has been all read in. */
return 0;
/* The directory has been all read in. */
return 0;
}
while (1)
@@ -693,7 +687,7 @@ dir_contents_file_exists_p (struct directory_contents *dir,
}
#endif
if (!REAL_DIR_ENTRY (d))
continue;
continue;
len = NAMLEN (d);
dirfile_key.name = d->d_name;
@@ -706,17 +700,17 @@ dir_contents_file_exists_p (struct directory_contents *dir,
*/
if (! rehash || HASH_VACANT (*dirfile_slot))
#endif
{
df = xmalloc (sizeof (struct dirfile));
{
df = xmalloc (sizeof (struct dirfile));
#if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
df->name = strcache_add_len (downcase(d->d_name), len);
df->name = strcache_add_len (downcase (d->d_name), len);
#else
df->name = strcache_add_len (d->d_name, len);
df->name = strcache_add_len (d->d_name, len);
#endif
df->length = len;
df->impossible = 0;
hash_insert_at (&dir->dirfiles, df, dirfile_slot);
}
df->length = len;
df->impossible = 0;
hash_insert_at (&dir->dirfiles, df, dirfile_slot);
}
/* Check if the name matches the one we're searching for. */
if (filename != 0 && patheq (d->d_name, filename))
return 1;
@@ -741,7 +735,7 @@ int
dir_file_exists_p (const char *dirname, const char *filename)
{
return dir_contents_file_exists_p (find_directory (dirname)->contents,
filename);
filename);
}
/* Return 1 if the file named NAME exists. */
@@ -753,7 +747,7 @@ file_exists_p (const char *name)
const char *dirname;
const char *slash;
#ifndef NO_ARCHIVES
#ifndef NO_ARCHIVES
if (ar_name (name))
return ar_member_date (name) != (time_t) -1;
#endif
@@ -769,7 +763,7 @@ file_exists_p (const char *name)
#ifdef HAVE_DOS_PATHS
/* Forward and backslashes might be mixed. We need the rightmost one. */
{
const char *bslash = strrchr(name, '\\');
const char *bslash = strrchr (name, '\\');
if (!dirend || bslash > dirend)
dirend = bslash;
/* The case of "d:file". */
@@ -794,8 +788,8 @@ file_exists_p (const char *name)
#ifdef HAVE_DOS_PATHS
/* d:/ and d: are *very* different... */
if (dirend < name + 3 && name[1] == ':' &&
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
dirend++;
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
dirend++;
#endif
p = alloca (dirend - name + 1);
memcpy (p, name, dirend - name);
@@ -805,7 +799,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. */
@@ -829,7 +823,7 @@ file_impossible (const char *filename)
# ifdef HAVE_DOS_PATHS
/* Forward and backslashes might be mixed. We need the rightmost one. */
{
const char *bslash = strrchr(p, '\\');
const char *bslash = strrchr (p, '\\');
if (!dirend || bslash > dirend)
dirend = bslash;
/* The case of "d:file". */
@@ -849,21 +843,21 @@ file_impossible (const char *filename)
const char *dirname;
const char *slash = dirend;
if (dirend == p)
dirname = "/";
dirname = "/";
else
{
{
char *cp;
#ifdef HAVE_DOS_PATHS
/* d:/ and d: are *very* different... */
if (dirend < p + 3 && p[1] == ':' &&
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
dirend++;
/* d:/ and d: are *very* different... */
if (dirend < p + 3 && p[1] == ':' &&
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
dirend++;
#endif
cp = alloca (dirend - p + 1);
memcpy (cp, p, dirend - p);
cp[dirend - p] = '\0';
cp = alloca (dirend - p + 1);
memcpy (cp, p, dirend - p);
cp[dirend - p] = '\0';
dirname = cp;
}
}
dir = find_directory (dirname);
filename = p = slash + 1;
}
@@ -876,7 +870,7 @@ file_impossible (const char *filename)
if (dir->contents->dirfiles.ht_vec == 0)
{
hash_init (&dir->contents->dirfiles, DIRFILE_BUCKETS,
dirfile_hash_1, dirfile_hash_2, dirfile_hash_cmp);
dirfile_hash_1, dirfile_hash_2, dirfile_hash_cmp);
}
/* Make a new entry and put it in the table. */
@@ -884,7 +878,7 @@ file_impossible (const char *filename)
new = xmalloc (sizeof (struct dirfile));
new->length = strlen (filename);
#if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
new->name = strcache_add_len (downcase(filename), new->length);
new->name = strcache_add_len (downcase (filename), new->length);
#else
new->name = strcache_add_len (filename, new->length);
#endif
@@ -898,7 +892,6 @@ int
file_impossible_p (const char *filename)
{
const char *dirend;
const char *p = filename;
struct directory_contents *dir;
struct dirfile *dirfile;
struct dirfile dirfile_key;
@@ -912,7 +905,7 @@ file_impossible_p (const char *filename)
#ifdef HAVE_DOS_PATHS
/* Forward and backslashes might be mixed. We need the rightmost one. */
{
const char *bslash = strrchr(filename, '\\');
const char *bslash = strrchr (filename, '\\');
if (!dirend || bslash > dirend)
dirend = bslash;
/* The case of "d:file". */
@@ -932,23 +925,23 @@ file_impossible_p (const char *filename)
const char *dirname;
const char *slash = dirend;
if (dirend == filename)
dirname = "/";
dirname = "/";
else
{
{
char *cp;
#ifdef HAVE_DOS_PATHS
/* d:/ and d: are *very* different... */
if (dirend < filename + 3 && filename[1] == ':' &&
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
dirend++;
/* d:/ and d: are *very* different... */
if (dirend < filename + 3 && filename[1] == ':' &&
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
dirend++;
#endif
cp = alloca (dirend - filename + 1);
memcpy (cp, p, dirend - p);
cp[dirend - p] = '\0';
cp = alloca (dirend - filename + 1);
memcpy (cp, filename, dirend - filename);
cp[dirend - filename] = '\0';
dirname = cp;
}
}
dir = find_directory (dirname)->contents;
p = filename = slash + 1;
filename = slash + 1;
}
if (dir == 0 || dir->dirfiles.ht_vec == 0)
@@ -956,13 +949,13 @@ file_impossible_p (const char *filename)
return 0;
#ifdef __MSDOS__
filename = dosify (p);
filename = dosify (filename);
#endif
#ifdef HAVE_CASE_INSENSITIVE_FS
filename = downcase (p);
filename = downcase (filename);
#endif
#ifdef VMS
filename = vmsify (p, 1);
filename = vmsify (filename, 1);
#endif
dirfile_key.name = filename;
@@ -1003,80 +996,80 @@ print_dir_data_base (void)
{
struct directory *dir = *dir_slot;
if (! HASH_VACANT (dir))
{
if (dir->contents == 0)
printf (_("# %s: could not be stat'd.\n"), dir->name);
else if (dir->contents->dirfiles.ht_vec == 0)
{
{
if (dir->contents == 0)
printf (_("# %s: could not be stat'd.\n"), dir->name);
else if (dir->contents->dirfiles.ht_vec == 0)
{
#ifdef WINDOWS32
printf (_("# %s (key %s, mtime %d): could not be opened.\n"),
dir->name, dir->contents->path_key,dir->contents->mtime);
printf (_("# %s (key %s, mtime %d): could not be opened.\n"),
dir->name, dir->contents->path_key,dir->contents->mtime);
#else /* WINDOWS32 */
#ifdef VMS
printf (_("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n"),
dir->name, dir->contents->dev,
dir->contents->ino[0], dir->contents->ino[1],
dir->contents->ino[2]);
printf (_("# %s (device %d, inode [%d,%d,%d]): could not be opened.\n"),
dir->name, dir->contents->dev,
dir->contents->ino[0], dir->contents->ino[1],
dir->contents->ino[2]);
#else
printf (_("# %s (device %ld, inode %ld): could not be opened.\n"),
dir->name, (long int) dir->contents->dev,
(long int) dir->contents->ino);
printf (_("# %s (device %ld, inode %ld): could not be opened.\n"),
dir->name, (long int) dir->contents->dev,
(long int) dir->contents->ino);
#endif
#endif /* WINDOWS32 */
}
else
{
unsigned int f = 0;
unsigned int im = 0;
struct dirfile **files_slot;
struct dirfile **files_end;
}
else
{
unsigned int f = 0;
unsigned int im = 0;
struct dirfile **files_slot;
struct dirfile **files_end;
files_slot = (struct dirfile **) dir->contents->dirfiles.ht_vec;
files_end = files_slot + dir->contents->dirfiles.ht_size;
for ( ; files_slot < files_end; files_slot++)
{
struct dirfile *df = *files_slot;
if (! HASH_VACANT (df))
{
if (df->impossible)
++im;
else
++f;
}
}
files_slot = (struct dirfile **) dir->contents->dirfiles.ht_vec;
files_end = files_slot + dir->contents->dirfiles.ht_size;
for ( ; files_slot < files_end; files_slot++)
{
struct dirfile *df = *files_slot;
if (! HASH_VACANT (df))
{
if (df->impossible)
++im;
else
++f;
}
}
#ifdef WINDOWS32
printf (_("# %s (key %s, mtime %d): "),
dir->name, dir->contents->path_key, dir->contents->mtime);
printf (_("# %s (key %s, mtime %d): "),
dir->name, dir->contents->path_key, dir->contents->mtime);
#else /* WINDOWS32 */
#ifdef VMS
printf (_("# %s (device %d, inode [%d,%d,%d]): "),
dir->name, dir->contents->dev,
dir->contents->ino[0], dir->contents->ino[1],
dir->contents->ino[2]);
printf (_("# %s (device %d, inode [%d,%d,%d]): "),
dir->name, dir->contents->dev,
dir->contents->ino[0], dir->contents->ino[1],
dir->contents->ino[2]);
#else
printf (_("# %s (device %ld, inode %ld): "),
dir->name,
(long)dir->contents->dev, (long)dir->contents->ino);
printf (_("# %s (device %ld, inode %ld): "),
dir->name,
(long)dir->contents->dev, (long)dir->contents->ino);
#endif
#endif /* WINDOWS32 */
if (f == 0)
fputs (_("No"), stdout);
else
printf ("%u", f);
fputs (_(" files, "), stdout);
if (im == 0)
fputs (_("no"), stdout);
else
printf ("%u", im);
fputs (_(" impossibilities"), stdout);
if (dir->contents->dirstream == 0)
puts (".");
else
puts (_(" so far."));
files += f;
impossible += im;
}
}
if (f == 0)
fputs (_("No"), stdout);
else
printf ("%u", f);
fputs (_(" files, "), stdout);
if (im == 0)
fputs (_("no"), stdout);
else
printf ("%u", im);
fputs (_(" impossibilities"), stdout);
if (dir->contents->dirstream == 0)
puts (".");
else
puts (_(" so far."));
files += f;
impossible += im;
}
}
}
fputs ("\n# ", stdout);
@@ -1145,35 +1138,35 @@ 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. */
struct dirent *d;
unsigned int len = df->length + 1;
{
/* 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;
if (sz > bufsz)
{
bufsz *= 2;
if (sz > bufsz)
bufsz = sz;
buf = xrealloc (buf, bufsz);
}
d = (struct dirent *) buf;
if (sz > bufsz)
{
bufsz *= 2;
if (sz > bufsz)
bufsz = sz;
buf = xrealloc (buf, bufsz);
}
d = (struct dirent *) buf;
#ifdef __MINGW32__
# if __MINGW32_MAJOR_VERSION < 3 || (__MINGW32_MAJOR_VERSION == 3 && \
__MINGW32_MINOR_VERSION == 0)
d->d_name = xmalloc(len);
__MINGW32_MINOR_VERSION == 0)
d->d_name = xmalloc (len);
# endif
#endif
FAKE_DIR_ENTRY (d);
FAKE_DIR_ENTRY (d);
#ifdef _DIRENT_HAVE_D_NAMLEN
d->d_namlen = len - 1;
d->d_namlen = len - 1;
#endif
#ifdef _DIRENT_HAVE_D_TYPE
d->d_type = DT_UNKNOWN;
d->d_type = DT_UNKNOWN;
#endif
memcpy (d->d_name, df->name, len);
return d;
}
memcpy (d->d_name, df->name, len);
return d;
}
}
return 0;
@@ -1183,14 +1176,17 @@ static void
ansi_free (void *p)
{
if (p)
free(p);
free (p);
}
/* On 64 bit ReliantUNIX (5.44 and above) in LFS mode, stat() is actually a
* macro for stat64(). If stat is a macro, make a local wrapper function to
* invoke it.
*
* On MS-Windows, stat() "succeeds" for foo/bar/. where foo/bar is a
* regular file; fix that here.
*/
#ifndef stat
#if !defined(stat) && !defined(WINDOWS32)
# ifndef VMS
int stat (const char *path, struct stat *sbuf);
# endif
@@ -1200,6 +1196,23 @@ static int
local_stat (const char *path, struct stat *buf)
{
int e;
#ifdef WINDOWS32
size_t plen = strlen (path);
/* Make sure the parent of "." exists and is a directory, not a
file. This is because 'stat' on Windows normalizes the argument
foo/. => foo without checking first that foo is a directory. */
if (plen > 1 && path[plen - 1] == '.'
&& (path[plen - 2] == '/' || path[plen - 2] == '\\'))
{
char parent[MAXPATHLEN];
strncpy (parent, path, plen - 2);
parent[plen - 2] = '\0';
if (stat (parent, buf) < 0 || !_S_ISDIR (buf->st_mode))
return -1;
}
#endif
EINTRLOOP (e, stat (path, buf));
return e;
@@ -1221,8 +1234,8 @@ void
hash_init_directories (void)
{
hash_init (&directories, DIRECTORY_BUCKETS,
directory_hash_1, directory_hash_2, directory_hash_cmp);
directory_hash_1, directory_hash_2, directory_hash_cmp);
hash_init (&directory_contents, DIRECTORY_BUCKETS,
directory_contents_hash_1, directory_contents_hash_2,
directory_contents_hash_1, directory_contents_hash_2,
directory_contents_hash_cmp);
}

View File

@@ -1,8 +0,0 @@
Makefile Makefile.in
version.texi fdl.texi make-stds.texi texinfo.tex
make.info*
make*.html
make.aux make.cp make.cps make.fn make.fns make.ky
make.pg make.toc make.tp make.vr make.log
make.dvi make.ps make.pdf
stamp-vti

20
doc/.gitignore vendored Normal file
View File

@@ -0,0 +1,20 @@
fdl.texi
make-stds.texi
stamp-vti
version.texi
make.info*
make*.html
make.aux
make.cp
make.cps
make.dvi
make.fn
make.fns
make.ky
make.log
make.pdf
make.pg
make.ps
make.toc
make.tp
make.vr

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-2013 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under

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-2013 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
@@ -21,6 +20,7 @@ echo Building Make for MSDOS
rem Echo ON so they will see what is going on.
@echo on
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g commands.c -o commands.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g output.c -o output.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g job.c -o job.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g dir.c -o dir.o
gcc -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g file.c -o file.o
@@ -52,9 +52,11 @@ ar rv libglob.a glob.o fnmatch.o
@echo off
cd ..
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 (job output 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.$$$

285
expand.c
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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -16,7 +14,7 @@ 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 "makeint.h"
#include <assert.h>
@@ -28,7 +26,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* Initially, any errors reported when expanding strings will be reported
against the file where the error appears. */
const struct floc **expanding_var = &reading_file;
const gmk_floc **expanding_var = &reading_file;
/* The next two describe the variable output buffer.
This buffer is used to hold the variable-expansion of a line of the
@@ -63,8 +61,8 @@ variable_buffer_output (char *ptr, const char *string, unsigned int length)
{
unsigned int offset = ptr - variable_buffer;
variable_buffer_length = (newlen + 100 > 2 * variable_buffer_length
? newlen + 100
: 2 * variable_buffer_length);
? newlen + 100
: 2 * variable_buffer_length);
variable_buffer = xrealloc (variable_buffer, variable_buffer_length);
ptr = variable_buffer + offset;
}
@@ -98,8 +96,8 @@ char *
recursively_expand_for_file (struct variable *v, struct file *file)
{
char *value;
const struct floc *this_var;
const struct floc **saved_varp;
const gmk_floc *this_var;
const gmk_floc **saved_varp;
struct variable_set_list *save = 0;
int set_reading = 0;
@@ -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,12 +195,12 @@ 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;
if (!line)
line = initialize_variable_output();
line = initialize_variable_output ();
o = line;
line_offset = line - variable_buffer;
@@ -212,133 +210,126 @@ 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)
{
/* Copy all following uninteresting chars all at once to the
variable output buffer, and skip them. Uninteresting chars end
at the next $ or the end of the input. */
at the next $ or the end of the input. */
p1 = strchr (p, '$');
o = variable_buffer_output (o, p, p1 != 0 ? (unsigned int)(p1 - p) : strlen (p) + 1);
if (p1 == 0)
break;
break;
p = p1 + 1;
/* Dispatch on the char that follows the $. */
switch (*p)
{
case '$':
/* $$ seen means output one $ to the variable output buffer. */
o = variable_buffer_output (o, p, 1);
break;
{
case '$':
/* $$ seen means output one $ to the variable output buffer. */
o = variable_buffer_output (o, p, 1);
break;
case '(':
case '{':
/* $(...) or ${...} is the general case of substitution. */
{
char openparen = *p;
char closeparen = (openparen == '(') ? ')' : '}';
case '(':
case '{':
/* $(...) or ${...} is the general case of substitution. */
{
char openparen = *p;
char closeparen = (openparen == '(') ? ')' : '}';
const char *begp;
const char *beg = p + 1;
char *op;
const char *beg = p + 1;
char *op;
char *abeg = NULL;
const char *end, *colon;
const char *end, *colon;
op = o;
begp = p;
if (handle_function (&op, &begp))
{
o = op;
p = begp;
break;
}
op = o;
begp = p;
if (handle_function (&op, &begp))
{
o = op;
p = begp;
break;
}
/* Is there a variable reference inside the parens or braces?
If so, expand it before expanding the entire reference. */
/* Is there a variable reference inside the parens or braces?
If so, expand it before expanding the entire reference. */
end = strchr (beg, closeparen);
if (end == 0)
end = strchr (beg, closeparen);
if (end == 0)
/* Unterminated variable reference. */
fatal (*expanding_var, _("unterminated variable reference"));
p1 = lindex (beg, end, '$');
if (p1 != 0)
{
/* BEG now points past the opening paren or brace.
Count parens or braces until it is matched. */
int count = 0;
for (p = beg; *p != '\0'; ++p)
{
if (*p == openparen)
++count;
else if (*p == closeparen && --count < 0)
break;
}
/* 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)'. */
if (count < 0)
{
abeg = expand_argument (beg, p); /* Expand the name. */
beg = abeg;
end = strchr (beg, '\0');
}
}
else
/* Advance P to the end of this reference. After we are
p1 = lindex (beg, end, '$');
if (p1 != 0)
{
/* BEG now points past the opening paren or brace.
Count parens or braces until it is matched. */
int count = 0;
for (p = beg; *p != '\0'; ++p)
{
if (*p == openparen)
++count;
else if (*p == closeparen && --count < 0)
break;
}
/* 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)'. */
if (count < 0)
{
abeg = expand_argument (beg, p); /* Expand the name. */
beg = abeg;
end = strchr (beg, '\0');
}
}
else
/* Advance P to the end of this reference. After we are
finished expanding this one, P will be incremented to
continue the scan. */
p = end;
p = end;
/* This is not a reference to a built-in function and
any variable references inside are now expanded.
Is the resultant text a substitution reference? */
/* This is not a reference to a built-in function and
any variable references inside are now expanded.
Is the resultant text a substitution reference? */
colon = lindex (beg, end, ':');
if (colon)
{
/* This looks like a substitution reference: $(FOO:A=B). */
const char *subst_beg, *subst_end, *replace_beg, *replace_end;
colon = lindex (beg, end, ':');
if (colon)
{
/* This looks like a substitution reference: $(FOO:A=B). */
const char *subst_beg = colon + 1;
const char *subst_end = lindex (subst_beg, end, '=');
if (subst_end == 0)
/* There is no = in sight. Punt on the substitution
reference and treat this as a variable name containing
a colon, in the code below. */
colon = 0;
else
{
const char *replace_beg = subst_end + 1;
const char *replace_end = end;
subst_beg = colon + 1;
subst_end = lindex (subst_beg, end, '=');
if (subst_end == 0)
/* There is no = in sight. Punt on the substitution
reference and treat this as a variable name containing
a colon, in the code below. */
colon = 0;
else
{
replace_beg = subst_end + 1;
replace_end = end;
/* Extract the variable name before the colon
and look up that variable. */
v = lookup_variable (beg, colon - beg);
if (v == 0)
warn_undefined (beg, colon - beg);
/* Extract the variable name before the colon
and look up that variable. */
v = lookup_variable (beg, colon - beg);
if (v == 0)
warn_undefined (beg, colon - beg);
/* If the variable is not empty, perform the
substitution. */
if (v != 0 && *v->value != '\0')
{
char *pattern, *replace, *ppercent, *rpercent;
char *value = (v->recursive
if (v != 0 && *v->value != '\0')
{
char *pattern, *replace, *ppercent, *rpercent;
char *value = (v->recursive
? recursively_expand (v)
: v->value);
: v->value);
/* Copy the pattern and the replacement. Add in an
extra % at the beginning to use in case there
@@ -356,15 +347,15 @@ variable_expand_string (char *line, const char *string, long length)
/* Look for %. Set the percent pointers properly
based on whether we find one or not. */
ppercent = find_percent (pattern);
if (ppercent)
ppercent = find_percent (pattern);
if (ppercent)
{
++ppercent;
rpercent = find_percent (replace);
if (rpercent)
++rpercent;
}
else
else
{
ppercent = pattern;
rpercent = replace;
@@ -375,64 +366,63 @@ variable_expand_string (char *line, const char *string, long length)
o = patsubst_expand_pat (o, value, pattern, replace,
ppercent, rpercent);
if (v->recursive)
free (value);
}
}
}
if (v->recursive)
free (value);
}
}
}
if (colon == 0)
/* This is an ordinary variable reference.
Look up the value of the variable. */
o = reference_variable (o, beg, end - beg);
if (colon == 0)
/* This is an ordinary variable reference.
Look up the value of the variable. */
o = reference_variable (o, beg, end - beg);
if (abeg)
free (abeg);
}
break;
if (abeg)
free (abeg);
}
break;
case '\0':
break;
case '\0':
break;
default:
if (isblank ((unsigned char)p[-1]))
break;
default:
if (isblank ((unsigned char)p[-1]))
break;
/* A $ followed by a random char is a variable reference:
$a is equivalent to $(a). */
/* A $ followed by a random char is a variable reference:
$a is equivalent to $(a). */
o = reference_variable (o, p, 1);
break;
}
break;
}
if (*p == '\0')
break;
break;
++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. */
char *
variable_expand (const char *line)
{
return variable_expand_string(NULL, line, (long)-1);
return variable_expand_string (NULL, line, (long)-1);
}
/* 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 *
@@ -442,7 +432,7 @@ expand_argument (const char *str, const char *end)
char *r;
if (str == end)
return xstrdup("");
return xstrdup ("");
if (!end || *end == '\0')
return allocated_variable_expand (str);
@@ -471,7 +461,7 @@ variable_expand_for_file (const char *line, struct file *file)
{
char *result;
struct variable_set_list *savev;
const struct floc *savef;
const gmk_floc *savef;
if (file == 0)
return variable_expand (line);
@@ -499,10 +489,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 +503,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 +540,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;

278
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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -16,12 +14,12 @@ 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 "makeint.h"
#include <assert.h>
#include "dep.h"
#include "filedef.h"
#include "dep.h"
#include "job.h"
#include "commands.h"
#include "variable.h"
@@ -56,11 +54,11 @@ static int
file_hash_cmp (const void *x, const void *y)
{
return_ISTRING_COMPARE (((struct file const *) x)->hname,
((struct file const *) y)->hname);
((struct file const *) y)->hname);
}
#ifndef FILE_BUCKETS
#define FILE_BUCKETS 1007
#ifndef FILE_BUCKETS
#define FILE_BUCKETS 1007
#endif
static struct hash_table files;
@@ -105,20 +103,20 @@ lookup_file (const char *name)
#endif
while (name[0] == '.'
#ifdef HAVE_DOS_PATHS
&& (name[1] == '/' || name[1] == '\\')
&& (name[1] == '/' || name[1] == '\\')
#else
&& name[1] == '/'
&& name[1] == '/'
#endif
&& name[2] != '\0')
&& name[2] != '\0')
{
name += 2;
while (*name == '/'
#ifdef HAVE_DOS_PATHS
|| *name == '\\'
|| *name == '\\'
#endif
)
/* Skip following slashes: ".//foo" is "foo", not "/foo". */
++name;
)
/* Skip following slashes: ".//foo" is "foo", not "/foo". */
++name;
}
if (*name == '\0')
@@ -155,7 +153,7 @@ enter_file (const char *name)
struct file file_key;
assert (*name != '\0');
assert (strcache_iscached (name));
assert (! verify_flag || strcache_iscached (name));
#if defined(VMS) && !defined(WANT_CASE_SENSITIVE_TARGETS)
if (*name != '.')
@@ -179,11 +177,14 @@ enter_file (const char *name)
file_slot = (struct file **) hash_find_slot (&files, &file_key);
f = *file_slot;
if (! HASH_VACANT (f) && !f->double_colon)
return f;
{
f->builtin = 0;
return f;
}
new = xcalloc (sizeof (struct file));
new->name = new->hname = name;
new->update_status = -1;
new->update_status = us_none;
if (HASH_VACANT (f))
{
@@ -202,7 +203,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
@@ -215,6 +216,7 @@ rehash_file (struct file *from_file, const char *to_hname)
struct file *f;
/* If it's already that name, we're done. */
from_file->builtin = 0;
file_key.hname = to_hname;
if (! file_hash_cmp (from_file, &file_key))
return;
@@ -264,18 +266,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 +297,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;
@@ -320,14 +322,16 @@ rehash_file (struct file *from_file, const char *to_hname)
MERGE (is_target);
MERGE (cmd_target);
MERGE (phony);
MERGE (loaded);
MERGE (ignore_vpath);
#undef MERGE
to_file->builtin = 0;
from_file->renamed = to_file;
}
/* 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
@@ -365,52 +369,52 @@ remove_intermediates (int sig)
for ( ; file_slot < file_end; file_slot++)
if (! HASH_VACANT (*file_slot))
{
struct file *f = *file_slot;
struct file *f = *file_slot;
/* Is this file eligible for automatic deletion?
Yes, IFF: it's marked intermediate, it's not secondary, it wasn't
given on the command line, and it's either a -include makefile or
it's not precious. */
if (f->intermediate && (f->dontcare || !f->precious)
&& !f->secondary && !f->cmd_target)
{
int status;
if (f->update_status == -1)
/* If nothing would have created this file yet,
don't print an "rm" command for it. */
continue;
if (just_print_flag)
status = 0;
else
{
status = unlink (f->name);
if (status < 0 && errno == ENOENT)
continue;
}
if (!f->dontcare)
{
if (sig)
error (NILF, _("*** Deleting intermediate file `%s'"), f->name);
else
{
if (! doneany)
DB (DB_BASIC, (_("Removing intermediate files...\n")));
if (!silent_flag)
{
if (! doneany)
{
fputs ("rm ", stdout);
doneany = 1;
}
else
putchar (' ');
fputs (f->name, stdout);
fflush (stdout);
}
}
if (status < 0)
perror_with_name ("unlink: ", f->name);
}
}
if (f->intermediate && (f->dontcare || !f->precious)
&& !f->secondary && !f->cmd_target)
{
int status;
if (f->update_status == us_none)
/* If nothing would have created this file yet,
don't print an "rm" command for it. */
continue;
if (just_print_flag)
status = 0;
else
{
status = unlink (f->name);
if (status < 0 && errno == ENOENT)
continue;
}
if (!f->dontcare)
{
if (sig)
error (NILF, _("*** Deleting intermediate file '%s'"), f->name);
else
{
if (! doneany)
DB (DB_BASIC, (_("Removing intermediate files...\n")));
if (!silent_flag)
{
if (! doneany)
{
fputs ("rm ", stdout);
doneany = 1;
}
else
putchar (' ');
fputs (f->name, stdout);
fflush (stdout);
}
}
if (status < 0)
perror_with_name ("unlink: ", f->name);
}
}
}
if (doneany && !sig)
@@ -426,7 +430,8 @@ remove_intermediates (int sig)
struct dep *
split_prereqs (char *p)
{
struct dep *new = PARSE_FILE_SEQ (&p, struct dep, '|', NULL, 0);
struct dep *new = PARSE_FILE_SEQ (&p, struct dep, MAP_PIPE, NULL,
PARSEFS_NONE);
if (*p)
{
@@ -435,7 +440,7 @@ split_prereqs (char *p)
struct dep *ood;
++p;
ood = PARSE_FILE_SEQ (&p, struct dep, '\0', NULL, 0);
ood = PARSE_SIMPLE_SEQ (&p, struct dep);
if (! new)
new = ood;
@@ -575,12 +580,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 +641,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. */
@@ -693,23 +697,23 @@ snap_deps (void)
for (f = lookup_file (".PRECIOUS"); f != 0; f = f->prev)
for (d = f->deps; d != 0; d = d->next)
for (f2 = d->file; f2 != 0; f2 = f2->prev)
f2->precious = 1;
f2->precious = 1;
for (f = lookup_file (".LOW_RESOLUTION_TIME"); f != 0; f = f->prev)
for (d = f->deps; d != 0; d = d->next)
for (f2 = d->file; f2 != 0; f2 = f2->prev)
f2->low_resolution_time = 1;
f2->low_resolution_time = 1;
for (f = lookup_file (".PHONY"); f != 0; f = f->prev)
for (d = f->deps; d != 0; d = d->next)
for (f2 = d->file; f2 != 0; f2 = f2->prev)
{
/* Mark this file as phony nonexistent target. */
f2->phony = 1;
{
/* Mark this file as phony nonexistent target. */
f2->phony = 1;
f2->is_target = 1;
f2->last_mtime = NONEXISTENT_MTIME;
f2->mtime_before_update = NONEXISTENT_MTIME;
}
f2->last_mtime = NONEXISTENT_MTIME;
f2->mtime_before_update = NONEXISTENT_MTIME;
}
for (f = lookup_file (".INTERMEDIATE"); f != 0; f = f->prev)
/* Mark .INTERMEDIATE deps as intermediate files. */
@@ -741,22 +745,22 @@ snap_deps (void)
if (f != 0 && f->is_target)
{
if (f->deps == 0)
ignore_errors_flag = 1;
ignore_errors_flag = 1;
else
for (d = f->deps; d != 0; d = d->next)
for (f2 = d->file; f2 != 0; f2 = f2->prev)
f2->command_flags |= COMMANDS_NOERROR;
for (d = f->deps; d != 0; d = d->next)
for (f2 = d->file; f2 != 0; f2 = f2->prev)
f2->command_flags |= COMMANDS_NOERROR;
}
f = lookup_file (".SILENT");
if (f != 0 && f->is_target)
{
if (f->deps == 0)
silent_flag = 1;
silent_flag = 1;
else
for (d = f->deps; d != 0; d = d->next)
for (f2 = d->file; f2 != 0; f2 = f2->prev)
f2->command_flags |= COMMANDS_SILENT;
for (d = f->deps; d != 0; d = d->next)
for (f2 = d->file; f2 != 0; f2 = f2->prev)
f2->command_flags |= COMMANDS_SILENT;
}
f = lookup_file (".NOTPARALLEL");
@@ -772,7 +776,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,20 +792,21 @@ 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;
if (! (s <= FILE_TIMESTAMP_S (ORDINARY_MTIME_MAX)
&& product <= ts && ts <= ORDINARY_MTIME_MAX))
&& product <= ts && ts <= ORDINARY_MTIME_MAX))
{
char buf[FILE_TIMESTAMP_PRINT_LEN_BOUND + 1];
ts = s <= OLD_MTIME ? ORDINARY_MTIME_MIN : ORDINARY_MTIME_MAX;
file_timestamp_sprintf (buf, ts);
error (NILF, _("%s: Timestamp out of range; substituting %s"),
fname ? fname : _("Current time"), buf);
fname ? fname : _("Current time"), buf);
}
return ts;
@@ -825,10 +830,10 @@ file_timestamp_now (int *resolution)
struct timespec timespec;
if (clock_gettime (CLOCK_REALTIME, &timespec) == 0)
{
r = 1;
s = timespec.tv_sec;
ns = timespec.tv_nsec;
goto got_time;
r = 1;
s = timespec.tv_sec;
ns = timespec.tv_nsec;
goto got_time;
}
}
# endif
@@ -837,10 +842,10 @@ file_timestamp_now (int *resolution)
struct timeval timeval;
if (gettimeofday (&timeval, 0) == 0)
{
r = 1000;
s = timeval.tv_sec;
ns = timeval.tv_usec * 1000;
goto got_time;
r = 1000;
s = timeval.tv_sec;
ns = timeval.tv_usec * 1000;
goto got_time;
}
}
# endif
@@ -867,8 +872,8 @@ file_timestamp_sprintf (char *p, FILE_TIMESTAMP ts)
if (tm)
sprintf (p, "%04d-%02d-%02d %02d:%02d:%02d",
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec);
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec);
else if (t < 0)
sprintf (p, "%ld", (long) t);
else
@@ -919,7 +924,27 @@ print_file (const void *item)
{
const struct file *f = item;
/* If we're not using builtin targets, don't show them.
Ideally we'd be able to delete them altogether but currently there's no
facility to ever delete a file once it's been added. */
if (no_builtin_rules_flag && f->builtin)
return;
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 ? ":" : "");
@@ -933,11 +958,13 @@ print_file (const void *item)
puts (_("# Command line target."));
if (f->dontcare)
puts (_("# A default, MAKEFILES, or -include/sinclude makefile."));
if (f->builtin)
puts (_("# Builtin rule"));
puts (f->tried_implicit
? _("# 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)
@@ -945,7 +972,7 @@ print_file (const void *item)
const struct dep *d;
fputs (_("# Also makes:"), stdout);
for (d = f->also_make; d != 0; d = d->next)
printf (" %s", dep_name (d));
printf (" %s", dep_name (d));
putchar ('\n');
}
if (f->last_mtime == UNKNOWN_MTIME)
@@ -973,28 +1000,23 @@ print_file (const void *item)
case cs_not_started:
case cs_finished:
switch (f->update_status)
{
case -1:
break;
case 0:
puts (_("# Successfully updated."));
break;
case 1:
assert (question_flag);
puts (_("# Needs to be updated (-q is set)."));
break;
case 2:
puts (_("# Failed to be updated."));
break;
default:
puts (_("# Invalid value in `update_status' member!"));
fflush (stdout);
fflush (stderr);
abort ();
}
{
case us_none:
break;
case us_success:
puts (_("# Successfully updated."));
break;
case us_question:
assert (question_flag);
puts (_("# Needs to be updated (-q is set)."));
break;
case us_failed:
puts (_("# Failed to be updated."));
break;
}
break;
default:
puts (_("# Invalid value in `command_state' member!"));
puts (_("# Invalid value in 'command_state' member!"));
fflush (stdout);
fflush (stderr);
abort ();
@@ -1026,7 +1048,7 @@ print_file_data_base (void)
#define VERIFY_CACHED(_p,_n) \
do{\
if (_p->_n && _p->_n[0] && !strcache_iscached (_p->_n)) \
error (NULL, "%s: Field '%s' not cached: %s\n", _p->name, # _n, _p->_n); \
error (NULL, _("%s: Field '%s' not cached: %s"), _p->name, # _n, _p->_n); \
}while(0)
static void

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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -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"
@@ -28,22 +26,18 @@ struct file
const char *name;
const char *hname; /* Hashed filename */
const char *vpath; /* VPATH/vpath pathname */
struct dep *deps; /* all dependencies, including duplicates */
struct commands *cmds; /* Commands to execute for this target. */
int command_flags; /* Flags OR'd in for cmds; see commands.h. */
const char *stem; /* Implicit stem, if an implicit
struct dep *deps; /* all dependencies, including duplicates */
struct commands *cmds; /* Commands to execute for this target. */
const char *stem; /* Implicit stem, if an implicit
rule has been used */
struct dep *also_make; /* Targets that are made by making this. */
FILE_TIMESTAMP last_mtime; /* File's modtime, if already known. */
FILE_TIMESTAMP mtime_before_update; /* File's modtime before any updating
has been performed. */
struct file *prev; /* Previous entry for same file name;
used when there are multiple double-colon
entries for the same file. */
struct dep *also_make; /* Targets that are made by making this. */
struct file *prev; /* Previous entry for same file name;
used when there are multiple double-colon
entries for the same 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. */
@@ -61,34 +55,44 @@ struct file
the same file. Otherwise this is null. */
struct file *double_colon;
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. */
cs_deps_running, /* Dep commands running. */
cs_running, /* Commands running. */
cs_finished /* Commands finished. */
FILE_TIMESTAMP last_mtime; /* File's modtime, if already known. */
FILE_TIMESTAMP mtime_before_update; /* File's modtime before any updating
has been performed. */
int command_flags; /* Flags OR'd in for cmds; see commands.h. */
enum update_status /* Status of the last attempt to update. */
{
us_success = 0, /* Successfully updated. Must be 0! */
us_none, /* No attempt to update has been made. */
us_question, /* Needs to be updated (-q is is set). */
us_failed /* Update failed. */
} update_status ENUM_BITFIELD (2);
enum cmd_state /* State of the commands. */
{
cs_not_started = 0, /* Not yet started. Must be 0! */
cs_deps_running, /* Dep commands running. */
cs_running, /* Commands running. */
cs_finished /* Commands finished. */
} command_state ENUM_BITFIELD (2);
unsigned int precious:1; /* Non-0 means don't delete file on quit */
unsigned int low_resolution_time:1; /* Nonzero if this file's time stamp
has only one-second resolution. */
unsigned int builtin:1; /* True if the file is a builtin rule. */
unsigned int precious:1; /* Non-0 means don't delete file on quit */
unsigned int loaded:1; /* True if the file is a loaded object. */
unsigned int low_resolution_time:1; /* Nonzero if this file's time stamp
has only one-second resolution. */
unsigned int tried_implicit:1; /* Nonzero if have searched
for implicit rule for making
this file; don't search again. */
unsigned int updating:1; /* Nonzero while updating deps of this file */
unsigned int updated:1; /* Nonzero if this file has been remade. */
unsigned int is_target:1; /* Nonzero if file is described as target. */
unsigned int cmd_target:1; /* Nonzero if file was given on cmd line. */
unsigned int phony:1; /* Nonzero if this is a phony file
i.e., a prerequisite of .PHONY. */
for implicit rule for making
this file; don't search again. */
unsigned int updating:1; /* Nonzero while updating deps of this file */
unsigned int updated:1; /* Nonzero if this file has been remade. */
unsigned int is_target:1; /* Nonzero if file is described as target. */
unsigned int cmd_target:1; /* Nonzero if file was given on cmd line. */
unsigned int phony:1; /* Nonzero if this is a phony file
i.e., a prerequisite of .PHONY. */
unsigned int intermediate:1;/* Nonzero if this is an intermediate file. */
unsigned int secondary:1; /* Nonzero means remove_intermediates should
not delete it. */
unsigned int dontcare:1; /* Nonzero if no complaint is to be made if
this target cannot be remade. */
unsigned int dontcare:1; /* Nonzero if no complaint is to be made if
this target cannot be remade. */
unsigned int ignore_vpath:1;/* Nonzero if we threw out VPATH name. */
unsigned int pat_searched:1;/* Nonzero if we already searched for
pattern-specific variables. */
@@ -119,7 +123,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)
@@ -134,9 +138,9 @@ void print_file_data_base (void);
#define FILE_TIMESTAMP_LO_BITS (FILE_TIMESTAMP_HI_RES ? 30 : 0)
#define FILE_TIMESTAMP_S(ts) (((ts) - ORDINARY_MTIME_MIN) \
>> FILE_TIMESTAMP_LO_BITS)
>> FILE_TIMESTAMP_LO_BITS)
#define FILE_TIMESTAMP_NS(ts) ((int) (((ts) - ORDINARY_MTIME_MIN) \
& ((1 << FILE_TIMESTAMP_LO_BITS) - 1)))
& ((1 << FILE_TIMESTAMP_LO_BITS) - 1)))
/* Upper bound on length of string "YYYY-MM-DD HH:MM:SS.NNNNNNNNN"
representing a file timestamp. The upper bound is not necessarily 19,
@@ -156,7 +160,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);
@@ -187,13 +191,13 @@ FILE_TIMESTAMP f_mtime (struct file *file, int search);
/* The smallest and largest ordinary timestamps. */
#define ORDINARY_MTIME_MIN (OLD_MTIME + 1)
#define ORDINARY_MTIME_MAX ((FILE_TIMESTAMP_S (NEW_MTIME) \
<< FILE_TIMESTAMP_LO_BITS) \
+ ORDINARY_MTIME_MIN + FILE_TIMESTAMPS_PER_S - 1)
<< 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)

1081
function.c

File diff suppressed because it is too large Load Diff

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-2013 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);
@@ -987,7 +985,7 @@ getloadavg (double loadavg[], int nelem)
#endif /* ! HAVE_GETLOADAVG */
#ifdef TEST
#include "make.h"
#include "makeint.h"
int
main (int argc, char **argv)

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-2013 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-2013 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-2013 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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the

View File

@@ -1,2 +0,0 @@
Makefile Makefile.in
.deps

View File

@@ -56,7 +56,7 @@ typedef __SIZE_TYPE__ __size_t;
# else
/* This is a guess. */
/*hb
* Conflicts with DECCs aready defined type __size_t.
* Conflicts with DECCs already defined type __size_t.
* Defining an own type with a name beginning with '__' is no good.
* Anyway if DECC is used and __SIZE_T is defined then __size_t is
* already defined (and I hope it's exactly the one we need here).

53
gmk-default.scm Normal file
View File

@@ -0,0 +1,53 @@
;; Contents of the (gnu make) Guile module
;; Copyright (C) 2011-2013 Free Software Foundation, Inc.
;; This file is part of GNU Make.
;;
;; GNU Make is free software; you can redistribute it and/or modify it under
;; the terms of the GNU General Public License as published by the Free
;; Software Foundation; either version 3 of the License, or (at your option)
;; any later version.
;;
;; GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
;; WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
;; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
;; details.
;;
;; You should have received a copy of the GNU General Public License along
;; with this program. If not, see <http://www.gnu.org/licenses/>.
(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))))
;; 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)

73
gnumake.h Normal file
View File

@@ -0,0 +1,73 @@
/* External interfaces usable by dynamic objects loaded into GNU Make.
--THIS API IS A "TECHNOLOGY PREVIEW" ONLY. IT IS NOT A STABLE INTERFACE--
Copyright (C) 2013 Free Software Foundation, Inc.
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/>. */
#ifndef _GNUMAKE_H_
#define _GNUMAKE_H_
/* Specify the location of elements read from makefiles. */
typedef struct
{
const char *filenm;
unsigned long lineno;
} gmk_floc;
#ifdef _WIN32
# ifdef GMK_BUILDING_MAKE
# define GMK_EXPORT __declspec(dllexport)
# else
# define GMK_EXPORT __declspec(dllimport)
# endif
#else
# define GMK_EXPORT
#endif
/* Free memory returned by the gmk_expand() function. */
GMK_EXPORT void gmk_free (char *str);
/* Allocate memory in GNU make's context. */
GMK_EXPORT char *gmk_alloc (unsigned int len);
/* Run $(eval ...) on the provided string BUFFER. */
GMK_EXPORT void gmk_eval (const char *buffer, const gmk_floc *floc);
/* Run GNU make expansion on the provided string STR.
Returns an allocated buffer that the caller must free with gmk_free(). */
GMK_EXPORT char *gmk_expand (const char *str);
/* Register a new GNU make function NAME (maximum of 255 chars long).
When the function is expanded in the makefile, FUNC will be invoked with
the appropriate arguments.
The return value of FUNC must be either NULL, in which case it expands to
the empty string, or a pointer to the result of the expansion in a string
created by gmk_alloc(). GNU make will free the memory when it's done.
MIN_ARGS is the minimum number of arguments the function requires.
MAX_ARGS is the maximum number of arguments (or 0 if there's no maximum).
MIN_ARGS and MAX_ARGS must be >= 0 and <= 255.
If EXPAND_ARGS is 0, the arguments to the function will not be expanded
before FUNC is called. If EXPAND_ARGS is non-0, they will be expanded.
*/
GMK_EXPORT void gmk_add_function (const char *name,
char *(*func)(const char *nm,
int argc, char **argv),
int min_args, int max_args, int expand_args);
#endif /* _GNUMAKE_H_ */

146
guile.c Normal file
View File

@@ -0,0 +1,146 @@
/* GNU Guile interface for GNU Make.
Copyright (C) 2011-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h"
#include "gnumake.h"
#include "debug.h"
#include "filedef.h"
#include "dep.h"
#include "variable.h"
#include <libguile.h>
/* Pre-2.0 versions of Guile don't have a typedef for gsubr function types. */
#if SCM_MAJOR_VERSION < 2
# define GSUBR_TYPE SCM (*) ()
/* Guile 1.x doesn't really support i18n. */
# define EVAL_STRING(_s) scm_c_eval_string (_s)
#else
# define GSUBR_TYPE scm_t_subr
# define EVAL_STRING(_s) scm_eval_string (scm_from_utf8_string (_s))
#endif
static SCM make_mod = SCM_EOL;
static SCM obj_to_str = SCM_EOL;
/* 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 = gmk_expand (str);
ret = scm_from_locale_string (res);
free (str);
free (res);
return ret;
}
/* Perform the GNU make eval function. */
static SCM
guile_eval_wrapper (SCM obj)
{
char *str = cvt_scm_to_str (obj);
DB (DB_BASIC, (_("guile: Evaluating '%s'\n"), str));
gmk_eval (str, 0);
return SCM_BOOL_F;
}
/* 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, (GSUBR_TYPE) guile_expand_wrapper);
/* Register a subr for GNU make's eval capability. */
scm_c_define_gsubr ("gmk-eval", 1, 0, 0, (GSUBR_TYPE) guile_eval_wrapper);
/* Define the rest of the module. */
scm_c_eval_string (GUILE_module_defn);
}
/* 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 (EVAL_STRING (arg));
}
/* This is the function registered with make */
static char *
func_guile (const char *funcname UNUSED, int argc UNUSED, char **argv)
{
static int init = 0;
if (! init)
{
/* Initialize the Guile interpreter. */
scm_with_guile (guile_init, NULL);
init = 1;
}
if (argv[0] && argv[0][0] != '\0')
return scm_with_guile (internal_guile_eval, argv[0]);
return NULL;
}
/* ----- 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 gmk_floc *flocp UNUSED)
{
/* Create a make function "guile". */
gmk_add_function ("guile", func_guile, 0, 1, 1);
return 1;
}

12
hash.c
View File

@@ -14,10 +14,10 @@ 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 "makeint.h"
#include "hash.h"
#define CALLOC(t, n) ((t *) calloc (sizeof (t), (n)))
#define CALLOC(t, n) ((t *) xcalloc (sizeof (t) * (n)))
#define MALLOC(t, n) ((t *) xmalloc (sizeof (t) * (n)))
#define REALLOC(o, t, n) ((t *) xrealloc ((o), sizeof (t) * (n)))
#define CLONE(o, t, n) ((t *) memcpy (MALLOC (t, (n)), (o), sizeof (t) * (n)))
@@ -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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -16,7 +14,7 @@ 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 "makeint.h"
#include "filedef.h"
#include "rule.h"
#include "dep.h"
@@ -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;
}
@@ -219,13 +217,10 @@ pattern_search (struct file *file, int archive,
struct file *int_file = 0;
/* List of dependencies found recursively. */
struct patdeps *deplist
= xmalloc (max_pattern_deps * sizeof (struct patdeps));
unsigned int max_deps = max_pattern_deps;
struct patdeps *deplist = xmalloc (max_deps * sizeof (struct patdeps));
struct patdeps *pat = deplist;
/* All the prerequisites actually found for a rule, after expansion. */
struct dep *deps;
/* Names of possible dependencies are constructed in this buffer. */
char *depname = alloca (namelen + max_pattern_dep_length);
@@ -251,11 +246,9 @@ 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;
unsigned int ri; /* uninit checks OK */
struct rule *rule;
@@ -402,10 +395,10 @@ pattern_search (struct file *file, int archive,
target in MATCHES. If several targets of the same rule match,
that rule will be in TRYRULES more than once. */
tryrules[nrules].rule = rule;
tryrules[nrules].matches = ti;
tryrules[nrules].matches = ti;
tryrules[nrules].stemlen = stemlen + (check_lastslash ? pathlen : 0);
tryrules[nrules].order = nrules;
tryrules[nrules].checked_lastslash = check_lastslash;
tryrules[nrules].checked_lastslash = check_lastslash;
++nrules;
}
}
@@ -488,7 +481,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);
@@ -530,11 +530,9 @@ pattern_search (struct file *file, int archive,
/* If we don't need a second expansion, just replace the %. */
if (! dep->need_2nd_expansion)
{
dep_simple = *dep;
dep_simple.next = 0;
p = strchr (nptr, '%');
if (p == 0)
dep_simple.name = nptr;
strcpy (depname, nptr);
else
{
char *o = depname;
@@ -548,13 +546,19 @@ pattern_search (struct file *file, int archive,
memcpy (o, stem_str, stemlen);
o += stemlen;
strcpy (o, p + 1);
dep_simple.name = strcache_add (depname);
}
dl = &dep_simple;
/* Parse the expanded string. It might have wildcards. */
p = depname;
dl = PARSE_SIMPLE_SEQ (&p, struct dep);
for (d = dl; d != NULL; d = d->next)
{
++deps_found;
d->ignore_mtime = dep->ignore_mtime;
}
/* We've used up this dep, so next time get a new one. */
nptr = 0;
++deps_found;
}
/* We have to perform second expansion on this prereq. In an
@@ -570,6 +574,7 @@ pattern_search (struct file *file, int archive,
{
int add_dir = 0;
unsigned int len;
struct dep **dptr;
nptr = get_next_word (nptr, &len);
if (nptr == 0)
@@ -612,6 +617,9 @@ pattern_search (struct file *file, int archive,
add_dir = 1;
}
/* Set up for the next word. */
nptr += len;
/* Initialize and set file variables if we haven't already
done so. */
if (!file_vars_initialized)
@@ -630,32 +638,47 @@ pattern_search (struct file *file, int archive,
/* Perform the 2nd expansion. */
p = variable_expand_for_file (depname, file);
dptr = &dl;
/* Parse the expanded string. */
dl = PARSE_FILE_SEQ (&p, struct dep, order_only ? '\0' : '|',
add_dir ? dir : NULL, 0);
for (d = dl; d != NULL; d = d->next)
/* Parse the results into a deps list. */
do
{
++deps_found;
if (order_only)
d->ignore_mtime = 1;
}
/* Parse the expanded string. */
struct dep *dp = PARSE_FILE_SEQ (&p, struct dep,
order_only ? MAP_NUL : MAP_PIPE,
add_dir ? dir : NULL, PARSEFS_NONE);
*dptr = dp;
/* Set up for the next word. */
nptr += len;
for (d = dp; d != NULL; d = d->next)
{
++deps_found;
if (order_only)
d->ignore_mtime = 1;
dptr = &d->next;
}
/* If we stopped due to an order-only token, note it. */
if (*p == '|')
{
order_only = 1;
++p;
}
}
while (*p != '\0');
}
/* If there are more than max_pattern_deps prerequisites (due to
2nd expansion), reset it and realloc the arrays. */
if (deps_found > max_pattern_deps)
if (deps_found > max_deps)
{
unsigned int l = pat - deplist;
/* This might have changed due to recursion. */
max_pattern_deps = MAX(max_pattern_deps, deps_found);
max_deps = max_pattern_deps;
deplist = xrealloc (deplist,
deps_found * sizeof (struct patdeps));
max_deps * sizeof (struct patdeps));
pat = deplist + l;
max_pattern_deps = deps_found;
}
/* Go through the nameseq and handle each as a prereq name. */
@@ -671,8 +694,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 +708,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 +748,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 +762,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)
@@ -755,8 +778,8 @@ pattern_search (struct file *file, int archive,
pat->pattern = int_file->name;
int_file->name = d->name;
pat->file = int_file;
(pat++)->name = d->name;
int_file = 0;
(pat++)->name = d->name;
continue;
}
@@ -777,8 +800,7 @@ pattern_search (struct file *file, int archive,
}
/* Free the ns chain. */
if (dl != &dep_simple)
free_dep_chain (dl);
free_dep_chain (dl);
if (failed)
break;
@@ -788,17 +810,14 @@ 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)
/* This pattern rule does apply. Stop looking for one. */
break;
/* This pattern rule does not apply. If some of its dependencies
succeeded, free the data structure describing them. */
/* free_idep_chain (deps); */
deps = 0;
/* This pattern rule does not apply. Keep looking. */
}
/* If we found an applicable rule without intermediate files, don't try
@@ -890,8 +909,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 +954,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)

2112
job.c

File diff suppressed because it is too large Load Diff

120
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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -16,8 +14,7 @@ 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/>. */
#ifndef SEEN_JOB_H
#define SEEN_JOB_H
#include "output.h"
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
@@ -28,7 +25,11 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* How to set close-on-exec for a file descriptor. */
#if !defined F_SETFD
# define CLOSE_ON_EXEC(_d)
# ifdef WINDOWS32
# define CLOSE_ON_EXEC(_d) process_noinherit(_d)
# else
# define CLOSE_ON_EXEC(_d)
# endif
#else
# ifndef FD_CLOEXEC
# define FD_CLOEXEC 1
@@ -36,34 +37,78 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
# define CLOSE_ON_EXEC(_d) (void) fcntl ((_d), F_SETFD, FD_CLOEXEC)
#endif
#ifdef NO_OUTPUT_SYNC
# define RECORD_SYNC_MUTEX(m) \
error (NILF, \
_("-O[TYPE] (--output-sync[=TYPE]) is not configured for this build."));
#else
# ifdef WINDOWS32
/* For emulations in w32/compat/posixfcn.c. */
# define F_GETFD 1
# define F_SETLKW 2
/* Implementation note: None of the values of l_type below can be zero
-- they are compared with a static instance of the struct, so zero
means unknown/invalid, see w32/compat/posixfcn.c. */
# define F_WRLCK 1
# define F_UNLCK 2
struct flock
{
short l_type;
short l_whence;
off_t l_start;
off_t l_len;
pid_t l_pid;
};
/* This type is actually a HANDLE, but we want to avoid including
windows.h as much as possible. */
typedef intptr_t sync_handle_t;
/* Public functions emulated/provided in posixfcn.c. */
int fcntl (intptr_t fd, int cmd, ...);
intptr_t create_mutex (void);
int same_stream (FILE *f1, FILE *f2);
# define RECORD_SYNC_MUTEX(m) record_sync_mutex(m)
void record_sync_mutex (const char *str);
void prepare_mutex_handle_string (intptr_t hdl);
# else /* !WINDOWS32 */
typedef int sync_handle_t; /* file descriptor */
# define RECORD_SYNC_MUTEX(m) (void)(m)
# endif
#endif /* !NO_OUTPUT_SYNC */
/* Structure describing a running or dead child process. */
struct child
{
struct child *next; /* Link in the chain. */
struct child *next; /* Link in the chain. */
struct file *file; /* File being remade. */
struct file *file; /* File being remade. */
char **environment; /* Environment for 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
int efn; /* Completion event flag number */
int cstatus; /* Completion status */
char *comname; /* Temporary command file name */
#endif
char **environment; /* Environment for commands. */
char *sh_batch_file; /* Script file for shell commands */
unsigned int remote:1; /* Nonzero if executing remotely. */
char **command_lines; /* Array of variable-expanded cmd lines. */
char *command_ptr; /* Ptr into command_lines[command_line]. */
unsigned int noerror:1; /* Nonzero if commands contained a `-'. */
#ifdef VMS
char *comname; /* Temporary command file name */
int efn; /* Completion event flag number */
int cstatus; /* Completion status */
#endif
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. */
unsigned int command_line; /* Index into command_lines. */
struct output output; /* Output for this child. */
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 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. */
};
extern struct child *children;
@@ -77,17 +122,24 @@ char **construct_command_argv (char *line, char **restp, struct file *file,
int cmd_flags, char** batch_file);
#ifdef VMS
int child_execute_job (char *argv, struct child *child);
#elif defined(__EMX__)
int child_execute_job (int stdin_fd, int stdout_fd, char **argv, char **envp);
#else
void child_execute_job (int stdin_fd, int stdout_fd, char **argv, char **envp);
# define FD_STDIN (fileno (stdin))
# define FD_STDOUT (fileno (stdout))
# define FD_STDERR (fileno (stderr))
# if defined(__EMX__)
int child_execute_job (int stdin_fd, int stdout_fd, int stderr_fd,
char **argv, char **envp);
# else
void child_execute_job (int stdin_fd, int stdout_fd, int stderr_fd,
char **argv, char **envp) __attribute__ ((noreturn));
# endif
#endif
#ifdef _AMIGA
void exec_command (char **argv);
void exec_command (char **argv) __attribute__ ((noreturn));
#elif defined(__EMX__)
int exec_command (char **argv, char **envp);
#else
void exec_command (char **argv, char **envp);
void exec_command (char **argv, char **envp) __attribute__ ((noreturn));
#endif
extern unsigned int job_slots_used;
@@ -96,14 +148,12 @@ void block_sigs (void);
#ifdef POSIX
void unblock_sigs (void);
#else
#ifdef HAVE_SIGSETMASK
#ifdef HAVE_SIGSETMASK
extern int fatal_signal_mask;
#define unblock_sigs() sigsetmask (0)
#define unblock_sigs() sigsetmask (0)
#else
#define unblock_sigs()
#define unblock_sigs()
#endif
#endif
extern unsigned int jobserver_tokens;
#endif /* SEEN_JOB_H */

240
load.c Normal file
View File

@@ -0,0 +1,240 @@
/* Loading dynamic objects for GNU Make.
Copyright (C) 2012-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h"
#if MAKE_LOAD
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <dlfcn.h>
#include <errno.h>
#define SYMBOL_EXTENSION "_gmk_setup"
#include "debug.h"
#include "filedef.h"
#include "variable.h"
struct load_list
{
struct load_list *next;
const char *name;
void *dlp;
};
static struct load_list *loaded_syms = NULL;
static load_func_t
load_object (const gmk_floc *flocp, int noerror,
const char *ldname, const char *symname)
{
static void *global_dl = NULL;
load_func_t symp;
if (! global_dl)
{
global_dl = dlopen (NULL, RTLD_NOW|RTLD_GLOBAL);
if (! global_dl)
fatal (flocp, _("Failed to open global symbol table: %s"), dlerror ());
}
symp = (load_func_t) dlsym (global_dl, symname);
if (! symp)
{
struct load_list *new;
void *dlp = NULL;
/* If the path has no "/", try the current directory first. */
if (! strchr (ldname, '/')
#ifdef HAVE_DOS_PATHS
&& ! strchr (ldname, '\\')
#endif
)
dlp = dlopen (concat (2, "./", ldname), RTLD_LAZY|RTLD_GLOBAL);
/* If we haven't opened it yet, try the default search path. */
if (! dlp)
dlp = dlopen (ldname, RTLD_LAZY|RTLD_GLOBAL);
/* Still no? Then fail. */
if (! dlp)
{
if (noerror)
DB (DB_BASIC, ("%s", dlerror ()));
else
error (flocp, "%s", dlerror ());
return NULL;
}
/* Assert that the GPL license symbol is defined. */
symp = (load_func_t) dlsym (dlp, "plugin_is_GPL_compatible");
if (! symp)
fatal (flocp, _("Loaded object %s is not declared to be GPL compatible"),
ldname);
symp = (load_func_t) dlsym (dlp, symname);
if (! symp)
fatal (flocp, _("Failed to load symbol %s from %s: %s"),
symname, ldname, dlerror ());
/* Add this symbol to a trivial lookup table. This is not efficient but
it's highly unlikely we'll be loading lots of objects, and we only
need it to look them up on unload, if we rebuild them. */
new = xmalloc (sizeof (struct load_list));
new->name = xstrdup (ldname);
new->dlp = dlp;
new->next = loaded_syms;
loaded_syms = new;
}
return symp;
}
int
load_file (const gmk_floc *flocp, const char **ldname, int noerror)
{
int nmlen = strlen (*ldname);
char *new = alloca (nmlen + CSTRLEN (SYMBOL_EXTENSION) + 1);
char *symname = NULL;
char *loaded;
const char *fp;
int r;
load_func_t symp;
/* Break the input into an object file name and a symbol name. If no symbol
name was provided, compute one from the object file name. */
fp = strchr (*ldname, '(');
if (fp)
{
const char *ep;
/* There's an open paren, so 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';
}
}
/* Add this name to the string cache so it can be reused later. */
*ldname = strcache_add (*ldname);
/* If this object has been loaded, we're done. */
loaded = allocated_variable_expand ("$(.LOADED)");
fp = strstr (loaded, *ldname);
r = fp && (fp==loaded || fp[-1]==' ') && (fp[nmlen]=='\0' || fp[nmlen]==' ');
free (loaded);
if (r)
return 1;
/* If we didn't find a symbol name yet, construct it from the ldname. */
if (! symname)
{
char *p = new;
fp = strrchr (*ldname, '/');
#ifdef HAVE_DOS_PATHS
if (fp)
{
const char *fp2 = strchr (fp, '\\');
if (fp2 > fp)
fp = fp2;
}
else
fp = strrchr (*ldname, '\\');
/* The (improbable) case of d:foo. */
if (fp && *fp && fp[1] == ':')
fp++;
#endif
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));
/* Load it! */
symp = load_object (flocp, noerror, *ldname, symname);
if (! symp)
return 0;
/* Invoke the symbol. */
r = (*symp) (flocp);
/* If it succeeded, add the load file to the loaded variable. */
if (r > 0)
do_variable_definition (flocp, ".LOADED", *ldname, o_default, f_append, 0);
return r;
}
void
unload_file (const char *name)
{
struct load_list *d;
for (d = loaded_syms; d != NULL; d = d->next)
if (streq (d->name, name) && d->dlp)
{
if (dlclose (d->dlp))
perror_with_name ("dlclose", d->name);
d->dlp = NULL;
break;
}
}
#else
int
load_file (const gmk_floc *flocp, const char **ldname, int noerror)
{
if (! noerror)
fatal (flocp, _("The 'load' operation is not supported on this platform."));
return 0;
}
void
unload_file (const char *name)
{
fatal (NILF, "INTERNAL: Cannot unload when load is not supported!");
}
#endif /* MAKE_LOAD */

62
loadapi.c Normal file
View File

@@ -0,0 +1,62 @@
/* API for GNU Make dynamic objects.
Copyright (C) 2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h"
#include "filedef.h"
#include "variable.h"
#include "dep.h"
/* Allocate a buffer in our context, so we can free it. */
char *
gmk_alloc (unsigned int len)
{
return xmalloc (len);
}
/* Free a buffer returned by gmk_expand(). */
void
gmk_free (char *s)
{
free (s);
}
/* Evaluate a buffer as make syntax.
Ideally eval_buffer() will take const char *, but not yet. */
void
gmk_eval (const char *buffer, const gmk_floc *floc)
{
char *s = xstrdup (buffer);
eval_buffer (s, floc);
free (s);
}
/* Expand a string and return an allocated buffer.
Caller must call gmk_free() with this buffer. */
char *
gmk_expand (const char *ref)
{
return allocated_variable_expand (ref);
}
/* Register a function to be called from makefiles. */
void
gmk_add_function (const char *name,
char *(*func)(const char *nm, int argc, char **argv),
int min, int max, int expand)
{
define_new_function (reading_file, name, min, max, expand, func);
}

2487
main.c

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +1,13 @@
# Maintainer-only makefile segment. This contains things that are relevant
# only if you have the full copy of the GNU make sources from the CVS
# only if you have the full copy of the GNU make sources from the Git
# tree, not a dist copy.
# 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
@@ -80,31 +83,18 @@ DEP_FILES := $(wildcard $(DEPDIR)/*.Po)
< $$f; \
done) > $@
# Get rid of everything "else".
#
maintFILES = configure aclocal.m4 config.h.in Makefile.in stamp-h.in
# Cleaning
CVS-CLEAN-FILES += $(maintFILES) $(TEMPLATES) $(MTEMPLATES) NMakefile \
build.sh.in .deps .dep_segment ABOUT-NLS \
ansi2knr.*
GIT := git
# This rule tries to clean the tree right down to how it looks when you do a
# virgin CVS checkout.
# git-clean: Clean all "ignored" files. Leave untracked files.
# git-very-clean: Clean all files that aren't stored in source control.
# This target is potentially dangerous since it removes _ANY FILE_ that
# is not in CVS. Including files you might mean to add to CVS but
# haven't yet... I only use this in subdirectories where it's unlikely
# we have any new files. Still... be careful!!
cvsclean = $(PERL) -e '$$k{CVS} = 1; open(E,"< CVS/Entries") || die "CVS/Entries: $$!\n"; while (defined ($$_ = <E>)) { m%^/([^/]*)% or next; $$k{$$1} = 1; } close(E) || die "CVS/Entries: $$!\n"; opendir(D, ".") || die ".: $$!\n"; while (defined ($$_ = readdir(D))) { -f $$_ && ! exists $$k{$$_} && unlink($$_); } closedir(D) || die ".: $$!\n";'
.PHONY: cvs-clean
cvs-clean: maintainer-clean
-rm -rf *~ $(CVS-CLEAN-FILES)
-cd config && $(cvsclean)
-cd po && $(cvsclean)
-cd doc && $(cvsclean)
-cd glob && $(cvsclean)
.PHONY: git-clean git-very-clean
git-clean:
-$(GIT) clean -fdX
git-very-clean: git-clean
-$(GIT) clean -fd
# ----------------------------------------------------------------------
@@ -135,6 +125,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 +134,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
@@ -192,11 +184,42 @@ scm-update: get-config/texinfo.tex get-config/config.guess get-config/config.sub
update: po-update scm-update
# ---------------------------------- #
# Alternative configuration checks. #
# ---------------------------------- #
.PHONY: check-alt-config
check-alt-config: \
checkcfg.--disable-job-server \
checkcfg.--disable-load \
checkcfg.--without-guile \
checkcfg.CPPFLAGS^-DNO_OUTPUT_SYNC \
checkcfg.CPPFLAGS^-DNO_ARCHIVES
checkcfg.%: distdir
@ rm -rf $(distdir)/_build \
&& mkdir $(distdir)/_build \
&& cd $(distdir)/_build \
&& echo "Testing configure with $(subst ^,=,$*)" \
&& ../configure --srcdir=.. $(subst ^,=,$*) \
$(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS) \
CFLAGS='$(AM_CFLAGS)' \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) check
.PHONY: update
update: po-update scm-update
## --------------- ##
## Sanity checks. ##
## --------------- ##
# Checks that don't require cvs. Run `changelog-check' last as
# Before we build a distribution be sure we run our local checks
#distdir: local-check
# Checks that don't require Git. Run 'changelog-check' last as
# previous test may reveal problems requiring new ChangeLog entries.
local-check: po-check changelog-check
@@ -211,11 +234,11 @@ changelog-check:
fi
# Verify that all source files using _() are listed in po/POTFILES.in.
# Ignore make.h; it defines _().
# Ignore makeint.h; it defines _().
po-check:
if test -f po/POTFILES.in; then \
grep '^[^#]' po/POTFILES.in | sort > $@-1; \
$(PERL) -wn -e 'if (/\b_\(/) { $$ARGV eq "make.h" || print "$$ARGV\n" and close ARGV }' *.c *.h | sort > $@-2; \
$(PERL) -wn -e 'if (/\b_\(/) { $$ARGV eq "makeint.h" || print "$$ARGV\n" and close ARGV }' *.c *.h | sort > $@-2; \
diff -u $@-1 $@-2 || exit 1; \
rm -f $@-1 $@-2; \
fi
@@ -266,8 +289,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-2013 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under

204
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]"
@@ -158,9 +143,11 @@ for showing implicit rules,
.I j
for details on invocation of commands, and
.I m
for debugging while remaking makefiles.
for debugging while remaking makefiles. Use
.I n
to disable all previous debugging flags.
.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 +156,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 +168,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 +191,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 +207,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 +222,29 @@ 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\-O\fR[\fItype\fR], \fB\-\-output\-sync\fR[=\fItype\fR]
When running multiple jobs in parallel with \fB-j\fR, ensure the output of
each job is collected together rather than interspersed with output from
other jobs. If
.I type
is not specified or is
.B target
the output from the entire recipe for each target is grouped together. If
.I type
is
.B line
the output from each command line within a recipe is grouped together.
If
.I type
is
.B recurse
output from an entire recursive make is grouped together. If
.I type
is
.B none
output synchronization is disabled.
.TP 0.5i
\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 +252,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
Information about the disposition of each target is printed (why the target is
being rebuilt and what commands are run to rebuild it).
.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 +326,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-2013 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

View File

@@ -1,4 +1,4 @@
FROM LIB:cres.o "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"+"remote-stub.o"+"getopt.o"+"getopt1.o"+"alloca.o"+"amiga.o"+"hash.o"+"strcache.o"
FROM LIB:cres.o "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"+"remote-stub.o"+"getopt.o"+"getopt1.o"+"alloca.o"+"amiga.o"+"hash.o"+"strcache.o"+"output.o"
TO "make.new"
LIB glob/glob.lib LIB:sc.lib LIB:amiga.lib
QUIET

View File

@@ -154,6 +154,11 @@
<File
RelativePath=".\getopt1.c">
</File>
<!--
<File
RelativePath=".\guile.c">
</File>
-->
<File
RelativePath=".\hash.c">
</File>
@@ -166,6 +171,12 @@
<File
RelativePath=".\job.c">
</File>
<File
RelativePath=".\load.c">
</File>
<File
RelativePath=".\output.c">
</File>
<File
RelativePath=".\main.c">
</File>
@@ -202,6 +213,9 @@
<File
RelativePath=".\w32\compat\dirent.c">
</File>
<File
RelativePath=".\w32\compat\posixfcn.c">
</File>
<File
RelativePath=".\w32\subproc\misc.c">
<FileConfiguration
@@ -263,6 +277,9 @@
<File
RelativePath=".\gettext.h">
</File>
<File
RelativePath=".\gmk-default.h">
</File>
<File
RelativePath=".\hash.h">
</File>
@@ -270,7 +287,10 @@
RelativePath=".\job.h">
</File>
<File
RelativePath=".\make.h">
RelativePath=".\output.h">
</File>
<File
RelativePath=".\makeint.h">
</File>
<File
RelativePath=".\rule.h">

View File

@@ -67,8 +67,8 @@ $ then
$ gosub check_cc_qual
$ endif
$ filelist = "alloca ar arscan commands default dir expand file function " + -
"hash implicit job main misc read remake remote-stub rule " + -
"signame variable version vmsfunctions vmsify vpath " + -
"hash implicit job load main misc read remake remote-stub rule " + -
"output signame variable version vmsfunctions vmsify vpath " + -
"[.glob]glob [.glob]fnmatch getopt1 getopt strcache"
$ copy config.h-vms config.h
$ n=0
@@ -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-2013 Free Software Foundation, Inc.
$!This file is part of GNU Make.
$!
$!GNU Make is free software; you can redistribute it and/or modify it under

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-2013 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
@@ -21,7 +20,7 @@
# Klaus Kämpf (kkaempf@rmi.de)
# Modified for version 3.78.1 by Hartmut.Becker@compaq.com.
# Modified for version 3.80 by zinser@decus.de
# Modified for version 3.81 by Hartmut Becker
# Modified for versions 3.81, 3.99.90 by Hartmut Becker
CC = cc
CP = copy
@@ -82,22 +81,26 @@ 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
objs = commands.obj,job.obj,dir.obj,file.obj,misc.obj,hash.obj,\
main.obj,read.obj,remake.obj,rule.obj,implicit.obj,\
#guile = ,guile.obj
objs = commands.obj,job.obj,output.obj,dir.obj,file.obj,misc.obj,hash.obj,\
load.obj,main.obj,read.obj,remake.obj,rule.obj,implicit.obj,\
default.obj,variable.obj,expand.obj,function.obj,strcache.obj,\
vpath.obj,version.obj$(ARCHIVES)$(ALLOCA)$(extras)$(getopt)$(glob)
srcs = commands.c job.c dir.c file.c misc.c hash.c \
main.c read.c remake.c rule.c implicit.c \
vpath.obj,version.obj\
$(ARCHIVES)$(ALLOCA)$(extras)$(getopt)$(glob)$(guile)
srcs = commands.c job.c output.c dir.c file.c misc.c guile.c hash.c \
load.c main.c read.c remake.c rule.c implicit.c \
default.c variable.c expand.c function.c strcache.c \
vpath.c version.c vmsfunctions.c vmsify.c $(ARCHIVES_SRC) $(ALLOCASRC) \
commands.h dep.h filedef.h job.h make.h rule.h variable.h
commands.h dep.h filedef.h job.h output.h makeint.h rule.h variable.h
.PHONY: all doc
@@ -111,39 +114,44 @@ make.exe: $(objs)
.PHONY: clean realclean
clean:
$$ purge [...]
-purge [...]
-$(RM) make.exe;,*.obj;
-$(RM) [.glob]*.obj;
# Automatically generated dependencies.
commands.obj: commands.c make.h dep.h commands.h filedef.h variable.h job.h
job.obj: job.c vmsjobs.c make.h commands.h job.h filedef.h variable.h
dir.obj: dir.c make.h
file.obj: file.c make.h commands.h dep.h filedef.h variable.h
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
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
implicit.obj: implicit.c make.h rule.h dep.h filedef.h
default.obj: default.c make.h rule.h dep.h filedef.h commands.h variable.h
variable.obj: variable.c make.h commands.h variable.h dep.h filedef.h
expand.obj: expand.c make.h commands.h filedef.h variable.h
function.obj: function.c make.h variable.h dep.h commands.h job.h
vpath.obj: vpath.c make.h filedef.h variable.h
# makeint.h: config.h gnumake.h gettext.h
# filedef.h: hash.h
ar.obj: ar.c makeint.h filedef.h dep.h [.glob]fnmatch.h
arscan.obj: arscan.c makeint.h
commands.obj: commands.c makeint.h dep.h commands.h filedef.h variable.h job.h
default.obj: default.c makeint.h rule.h dep.h job.h filedef.h commands.h variable.h
dir.obj: dir.c makeint.h hash.h [.glob]glob.h
expand.obj: expand.c makeint.h commands.h filedef.h job.h rule.h variable.h
file.obj: file.c makeint.h commands.h dep.h filedef.h variable.h job.h debug.h
function.obj: function.c makeint.h variable.h dep.h commands.h filedef.h debug.h job.h
getopt.obj: getopt.c getopt.h config.h gettext.h
getopt1.obj: getopt1.c getopt.h config.h
guile.obj: guile.c makeint.h debug.h dep.h gmk-default.h
hash.obj: hash.c makeint.h hash.h
implicit.obj: implicit.c makeint.h rule.h dep.h filedef.h debug.h variable.h job.h commands.h
job.obj: job.c vmsjobs.c makeint.h commands.h job.h filedef.h variable.h debug.h
output.obj: output.c vmsjobs.c makeint.h output.h filedef.h debug.h
load.obj: load.c makeint.h debug.h filedef.h variable.h
main.obj: main.c makeint.h commands.h dep.h filedef.h variable.h job.h rule.h debug.h getopt.h
misc.obj: misc.c makeint.h dep.h debug.h
read.obj: read.c makeint.h commands.h dep.h filedef.h variable.h [.glob]glob.h debug.h rule.h job.h
remake.obj: remake.c makeint.h commands.h job.h dep.h filedef.h variable.h debug.h
remote-stub.obj: remote-stub.c makeint.h filedef.h job.h commands.h
rule.obj: rule.c makeint.h commands.h dep.h filedef.h variable.h rule.h job.h
signame.obj: signame.c makeint.h
strcache.obj: strcache.c makeint.h hash.h
variable.obj: variable.c makeint.h commands.h variable.h dep.h filedef.h job.h rule.h
version.obj: version.c config.h
arscan.obj: arscan.c
ar.obj: ar.c make.h filedef.h
signame.obj: signame.c
remote-stub.obj: remote-stub.c
[.glob]glob.obj: [.glob]glob.c
[.glob]fnmatch.obj: [.glob]fnmatch.c
getopt.obj: getopt.c
getopt1.obj: getopt1.c
vmsfunctions.obj: vmsfunctions.c make.h vmsdir.h
vmsify.obj: vmsify.c make.h
vmsfunctions.obj: vmsfunctions.c makeint.h vmsdir.h debug.h job.h
vmsify.obj: vmsify.c
vpath.obj: vpath.c makeint.h filedef.h variable.h
[.glob]fnmatch.obj: [.glob]fnmatch.c [.glob]fnmatch.h config.h
[.glob]glob.obj: [.glob]glob.c [.glob]glob.h [.glob]fnmatch.h config.h
config.h: config.h-vms
$(CP) $< $@

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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -18,7 +16,7 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
/* We use <config.h> instead of "config.h" so that a compilation
using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h
(which it would do because make.h was found in $srcdir). */
(which it would do because makeint.h was found in $srcdir). */
#include <config.h>
#undef HAVE_CONFIG_H
#define HAVE_CONFIG_H 1
@@ -43,6 +41,20 @@ char *alloca ();
# endif
#endif
/* Disable assert() unless we're a maintainer.
Some asserts are compute-intensive. */
#ifndef MAKE_MAINTAINER_MODE
# define NDEBUG 1
#endif
/* Include the externally-visible content.
Be sure to use the local one, and not one installed on the system.
Define GMK_BUILDING_MAKE for proper selection of dllexport/dllimport
declarations for MS-Windows. */
#ifdef WINDOWS32
# define GMK_BUILDING_MAKE
#endif
#include "gnumake.h"
#ifdef CRAY
/* This must happen before #include <signal.h> so
@@ -60,13 +72,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 +102,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 +159,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. */
@@ -157,6 +173,9 @@ unsigned int get_path_max (void);
(! INTEGER_TYPE_SIGNED (t) ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))
#define INTEGER_TYPE_MAXIMUM(t) (~ (t) 0 - INTEGER_TYPE_MINIMUM (t))
/* The maximum number of digits needed to represent the largest integer. */
#define INTEGER_LENGTH sizeof("18446744073709551616")
#ifndef CHAR_MAX
# define CHAR_MAX INTEGER_TYPE_MAXIMUM (char)
#endif
@@ -178,6 +197,7 @@ unsigned int get_path_max (void);
#endif
#ifdef VMS
# include <fcntl.h>
# include <types.h>
# include <unixlib.h>
# include <unixio.h>
@@ -191,7 +211,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 +269,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 +285,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 +328,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 ':'
@@ -326,10 +353,17 @@ char *strsignal (int signum);
# include <malloc.h>
# define pipe(_p) _pipe((_p), 512, O_BINARY)
# define kill(_pid,_sig) w32_kill((_pid),(_sig))
/* MSVC doesn't have ftruncate. */
# ifdef _MSC_VER
# define ftruncate(_fd,_len) _chsize(_fd,_len)
# endif
/* MinGW64 doesn't have _S_ISDIR. */
# ifndef _S_ISDIR
# define _S_ISDIR(m) S_ISDIR(m)
# endif
void sync_Path_environment (void);
int w32_kill (pid_t pid, int sig);
char *end_of_token_w32 (const char *s, char stopchar);
int find_and_set_default_shell (const char *token);
/* indicates whether or not we have Bourne shell */
@@ -337,54 +371,70 @@ extern int no_default_sh_exe;
/* is default_shell unixy? */
extern int unixy_shell;
/* We don't have a preferred fixed value for LOCALEDIR. */
# ifndef LOCALEDIR
# define LOCALEDIR NULL
# endif
/* Include only the minimal stuff from windows.h. */
#define WIN32_LEAN_AND_MEAN
#endif /* WINDOWS32 */
#define ANY_SET(_v,_m) (((_v)&(_m)) != 0)
#define NONE_SET(_v,_m) (! ANY_SET ((_v),(_m)))
#define MAP_NUL 0x0001
#define MAP_BLANK 0x0002
#define MAP_SPACE 0x0004
#define MAP_COMMENT 0x0008
#define MAP_SEMI 0x0010
#define MAP_EQUALS 0x0020
#define MAP_COLON 0x0040
#define MAP_PERCENT 0x0080
#define MAP_PIPE 0x0100
#define MAP_DOT 0x0200
#define MAP_COMMA 0x0400
/* This means not only a '$', but skip the variable reference. */
#define MAP_VARIABLE 0x4000
/* The set of characters which are path separators is OS-specific. */
#define MAP_PATHSEP 0x8000
#ifdef VMS
# define MAP_VMSCOMMA MAP_COMMA
#else
# define MAP_VMSCOMMA 0x0000
#endif
#define STOP_SET(_v,_m) ANY_SET (stopchar_map[(int)(_v)],(_m))
#if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT)
# define SET_STACK_SIZE
#endif
#ifdef SET_STACK_SIZE
# include <sys/resource.h>
struct rlimit stack_limit;
extern struct rlimit stack_limit;
#endif
struct floc
{
const char *filenm;
unsigned long lineno;
};
#define NILF ((struct floc *)0)
#define NILF ((gmk_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
variadic versions of these functions. */
#if HAVE_STDARG_H || HAVE_VARARGS_H
# if HAVE_VPRINTF || HAVE_DOPRNT
# define USE_VARIADIC 1
# endif
#endif
#if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
const char *concat (unsigned int, ...);
void message (int prefix, const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
void error (const struct floc *flocp, const char *fmt, ...)
void error (const gmk_floc *flocp, const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
void fatal (const struct floc *flocp, const char *fmt, ...)
void fatal (const gmk_floc *flocp, const char *fmt, ...)
__attribute__ ((noreturn, __format__ (__printf__, 2, 3)));
#else
const char *concat ();
void message ();
void error ();
void fatal ();
#endif
void die (int) __attribute__ ((noreturn));
void log_working_directory (int);
void pfatal_with_name (const char *) __attribute__ ((noreturn));
void perror_with_name (const char *, const char *);
#define xstrlen(_s) ((_s)==NULL ? 0 : strlen (_s))
void *xmalloc (unsigned int);
void *xcalloc (unsigned int);
void *xrealloc (void *, unsigned int);
@@ -399,7 +449,6 @@ int alpha_compare (const void *, const void *);
void print_spaces (unsigned int);
char *find_percent (char *);
const char *find_percent_cached (const char **);
FILE *open_tmpfile (char **, const char *);
#ifndef NO_ARCHIVES
int ar_name (const char *);
@@ -408,9 +457,9 @@ int ar_touch (const char *);
time_t ar_member_date (const char *);
typedef long int (*ar_member_func_t) (int desc, const char *mem, int truncated,
long int hdrpos, long int datapos,
long int size, long int date, int uid,
int gid, int mode, const void *arg);
long int hdrpos, long int datapos,
long int size, long int date, int uid,
int gid, int mode, const void *arg);
long int ar_scan (const char *archive, ar_member_func_t function, const void *arg);
int ar_name_equal (const char *name, const char *mem, int truncated);
@@ -427,6 +476,7 @@ const char *dir_name (const char *);
void hash_init_directories (void);
void define_default_variables (void);
void undefine_default_variables (void);
void set_default_suffixes (void);
void install_default_suffix_rules (void);
void install_default_implicit_rules (void);
@@ -443,8 +493,6 @@ void user_access (void);
void make_access (void);
void child_access (void);
void close_stdout (void);
char *strip_whitespace (const char **begpp, const char **endpp);
/* String caching */
@@ -452,13 +500,19 @@ 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);
#ifdef HAVE_VFORK_H
# include <vfork.h>
/* Guile support */
#ifdef HAVE_GUILE
int guile_gmake_setup (const gmk_floc *flocp);
#endif
/* Loadable object support. Sets to the strcached name of the loaded file. */
typedef int (*load_func_t)(const gmk_floc *flocp);
int load_file (const gmk_floc *flocp, const char **filename, int noerror);
void unload_file (const char *name);
/* We omit these declarations on non-POSIX systems which define _POSIX_VERSION,
because such systems often declare them in header files anyway. */
@@ -502,18 +556,25 @@ int strncasecmp (const char *s1, const char *s2, int n);
# endif
#endif
extern const struct floc *reading_file;
extern const struct floc **expanding_var;
#define OUTPUT_SYNC_NONE 0
#define OUTPUT_SYNC_LINE 1
#define OUTPUT_SYNC_TARGET 2
#define OUTPUT_SYNC_RECURSE 3
extern const gmk_floc *reading_file;
extern const gmk_floc **expanding_var;
extern char **environ;
extern unsigned short stopchar_map[];
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, output_sync, verify_flag;
/* can we run commands via 'sh -c xxx' or must we use batch files? */
extern int batch_mode_shell;

431
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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -16,42 +14,21 @@ 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 "makeint.h"
#include "filedef.h"
#include "dep.h"
#include "debug.h"
/* Variadic functions. We go through contortions to allow proper function
prototypes for both ANSI and pre-ANSI C compilers, and also for those
which support stdarg.h vs. varargs.h, and finally those which have
vfprintf(), etc. and those who have _doprnt... or nothing.
/* GNU make no longer supports pre-ANSI89 environments. */
This fancy stuff all came from GNU fileutils, except for the VA_PRINTF and
VA_END macros used here since we have multiple print functions. */
#include <stdarg.h>
#if USE_VARIADIC
# if HAVE_STDARG_H
# include <stdarg.h>
# define VA_START(args, lastarg) va_start(args, lastarg)
# else
# include <varargs.h>
# define VA_START(args, lastarg) va_start(args)
# endif
# if HAVE_VPRINTF
# define VA_PRINTF(fp, lastarg, args) vfprintf((fp), (lastarg), (args))
# else
# define VA_PRINTF(fp, lastarg, args) _doprnt((lastarg), (args), (fp))
# endif
# define VA_END(args) va_end(args)
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#else
/* We can't use any variadic interface! */
# define va_alist a1, a2, a3, a4, a5, a6, a7, a8
# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
# define VA_START(args, lastarg)
# define VA_PRINTF(fp, lastarg, args) fprintf((fp), (lastarg), va_alist)
# define VA_END(args)
# include <sys/file.h>
#endif
/* Compare strings *S1 and *S2.
Return negative if the first is less, positive if it is greater,
zero if they are equal. */
@@ -74,9 +51,7 @@ alpha_compare (const void *v1, const void *v2)
void
collapse_continuations (char *line)
{
register char *in, *out, *p;
register int backslash;
register unsigned int bs_write;
char *in, *out, *p;
in = strchr (line, '\n');
if (in == 0)
@@ -89,62 +64,64 @@ collapse_continuations (char *line)
while (*in != '\0')
{
/* BS_WRITE gets the number of quoted backslashes at
the end just before IN, and BACKSLASH gets nonzero
if the next character is quoted. */
backslash = 0;
bs_write = 0;
the end just before IN, and BACKSLASH gets nonzero
if the next character is quoted. */
unsigned int backslash = 0;
unsigned int bs_write = 0;
for (p = in - 1; p >= line && *p == '\\'; --p)
{
if (backslash)
++bs_write;
backslash = !backslash;
{
if (backslash)
++bs_write;
backslash = !backslash;
/* It should be impossible to go back this far without exiting,
but if we do, we can't get the right answer. */
if (in == out - 1)
abort ();
}
/* It should be impossible to go back this far without exiting,
but if we do, we can't get the right answer. */
if (in == out - 1)
abort ();
}
/* Output the appropriate number of backslashes. */
while (bs_write-- > 0)
*out++ = '\\';
*out++ = '\\';
/* 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)
{
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;
*out++ = ' ';
}
{
/* 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);
if (! posix_pedantic)
while (out > line && isblank ((unsigned char)out[-1]))
--out;
*out++ = ' ';
}
else
/* If the newline isn't quoted, put it in the output. */
*out++ = '\n';
/* If the newline isn't quoted, put it in the output. */
*out++ = '\n';
/* Now copy the following line to the output.
Stop when we find backslashes followed by a newline. */
Stop when we find backslashes followed by a newline. */
while (*in != '\0')
if (*in == '\\')
{
p = in + 1;
while (*p == '\\')
++p;
if (*p == '\n')
{
in = p;
break;
}
while (in < p)
*out++ = *in++;
}
else
*out++ = *in++;
if (*in == '\\')
{
p = in + 1;
while (*p == '\\')
++p;
if (*p == '\n')
{
in = p;
break;
}
while (in < p)
*out++ = *in++;
}
else
*out++ = *in++;
}
*out = '\0';
@@ -164,28 +141,19 @@ print_spaces (unsigned int n)
This string lives in static, re-used memory. */
const char *
#if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
concat (unsigned int num, ...)
#else
concat (num, va_alist)
unsigned int num;
va_dcl
#endif
{
static unsigned int rlen = 0;
static char *result = NULL;
int ri = 0;
#if USE_VARIADIC
unsigned int ri = 0;
va_list args;
#endif
VA_START (args, num);
va_start (args, num);
while (num-- > 0)
{
const char *s = va_arg (args, const char *);
unsigned int l = s ? strlen (s) : 0;
unsigned int l = xstrlen (s);
if (l == 0)
continue;
@@ -200,7 +168,7 @@ concat (num, va_alist)
ri += l;
}
VA_END (args);
va_end (args);
/* Get some more memory if we don't have enough space for the
terminating '\0'. */
@@ -215,113 +183,9 @@ concat (num, va_alist)
return result;
}
/* Print a message on stdout. */
void
#if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
message (int prefix, const char *fmt, ...)
#else
message (prefix, fmt, va_alist)
int prefix;
const char *fmt;
va_dcl
#endif
{
#if USE_VARIADIC
va_list args;
#endif
log_working_directory (1);
if (fmt != 0)
{
if (prefix)
{
if (makelevel == 0)
printf ("%s: ", program);
else
printf ("%s[%u]: ", program, makelevel);
}
VA_START (args, fmt);
VA_PRINTF (stdout, fmt, args);
VA_END (args);
putchar ('\n');
}
fflush (stdout);
}
/* Print an error message. */
void
#if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
error (const struct floc *flocp, const char *fmt, ...)
#else
error (flocp, fmt, va_alist)
const struct floc *flocp;
const char *fmt;
va_dcl
#endif
{
#if USE_VARIADIC
va_list args;
#endif
log_working_directory (1);
if (flocp && flocp->filenm)
fprintf (stderr, "%s:%lu: ", flocp->filenm, flocp->lineno);
else if (makelevel == 0)
fprintf (stderr, "%s: ", program);
else
fprintf (stderr, "%s[%u]: ", program, makelevel);
VA_START(args, fmt);
VA_PRINTF (stderr, fmt, args);
VA_END (args);
putc ('\n', stderr);
fflush (stderr);
}
/* Print an error message and exit. */
void
#if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
fatal (const struct floc *flocp, const char *fmt, ...)
#else
fatal (flocp, fmt, va_alist)
const struct floc *flocp;
const char *fmt;
va_dcl
#endif
{
#if USE_VARIADIC
va_list args;
#endif
log_working_directory (1);
if (flocp && flocp->filenm)
fprintf (stderr, "%s:%lu: *** ", flocp->filenm, flocp->lineno);
else if (makelevel == 0)
fprintf (stderr, "%s: *** ", program);
else
fprintf (stderr, "%s[%u]: *** ", program, makelevel);
VA_START(args, fmt);
VA_PRINTF (stderr, fmt, args);
VA_END (args);
fputs (_(". Stop.\n"), stderr);
die (2);
}
#ifndef HAVE_STRERROR
#undef strerror
#undef strerror
char *
strerror (int errnum)
{
@@ -338,24 +202,6 @@ strerror (int errnum)
return buf;
}
#endif
/* Print an error message from errno. */
void
perror_with_name (const char *str, const char *name)
{
error (NILF, _("%s%s: %s"), str, name, strerror (errno));
}
/* Print an error message from errno and exit. */
void
pfatal_with_name (const char *name)
{
fatal (NILF, _("%s: %s"), name, strerror (errno));
/* NOTREACHED */
}
/* Like malloc but get fatal error if memory is exhausted. */
/* Don't bother if we're using dmalloc; it provides these for us. */
@@ -468,41 +314,11 @@ lindex (const char *s, const char *limit, int c)
char *
end_of_token (const char *s)
{
while (*s != '\0' && !isblank ((unsigned char)*s))
while (! STOP_SET (*s, MAP_BLANK|MAP_NUL))
++s;
return (char *)s;
}
#ifdef WINDOWS32
/*
* Same as end_of_token, but take into account a stop character
*/
char *
end_of_token_w32 (const char *s, char stopchar)
{
const char *p = s;
int backslash = 0;
while (*p != '\0' && *p != stopchar
&& (backslash || !isblank ((unsigned char)*p)))
{
if (*p++ == '\\')
{
backslash = !backslash;
while (*p == '\\')
{
backslash = !backslash;
++p;
}
}
else
backslash = 0;
}
return (char *)p;
}
#endif
/* Return the address of the first nonwhitespace or null in the string S. */
char *
@@ -533,7 +349,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)
@@ -551,9 +367,9 @@ copy_dep_chain (const struct dep *d)
c->next = 0;
if (firstnew == 0)
firstnew = lastnew = c;
firstnew = lastnew = c;
else
lastnew = lastnew->next = c;
lastnew = lastnew->next = c;
d = d->next;
}
@@ -590,7 +406,6 @@ free_ns_chain (struct nameseq *ns)
#if !HAVE_STRCASECMP && !HAVE_STRICMP && !HAVE_STRCMPI
/* If we don't have strcasecmp() (from POSIX), or anything that can substitute
for it, define our own version. */
@@ -616,7 +431,6 @@ strcasecmp (const char *s1, const char *s2)
#endif
#if !HAVE_STRNCASECMP && !HAVE_STRNICMP && !HAVE_STRNCMPI
/* If we don't have strncasecmp() (from POSIX), or anything that can
substitute for it, define our own version. */
@@ -643,7 +457,7 @@ strncasecmp (const char *s1, const char *s2, int n)
}
#endif
#ifdef GETLOADAVG_PRIVILEGED
#ifdef GETLOADAVG_PRIVILEGED
#ifdef POSIX
@@ -656,7 +470,7 @@ strncasecmp (const char *s1, const char *s2, int n)
#undef HAVE_SETREUID
#undef HAVE_SETREGID
#else /* Not POSIX. */
#else /* Not POSIX. */
/* Some POSIX.1 systems have the seteuid and setegid functions. In a
POSIX-like system, they are the best thing to use. However, some
@@ -666,30 +480,30 @@ strncasecmp (const char *s1, const char *s2, int n)
#undef HAVE_SETEUID
#undef HAVE_SETEGID
#endif /* POSIX. */
#endif /* POSIX. */
#ifndef HAVE_UNISTD_H
#ifndef HAVE_UNISTD_H
extern int getuid (), getgid (), geteuid (), getegid ();
extern int setuid (), setgid ();
#ifdef HAVE_SETEUID
extern int seteuid ();
#else
#ifdef HAVE_SETREUID
#ifdef HAVE_SETREUID
extern int setreuid ();
#endif /* Have setreuid. */
#endif /* Have seteuid. */
#endif /* Have setreuid. */
#endif /* Have seteuid. */
#ifdef HAVE_SETEGID
extern int setegid ();
#else
#ifdef HAVE_SETREGID
#ifdef HAVE_SETREGID
extern int setregid ();
#endif /* Have setregid. */
#endif /* Have setegid. */
#endif /* No <unistd.h>. */
#endif /* Have setregid. */
#endif /* Have setegid. */
#endif /* No <unistd.h>. */
/* Keep track of the user and group IDs for user- and make- access. */
static int user_uid = -1, user_gid = -1, make_uid = -1, make_gid = -1;
#define access_inited (user_uid != -1)
#define access_inited (user_uid != -1)
static enum { make, user } current_access;
@@ -706,7 +520,7 @@ log_access (const char *flavor)
run in a child fork whose stdout is piped. */
fprintf (stderr, _("%s: user %lu (real %lu), group %lu (real %lu)\n"),
flavor, (unsigned long) geteuid (), (unsigned long) getuid (),
flavor, (unsigned long) geteuid (), (unsigned long) getuid (),
(unsigned long) getegid (), (unsigned long) getgid ());
fflush (stderr);
}
@@ -732,14 +546,14 @@ init_access (void)
#endif
}
#endif /* GETLOADAVG_PRIVILEGED */
#endif /* GETLOADAVG_PRIVILEGED */
/* Give the process appropriate permissions for access to
user data (i.e., to stat files, or to spawn a child process). */
void
user_access (void)
{
#ifdef GETLOADAVG_PRIVILEGED
#ifdef GETLOADAVG_PRIVILEGED
if (!access_inited)
init_access ();
@@ -752,7 +566,7 @@ user_access (void)
We now want to set the effective user and group IDs to the real IDs,
which are the IDs of the process that exec'd make. */
#ifdef HAVE_SETEUID
#ifdef HAVE_SETEUID
/* Modern systems have the seteuid/setegid calls which set only the
effective IDs, which is ideal. */
@@ -760,9 +574,9 @@ user_access (void)
if (seteuid (user_uid) < 0)
pfatal_with_name ("user_access: seteuid");
#else /* Not HAVE_SETEUID. */
#else /* Not HAVE_SETEUID. */
#ifndef HAVE_SETREUID
#ifndef HAVE_SETREUID
/* System V has only the setuid/setgid calls to set user/group IDs.
There is an effective ID, which can be set by setuid/setgid.
@@ -775,7 +589,7 @@ user_access (void)
if (setuid (user_uid) < 0)
pfatal_with_name ("user_access: setuid");
#else /* HAVE_SETREUID. */
#else /* HAVE_SETREUID. */
/* In 4BSD, the setreuid/setregid calls set both the real and effective IDs.
They may be set to themselves or each other. So you have two alternatives
@@ -787,14 +601,14 @@ user_access (void)
if (setreuid (make_uid, user_uid) < 0)
pfatal_with_name ("user_access: setreuid");
#endif /* Not HAVE_SETREUID. */
#endif /* HAVE_SETEUID. */
#endif /* Not HAVE_SETREUID. */
#endif /* HAVE_SETEUID. */
#ifdef HAVE_SETEGID
#ifdef HAVE_SETEGID
if (setegid (user_gid) < 0)
pfatal_with_name ("user_access: setegid");
#else
#ifndef HAVE_SETREGID
#ifndef HAVE_SETREGID
if (setgid (user_gid) < 0)
pfatal_with_name ("user_access: setgid");
#else
@@ -807,7 +621,7 @@ user_access (void)
log_access (_("User access"));
#endif /* GETLOADAVG_PRIVILEGED */
#endif /* GETLOADAVG_PRIVILEGED */
}
/* Give the process appropriate permissions for access to
@@ -815,7 +629,7 @@ user_access (void)
void
make_access (void)
{
#ifdef GETLOADAVG_PRIVILEGED
#ifdef GETLOADAVG_PRIVILEGED
if (!access_inited)
init_access ();
@@ -825,11 +639,11 @@ make_access (void)
/* See comments in user_access, above. */
#ifdef HAVE_SETEUID
#ifdef HAVE_SETEUID
if (seteuid (make_uid) < 0)
pfatal_with_name ("make_access: seteuid");
#else
#ifndef HAVE_SETREUID
#ifndef HAVE_SETREUID
if (setuid (make_uid) < 0)
pfatal_with_name ("make_access: setuid");
#else
@@ -838,11 +652,11 @@ make_access (void)
#endif
#endif
#ifdef HAVE_SETEGID
#ifdef HAVE_SETEGID
if (setegid (make_gid) < 0)
pfatal_with_name ("make_access: setegid");
#else
#ifndef HAVE_SETREGID
#ifndef HAVE_SETREGID
if (setgid (make_gid) < 0)
pfatal_with_name ("make_access: setgid");
#else
@@ -855,7 +669,7 @@ make_access (void)
log_access (_("Make access"));
#endif /* GETLOADAVG_PRIVILEGED */
#endif /* GETLOADAVG_PRIVILEGED */
}
/* Give the process appropriate permissions for a child process.
@@ -863,7 +677,7 @@ make_access (void)
void
child_access (void)
{
#ifdef GETLOADAVG_PRIVILEGED
#ifdef GETLOADAVG_PRIVILEGED
if (!access_inited)
abort ();
@@ -871,7 +685,7 @@ child_access (void)
/* Set both the real and effective UID and GID to the user's.
They cannot be changed back to make's. */
#ifndef HAVE_SETREUID
#ifndef HAVE_SETREUID
if (setuid (user_uid) < 0)
pfatal_with_name ("child_access: setuid");
#else
@@ -879,7 +693,7 @@ child_access (void)
pfatal_with_name ("child_access: setreuid");
#endif
#ifndef HAVE_SETREGID
#ifndef HAVE_SETREGID
if (setgid (user_gid) < 0)
pfatal_with_name ("child_access: setgid");
#else
@@ -889,9 +703,9 @@ child_access (void)
log_access (_("Child access"));
#endif /* GETLOADAVG_PRIVILEGED */
#endif /* GETLOADAVG_PRIVILEGED */
}
#ifdef NEED_GET_PATH_MAX
unsigned int
get_path_max (void)
@@ -902,58 +716,11 @@ get_path_max (void)
{
long int x = pathconf ("/", _PC_PATH_MAX);
if (x > 0)
value = x;
value = x;
else
return MAXPATHLEN;
return MAXPATHLEN;
}
return value;
}
#endif
/* This code is stolen from gnulib.
If/when we abandon the requirement to work with K&R compilers, we can
remove this (and perhaps other parts of GNU make!) and migrate to using
gnulib directly.
This is called only through atexit(), which means die() has already been
invoked. So, call exit() here directly. Apparently that works...?
*/
/* Close standard output, exiting with status 'exit_failure' on failure.
If a program writes *anything* to stdout, that program should close
stdout and make sure that it succeeds before exiting. Otherwise,
suppose that you go to the extreme of checking the return status
of every function that does an explicit write to stdout. The last
printf can succeed in writing to the internal stream buffer, and yet
the fclose(stdout) could still fail (due e.g., to a disk full error)
when it tries to write out that buffered data. Thus, you would be
left with an incomplete output file and the offending program would
exit successfully. Even calling fflush is not always sufficient,
since some file systems (NFS and CODA) buffer written/flushed data
until an actual close call.
Besides, it's wasteful to check the return value from every call
that writes to stdout -- just let the internal stream state record
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
on being able to detect failure in other tools via their exit status. */
void
close_stdout (void)
{
int prev_fail = ferror (stdout);
int fclose_fail = fclose (stdout);
if (prev_fail || fclose_fail)
{
if (fclose_fail)
error (NILF, _("write error: %s"), strerror (errno));
else
error (NILF, _("write error"));
exit (EXIT_FAILURE);
}
}

762
output.c Normal file
View File

@@ -0,0 +1,762 @@
/* Output to stdout / stderr for GNU make
Copyright (C) 2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */
#include "makeint.h"
#include "job.h"
/* GNU make no longer supports pre-ANSI89 environments. */
#include <assert.h>
#include <stdio.h>
#include <stdarg.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#else
# include <sys/file.h>
#endif
#ifdef WINDOWS32
# include <windows.h>
# include <io.h>
# include "sub_proc.h"
#endif /* WINDOWS32 */
struct output *output_context = NULL;
unsigned int stdio_traced = 0;
#define OUTPUT_NONE (-1)
#define OUTPUT_ISSET(_out) ((_out)->out >= 0 || (_out)->err >= 0)
#ifdef HAVE_FCNTL
# define STREAM_OK(_s) ((fcntl (fileno (_s), F_GETFD) != -1) || (errno != EBADF))
#else
# define STREAM_OK(_s) 1
#endif
/* I really want to move to gnulib. However, this is a big undertaking
especially for non-UNIX platforms: how to get bootstrapping to work, etc.
I don't want to take the time to do it right now. Use a hack to get a
useful version of vsnprintf() for Windows. */
#ifdef __VMS
# define va_copy(_d, _s) ((_d) = (_s))
#endif
#ifdef _MSC_VER
# define va_copy(_d, _s) ((_d) = (_s))
# define snprintf msc_vsnprintf
static int
msc_vsnprintf (char *str, size_t size, const char *format, va_list ap)
{
int len = -1;
if (size > 0)
len = _vsnprintf_s (str, size, _TRUNCATE, format, ap);
if (len == -1)
len = _vscprintf (format, ap);
return len;
}
#endif
/* Write a string to the current STDOUT or STDERR. */
static void
_outputs (struct output *out, int is_err, const char *msg)
{
if (! out || ! out->syncout)
{
FILE *f = is_err ? stderr : stdout;
fputs (msg, f);
fflush (f);
}
else
{
int fd = is_err ? out->err : out->out;
int len = strlen (msg);
int r;
EINTRLOOP (r, lseek (fd, 0, SEEK_END));
while (1)
{
EINTRLOOP (r, write (fd, msg, len));
if (r == len || r <= 0)
break;
len -= r;
msg += r;
}
}
}
/* Write a message indicating that we've just entered or
left (according to ENTERING) the current directory. */
static int
log_working_directory (int entering)
{
static char *buf = NULL;
static unsigned int len = 0;
unsigned int need;
const char *fmt;
char *p;
/* Get enough space for the longest possible output. */
need = strlen (program) + INTEGER_LENGTH + 2 + 1;
if (starting_directory)
need += strlen (starting_directory);
/* Use entire sentences to give the translators a fighting chance. */
if (makelevel == 0)
if (starting_directory == 0)
if (entering)
fmt = _("%s: Entering an unknown directory\n");
else
fmt = _("%s: Leaving an unknown directory\n");
else
if (entering)
fmt = _("%s: Entering directory '%s'\n");
else
fmt = _("%s: Leaving directory '%s'\n");
else
if (starting_directory == 0)
if (entering)
fmt = _("%s[%u]: Entering an unknown directory\n");
else
fmt = _("%s[%u]: Leaving an unknown directory\n");
else
if (entering)
fmt = _("%s[%u]: Entering directory '%s'\n");
else
fmt = _("%s[%u]: Leaving directory '%s'\n");
need += strlen (fmt);
if (need > len)
{
buf = xrealloc (buf, need);
len = need;
}
p = buf;
if (print_data_base_flag)
{
*(p++) = '#';
*(p++) = ' ';
}
if (makelevel == 0)
if (starting_directory == 0)
sprintf (p, fmt , program);
else
sprintf (p, fmt, program, starting_directory);
else if (starting_directory == 0)
sprintf (p, fmt, program, makelevel);
else
sprintf (p, fmt, program, makelevel, starting_directory);
_outputs (NULL, 0, buf);
return 1;
}
/* Set a file descriptor to be in O_APPEND mode.
If it fails, just ignore it. */
static void
set_append_mode (int fd)
{
#if defined(F_GETFL) && defined(F_SETFL) && defined(O_APPEND)
int flags = fcntl (fd, F_GETFL, 0);
if (flags >= 0)
fcntl (fd, F_SETFL, flags | O_APPEND);
#endif
}
#ifndef NO_OUTPUT_SYNC
/* Semaphore for use in -j mode with output_sync. */
static sync_handle_t sync_handle = -1;
#define FD_NOT_EMPTY(_f) ((_f) != OUTPUT_NONE && lseek ((_f), 0, SEEK_END) > 0)
/* Set up the sync handle. Disables output_sync on error. */
static int
sync_init ()
{
int combined_output = 0;
#ifdef WINDOWS32
if ((!STREAM_OK (stdout) && !STREAM_OK (stderr))
|| (sync_handle = create_mutex ()) == -1)
{
perror_with_name ("output-sync suppressed: ", "stderr");
output_sync = 0;
}
else
{
combined_output = same_stream (stdout, stderr);
prepare_mutex_handle_string (sync_handle);
}
#else
if (STREAM_OK (stdout))
{
struct stat stbuf_o, stbuf_e;
sync_handle = fileno (stdout);
combined_output = (fstat (fileno (stdout), &stbuf_o) == 0
&& fstat (fileno (stderr), &stbuf_e) == 0
&& stbuf_o.st_dev == stbuf_e.st_dev
&& stbuf_o.st_ino == stbuf_e.st_ino);
}
else if (STREAM_OK (stderr))
sync_handle = fileno (stderr);
else
{
perror_with_name ("output-sync suppressed: ", "stderr");
output_sync = 0;
}
#endif
return combined_output;
}
/* Support routine for output_sync() */
static void
pump_from_tmp (int from, FILE *to)
{
static char buffer[8192];
#ifdef WINDOWS32
int prev_mode;
/* "from" is opened by open_tmpfd, which does it in binary mode, so
we need the mode of "to" to match that. */
prev_mode = _setmode (fileno (to), _O_BINARY);
#endif
if (lseek (from, 0, SEEK_SET) == -1)
perror ("lseek()");
while (1)
{
int len;
EINTRLOOP (len, read (from, buffer, sizeof (buffer)));
if (len < 0)
perror ("read()");
if (len <= 0)
break;
if (fwrite (buffer, len, 1, to) < 1)
perror ("fwrite()");
}
#ifdef WINDOWS32
/* Switch "to" back to its original mode, so that log messages by
Make have the same EOL format as without --output-sync. */
_setmode (fileno (to), prev_mode);
#endif
}
/* Obtain the lock for writing output. */
static void *
acquire_semaphore (void)
{
static struct flock fl;
fl.l_type = F_WRLCK;
fl.l_whence = SEEK_SET;
fl.l_start = 0;
fl.l_len = 1;
if (fcntl (sync_handle, F_SETLKW, &fl) != -1)
return &fl;
perror ("fcntl()");
return NULL;
}
/* Release the lock for writing output. */
static void
release_semaphore (void *sem)
{
struct flock *flp = (struct flock *)sem;
flp->l_type = F_UNLCK;
if (fcntl (sync_handle, F_SETLKW, flp) == -1)
perror ("fcntl()");
}
/* Returns a file descriptor to a temporary file. The file is automatically
closed/deleted on exit. Don't use a FILE* stream. */
int
output_tmpfd ()
{
int fd = -1;
FILE *tfile = tmpfile ();
if (! tfile)
pfatal_with_name ("tmpfile");
/* Create a duplicate so we can close the stream. */
fd = dup (fileno (tfile));
if (fd < 0)
pfatal_with_name ("dup");
fclose (tfile);
set_append_mode (fd);
return fd;
}
/* Adds file descriptors to the child structure to support output_sync; one
for stdout and one for stderr as long as they are open. If stdout and
stderr share a device they can share a temp file too.
Will reset output_sync on error. */
static void
setup_tmpfile (struct output *out)
{
/* Is make's stdout going to the same place as stderr? */
static int combined_output = -1;
if (combined_output < 0)
combined_output = sync_init ();
if (STREAM_OK (stdout))
{
int fd = output_tmpfd ();
if (fd < 0)
goto error;
CLOSE_ON_EXEC (fd);
out->out = fd;
}
if (STREAM_OK (stderr))
{
if (out->out != OUTPUT_NONE && combined_output)
out->err = out->out;
else
{
int fd = output_tmpfd ();
if (fd < 0)
goto error;
CLOSE_ON_EXEC (fd);
out->err = fd;
}
}
return;
/* If we failed to create a temp file, disable output sync going forward. */
error:
output_close (out);
output_sync = 0;
}
/* Synchronize the output of jobs in -j mode to keep the results of
each job together. This is done by holding the results in temp files,
one for stdout and potentially another for stderr, and only releasing
them to "real" stdout/stderr when a semaphore can be obtained. */
void
output_dump (struct output *out)
{
int outfd_not_empty = FD_NOT_EMPTY (out->out);
int errfd_not_empty = FD_NOT_EMPTY (out->err);
if (outfd_not_empty || errfd_not_empty)
{
int traced = 0;
/* Try to acquire the semaphore. If it fails, dump the output
unsynchronized; still better than silently discarding it.
We want to keep this lock for as little time as possible. */
void *sem = acquire_semaphore ();
/* Log the working directory for this dump. */
if (print_directory_flag && output_sync != OUTPUT_SYNC_RECURSE)
traced = log_working_directory (1);
if (outfd_not_empty)
pump_from_tmp (out->out, stdout);
if (errfd_not_empty && out->err != out->out)
pump_from_tmp (out->err, stderr);
if (traced)
log_working_directory (0);
/* Exit the critical section. */
if (sem)
release_semaphore (sem);
/* Truncate and reset the output, in case we use it again. */
if (out->out != OUTPUT_NONE)
{
int e;
lseek (out->out, 0, SEEK_SET);
EINTRLOOP (e, ftruncate (out->out, 0));
}
if (out->err != OUTPUT_NONE && out->err != out->out)
{
int e;
lseek (out->err, 0, SEEK_SET);
EINTRLOOP (e, ftruncate (out->err, 0));
}
}
}
#endif /* NO_OUTPUT_SYNC */
/* Provide support for temporary files. */
#ifndef HAVE_STDLIB_H
# ifdef HAVE_MKSTEMP
int mkstemp (char *template);
# else
char *mktemp (char *template);
# endif
#endif
FILE *
output_tmpfile (char **name, const char *template)
{
#ifdef HAVE_FDOPEN
int fd;
#endif
#if defined HAVE_MKSTEMP || defined HAVE_MKTEMP
# define TEMPLATE_LEN strlen (template)
#else
# define TEMPLATE_LEN L_tmpnam
#endif
*name = xmalloc (TEMPLATE_LEN + 1);
strcpy (*name, template);
#if defined HAVE_MKSTEMP && defined HAVE_FDOPEN
/* It's safest to use mkstemp(), if we can. */
fd = mkstemp (*name);
if (fd == -1)
return 0;
return fdopen (fd, "w");
#else
# ifdef HAVE_MKTEMP
(void) mktemp (*name);
# else
(void) tmpnam (*name);
# endif
# ifdef HAVE_FDOPEN
/* Can't use mkstemp(), but guard against a race condition. */
fd = open (*name, O_CREAT|O_EXCL|O_WRONLY, 0600);
if (fd == -1)
return 0;
return fdopen (fd, "w");
# else
/* Not secure, but what can we do? */
return fopen (*name, "w");
# endif
#endif
}
/* This code is stolen from gnulib.
If/when we abandon the requirement to work with K&R compilers, we can
remove this (and perhaps other parts of GNU make!) and migrate to using
gnulib directly.
This is called only through atexit(), which means die() has already been
invoked. So, call exit() here directly. Apparently that works...?
*/
/* Close standard output, exiting with status 'exit_failure' on failure.
If a program writes *anything* to stdout, that program should close
stdout and make sure that it succeeds before exiting. Otherwise,
suppose that you go to the extreme of checking the return status
of every function that does an explicit write to stdout. The last
printf can succeed in writing to the internal stream buffer, and yet
the fclose(stdout) could still fail (due e.g., to a disk full error)
when it tries to write out that buffered data. Thus, you would be
left with an incomplete output file and the offending program would
exit successfully. Even calling fflush is not always sufficient,
since some file systems (NFS and CODA) buffer written/flushed data
until an actual close call.
Besides, it's wasteful to check the return value from every call
that writes to stdout -- just let the internal stream state record
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
on being able to detect failure in other tools via their exit status. */
static void
close_stdout (void)
{
int prev_fail = ferror (stdout);
int fclose_fail = fclose (stdout);
if (prev_fail || fclose_fail)
{
if (fclose_fail)
error (NILF, _("write error: %s"), strerror (errno));
else
error (NILF, _("write error"));
exit (EXIT_FAILURE);
}
}
void
output_init (struct output *out)
{
if (out)
{
out->out = out->err = OUTPUT_NONE;
out->syncout = !!output_sync;
return;
}
/* Configure this instance of make. Be sure stdout is line-buffered. */
#ifdef HAVE_SETVBUF
# ifdef SETVBUF_REVERSED
setvbuf (stdout, _IOLBF, xmalloc (BUFSIZ), BUFSIZ);
# else /* setvbuf not reversed. */
/* Some buggy systems lose if we pass 0 instead of allocating ourselves. */
setvbuf (stdout, 0, _IOLBF, BUFSIZ);
# endif /* setvbuf reversed. */
#elif HAVE_SETLINEBUF
setlinebuf (stdout);
#endif /* setlinebuf missing. */
/* Force stdout/stderr into append mode. This ensures parallel jobs won't
lose output due to overlapping writes. */
set_append_mode (fileno (stdout));
set_append_mode (fileno (stderr));
#ifdef HAVE_ATEXIT
if (STREAM_OK (stdout))
atexit (close_stdout);
#endif
}
void
output_close (struct output *out)
{
if (! out)
{
if (stdio_traced)
log_working_directory (0);
return;
}
#ifndef NO_OUTPUT_SYNC
output_dump (out);
#endif
if (out->out >= 0)
close (out->out);
if (out->err >= 0 && out->err != out->out)
close (out->err);
output_init (out);
}
/* We're about to generate output: be sure it's set up. */
void
output_start ()
{
#ifndef NO_OUTPUT_SYNC
/* If we're syncing output make sure the temporary file is set up. */
if (output_context && output_context->syncout)
if (! OUTPUT_ISSET(output_context))
setup_tmpfile (output_context);
#endif
/* If we're not syncing this output per-line or per-target, make sure we emit
the "Entering..." message where appropriate. */
if (output_sync == OUTPUT_SYNC_NONE || output_sync == OUTPUT_SYNC_RECURSE)
if (! stdio_traced && print_directory_flag)
stdio_traced = log_working_directory (1);
}
void
outputs (int is_err, const char *msg)
{
if (! msg || *msg == '\0')
return;
output_start ();
_outputs (output_context, is_err, msg);
}
/* Return formatted string buffers.
If we move to gnulib we can use vasnprintf() etc. to make this simpler.
Note these functions use a static buffer, so each call overwrites the
results of the previous call. */
static struct fmtstring
{
char *buffer;
unsigned int size;
unsigned int len;
} fmtbuf = { NULL, 0, 0 };
/* Concatenate a formatted string onto the format buffer. */
static const char *
vfmtconcat (const char *fmt, va_list args)
{
va_list vcopy;
int tot;
int unused = fmtbuf.size - fmtbuf.len;
va_copy (vcopy, args);
tot = vsnprintf (&fmtbuf.buffer[fmtbuf.len], unused, fmt, args);
assert (tot >= 0);
if (tot >= unused)
{
fmtbuf.size += tot * 2;
fmtbuf.buffer = xrealloc (fmtbuf.buffer, fmtbuf.size);
unused = fmtbuf.size - fmtbuf.len;
tot = vsnprintf (&fmtbuf.buffer[fmtbuf.len], unused, fmt, vcopy);
}
va_end (vcopy);
fmtbuf.len += tot;
return fmtbuf.buffer;
}
static const char *
fmtconcat (const char *fmt, ...)
{
const char *p;
va_list args;
va_start (args, fmt);
p = vfmtconcat (fmt, args);
va_end (args);
return p;
}
/* Print a message on stdout. */
void
message (int prefix, const char *fmt, ...)
{
va_list args;
assert (fmt != NULL);
fmtbuf.len = 0;
if (prefix)
{
if (makelevel == 0)
fmtconcat ("%s: ", program);
else
fmtconcat ("%s[%u]: ", program, makelevel);
}
va_start (args, fmt);
vfmtconcat (fmt, args);
va_end (args);
fmtconcat ("\n");
outputs (0, fmtbuf.buffer);
}
/* Print an error message. */
void
error (const gmk_floc *flocp, const char *fmt, ...)
{
va_list args;
assert (fmt != NULL);
fmtbuf.len = 0;
if (flocp && flocp->filenm)
fmtconcat ("%s:%lu: ", flocp->filenm, flocp->lineno);
else if (makelevel == 0)
fmtconcat ("%s: ", program);
else
fmtconcat ("%s[%u]: ", program, makelevel);
va_start (args, fmt);
vfmtconcat (fmt, args);
va_end (args);
fmtconcat ("\n");
outputs (1, fmtbuf.buffer);
}
/* Print an error message and exit. */
void
fatal (const gmk_floc *flocp, const char *fmt, ...)
{
va_list args;
assert (fmt != NULL);
fmtbuf.len = 0;
if (flocp && flocp->filenm)
fmtconcat ("%s:%lu: *** ", flocp->filenm, flocp->lineno);
else if (makelevel == 0)
fmtconcat ("%s: *** ", program);
else
fmtconcat ("%s[%u]: *** ", program, makelevel);
va_start (args, fmt);
vfmtconcat (fmt, args);
va_end (args);
fmtconcat (_(". Stop.\n"));
outputs (1, fmtbuf.buffer);
die (2);
}
/* Print an error message from errno. */
void
perror_with_name (const char *str, const char *name)
{
error (NILF, _("%s%s: %s"), str, name, strerror (errno));
}
/* Print an error message from errno and exit. */
void
pfatal_with_name (const char *name)
{
fatal (NILF, _("%s: %s"), name, strerror (errno));
/* NOTREACHED */
}

51
output.h Normal file
View File

@@ -0,0 +1,51 @@
/* Output to stdout / stderr for GNU make
Copyright (C) 2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>. */
struct output
{
int out;
int err;
unsigned int syncout:1; /* True if we want to synchronize output. */
};
extern struct output *output_context;
extern unsigned int stdio_traced;
#define OUTPUT_SET(_new) do{ output_context = (_new)->syncout ? (_new) : NULL; }while(0)
#define OUTPUT_UNSET() do{ output_context = NULL; }while(0)
#define OUTPUT_TRACED() do{ stdio_traced = 1; }while(0)
#define OUTPUT_IS_TRACED() (!!stdio_traced)
FILE *output_tmpfile (char **, const char *);
/* Initialize and close a child output structure: if NULL do this program's
output (this should only be done once). */
void output_init (struct output *out);
void output_close (struct output *out);
/* In situations where output may be about to be displayed but we're not
sure if we've set it up yet, call this. */
void output_start (void);
/* Show a message on stdout or stderr. Will start the output if needed. */
void outputs (int is_err, const char *msg);
#ifndef NO_OUTPUT_SYNC
int output_tmpfd (void);
/* Dump any child output content to stdout, and reset it. */
void output_dump (struct output *out);
#endif

View File

@@ -1,6 +0,0 @@
*.gmo *.mo *.pot *.po
Makefile Makefile.in Makefile.in.in Makevars.template
Rules-quot stamp-po
*.sed *.sin *.header
POTFILES

15
po/.gitignore vendored Normal file
View File

@@ -0,0 +1,15 @@
Makefile.in.in
Makevars.template
POTFILES
Rules-quot
boldquot.sed
en@boldquot.header
en@quot.header
insert-header.sin
make.pot
quot.sed
remove-potcdate.sin
remove-potcdate.sed
stamp-po
*.gmo
*.po

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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the

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-2013 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under

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-2013 Free Software Foundation, Inc.
# This file is part of GNU Make.
#
# GNU Make is free software; you can redistribute it and/or modify it under
@@ -24,11 +23,15 @@ expand.c
file.c
function.c
getopt.c
guile.c
hash.c
implicit.c
job.c
job.h
load.c
main.c
misc.c
output.c
read.c
remake.c
remote-cstms.c

View File

@@ -1,5 +1,5 @@
@echo off
@echo Windows32 CVS build preparation of config.h.W32 and NMakefile.
@echo Windows32 SCM build preparation of config.h.W32 and NMakefile.
if not exist config.h.W32 copy config.h.W32.template config.h.W32
if not exist config.h copy config.h.W32 config.h
if not exist NMakefile copy NMakefile.template NMakefile

1448
read.c

File diff suppressed because it is too large Load Diff

770
remake.c

File diff suppressed because it is too large Load Diff

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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -20,8 +18,7 @@ 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 "job.h"
#include "makeint.h"
#include "filedef.h"
#include "commands.h"
#include "job.h"
@@ -34,9 +31,9 @@ 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"
#define EXPORT_COMMAND "/usr/local/bin/export"
/* ExportPermit gotten by start_remote_job_p, and used by start_remote_job. */
static ExportPermit permit;
@@ -78,11 +75,11 @@ start_remote_job_p (int first_p)
}
/* For secure Customs, make is installed setuid root and
Customs requires a privileged source port be used. */
Customs requires a privileged source port be used. */
make_access ();
if (ISDB (DB_JOBS))
Rpc_Debug(1);
Rpc_Debug (1);
/* Ping the daemon once to see if it is there. */
inited = Customs_Ping () == RPC_SUCCESS ? 1 : -1;
@@ -91,20 +88,20 @@ start_remote_job_p (int first_p)
user_access ();
if (starting_directory == 0)
/* main couldn't figure it out. */
inited = -1;
/* main couldn't figure it out. */
inited = -1;
else
{
/* Normalize the current directory path name to something
that should work on all machines exported to. */
{
/* Normalize the current directory path name to something
that should work on all machines exported to. */
normalized_cwd = xmalloc (GET_PATH_MAX);
strcpy (normalized_cwd, starting_directory);
if (Customs_NormPath (normalized_cwd, GET_PATH_MAX) < 0)
/* Path normalization failure means using Customs
won't work, but it's not really an error. */
inited = -1;
}
normalized_cwd = xmalloc (GET_PATH_MAX);
strcpy (normalized_cwd, starting_directory);
if (Customs_NormPath (normalized_cwd, GET_PATH_MAX) < 0)
/* Path normalization failure means using Customs
won't work, but it's not really an error. */
inited = -1;
}
}
if (inited < 0)
@@ -112,7 +109,7 @@ start_remote_job_p (int first_p)
njobs = job_slots_used;
if (!first_p)
njobs -= 1; /* correction for being called from reap_children() */
njobs -= 1; /* correction for being called from reap_children() */
/* the first job should run locally, or, if the -l flag is given, we use
that as clue as to how many local jobs should be scheduled locally */
@@ -173,9 +170,9 @@ start_remote_job (char **argv, char **envp, int stdin_fd,
/* Create a WayBill to give to the server. */
len = Customs_MakeWayBill (&permit, normalized_cwd, argv[0], argv,
envp, retport, waybill);
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;
@@ -189,11 +186,11 @@ start_remote_job (char **argv, char **envp, int stdin_fd,
sin.sin_port = htons (Customs_Port ());
sin.sin_addr = permit.addr;
status = Rpc_Call (sock, &sin, (Rpc_Proc) CUSTOMS_IMPORT,
len, (Rpc_Opaque) waybill,
sizeof(msg), (Rpc_Opaque) msg,
1, &timeout);
len, (Rpc_Opaque) waybill,
sizeof (msg), (Rpc_Opaque) msg,
1, &timeout);
host = gethostbyaddr((char *)&permit.addr, sizeof(permit.addr), AF_INET);
host = gethostbyaddr ((char *)&permit.addr, sizeof(permit.addr), AF_INET);
if (status != RPC_SUCCESS)
{
@@ -216,26 +213,26 @@ start_remote_job (char **argv, char **envp, int stdin_fd,
else
{
error (NILF, "*** exported to %s (id %u)",
host ? host->h_name : inet_ntoa (permit.addr),
permit.id);
host ? host->h_name : inet_ntoa (permit.addr),
permit.id);
}
fflush (stdout);
fflush (stderr);
pid = vfork ();
pid = fork ();
if (pid < 0)
{
/* The fork failed! */
perror_with_name ("vfork", "");
perror_with_name ("fork", "");
return 1;
}
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 };
{ EXPORT_COMMAND, "-id", sock_buf, retsock_buf, id_buf, 0 };
/* Set up the arguments. */
(void) sprintf (sock_buf, "%d", sock);
@@ -244,7 +241,7 @@ start_remote_job (char **argv, char **envp, int stdin_fd,
/* Get the right stdin. */
if (stdin_fd != 0)
(void) dup2 (stdin_fd, 0);
(void) dup2 (stdin_fd, 0);
/* Unblock signals in the child. */
unblock_sigs ();
@@ -253,7 +250,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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -16,7 +14,7 @@ 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 "makeint.h"
#include "filedef.h"
#include "job.h"
#include "commands.h"

211
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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -16,12 +14,12 @@ 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 "makeint.h"
#include <assert.h>
#include "dep.h"
#include "filedef.h"
#include "dep.h"
#include "job.h"
#include "commands.h"
#include "variable.h"
@@ -72,7 +70,7 @@ count_implicit_rule_limits (void)
{
char *name;
int namelen;
struct rule *rule, *lastrule;
struct rule *rule;
num_pattern_rules = max_pattern_targets = max_pattern_deps = 0;
max_pattern_dep_length = 0;
@@ -80,7 +78,6 @@ count_implicit_rule_limits (void)
name = 0;
namelen = 0;
rule = pattern_rules;
lastrule = 0;
while (rule != 0)
{
unsigned int ndeps = 0;
@@ -90,10 +87,10 @@ count_implicit_rule_limits (void)
++num_pattern_rules;
if (rule->num > max_pattern_targets)
max_pattern_targets = rule->num;
max_pattern_targets = rule->num;
for (dep = rule->deps; dep != 0; dep = dep->next)
{
{
const char *dname = dep_name (dep);
unsigned int len = strlen (dname);
@@ -109,38 +106,37 @@ count_implicit_rule_limits (void)
#endif
ndeps++;
if (len > max_pattern_dep_length)
max_pattern_dep_length = len;
if (len > max_pattern_dep_length)
max_pattern_dep_length = len;
if (p != 0 && p2 > p)
{
/* There is a slash before the % in the dep name.
Extract the directory name. */
if (p == dname)
++p;
if (p - dname > namelen)
{
namelen = p - dname;
name = xrealloc (name, namelen + 1);
}
memcpy (name, dname, p - dname);
name[p - dname] = '\0';
if (p != 0 && p2 > p)
{
/* There is a slash before the % in the dep name.
Extract the directory name. */
if (p == dname)
++p;
if (p - dname > namelen)
{
namelen = p - dname;
name = xrealloc (name, namelen + 1);
}
memcpy (name, dname, p - dname);
name[p - dname] = '\0';
/* In the deps of an implicit rule the `changed' flag
actually indicates that the dependency is in a
nonexistent subdirectory. */
/* In the deps of an implicit rule the 'changed' flag
actually indicates that the dependency is in a
nonexistent subdirectory. */
dep->changed = !dir_file_exists_p (name, "");
}
else
/* This dependency does not reside in a subdirectory. */
dep->changed = 0;
}
dep->changed = !dir_file_exists_p (name, "");
}
else
/* This dependency does not reside in a subdirectory. */
dep->changed = 0;
}
if (ndeps > max_pattern_deps)
max_pattern_deps = ndeps;
max_pattern_deps = ndeps;
lastrule = rule;
rule = next;
}
@@ -151,7 +147,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 +162,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
@@ -221,7 +217,7 @@ convert_to_pattern (void)
{
unsigned int l = strlen (dep_name (d));
if (l > maxsuffix)
maxsuffix = l;
maxsuffix = l;
}
/* Space to construct the suffix rule target name. */
@@ -232,12 +228,12 @@ convert_to_pattern (void)
unsigned int slen;
/* Make a rule that is just the suffix, with no deps or commands.
This rule exists solely to disqualify match-anything rules. */
This rule exists solely to disqualify match-anything rules. */
convert_suffix_rule (dep_name (d), 0, 0);
if (d->file->cmds != 0)
/* Record a pattern for this suffix's null-suffix rule. */
convert_suffix_rule ("", dep_name (d), d->file->cmds);
/* Record a pattern for this suffix's null-suffix rule. */
convert_suffix_rule ("", dep_name (d), d->file->cmds);
/* Add every other suffix to this one and see if it exists as a
two-suffix rule. */
@@ -245,32 +241,32 @@ convert_to_pattern (void)
memcpy (rulename, dep_name (d), slen);
for (d2 = suffix_file->deps; d2 != 0; d2 = d2->next)
{
{
struct file *f;
unsigned int s2len;
s2len = strlen (dep_name (d2));
s2len = strlen (dep_name (d2));
/* Can't build something from itself. */
if (slen == s2len && streq (dep_name (d), dep_name (d2)))
continue;
if (slen == s2len && streq (dep_name (d), dep_name (d2)))
continue;
memcpy (rulename + slen, dep_name (d2), s2len + 1);
f = lookup_file (rulename);
if (f == 0 || f->cmds == 0)
continue;
memcpy (rulename + slen, dep_name (d2), s2len + 1);
f = lookup_file (rulename);
if (f == 0 || f->cmds == 0)
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)'. */
dep_name (d),
f->cmds);
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)'. */
dep_name (d),
f->cmds);
/* The suffix rule `.X.Y:' is converted
to the pattern rule `%.Y: %.X'. */
convert_suffix_rule (dep_name (d2), dep_name (d), f->cmds);
}
/* The suffix rule '.X.Y:' is converted
to the pattern rule '%.Y: %.X'. */
convert_suffix_rule (dep_name (d2), dep_name (d), f->cmds);
}
}
}
@@ -298,42 +294,42 @@ new_pattern_rule (struct rule *rule, int override)
for (r = pattern_rules; r != 0; lastrule = r, r = r->next)
for (i = 0; i < rule->num; ++i)
{
for (j = 0; j < r->num; ++j)
if (!streq (rule->targets[i], r->targets[j]))
break;
for (j = 0; j < r->num; ++j)
if (!streq (rule->targets[i], r->targets[j]))
break;
/* If all the targets matched... */
if (j == r->num)
{
struct dep *d, *d2;
for (d = rule->deps, d2 = r->deps;
d != 0 && d2 != 0; d = d->next, d2 = d2->next)
if (!streq (dep_name (d), dep_name (d2)))
break;
if (d == 0 && d2 == 0)
{
/* All the dependencies matched. */
if (override)
{
/* Remove the old rule. */
freerule (r, lastrule);
/* Install the new one. */
if (pattern_rules == 0)
pattern_rules = rule;
else
last_pattern_rule->next = rule;
last_pattern_rule = rule;
if (j == r->num)
{
struct dep *d, *d2;
for (d = rule->deps, d2 = r->deps;
d != 0 && d2 != 0; d = d->next, d2 = d2->next)
if (!streq (dep_name (d), dep_name (d2)))
break;
if (d == 0 && d2 == 0)
{
/* All the dependencies matched. */
if (override)
{
/* Remove the old rule. */
freerule (r, lastrule);
/* Install the new one. */
if (pattern_rules == 0)
pattern_rules = rule;
else
last_pattern_rule->next = rule;
last_pattern_rule = rule;
/* We got one. Stop looking. */
goto matched;
}
else
{
/* The old rule stays intact. Destroy the new one. */
freerule (rule, (struct rule *) 0);
return 0;
}
}
}
/* We got one. Stop looking. */
goto matched;
}
else
{
/* The old rule stays intact. Destroy the new one. */
freerule (rule, (struct rule *) 0);
return 0;
}
}
}
}
matched:;
@@ -342,9 +338,9 @@ new_pattern_rule (struct rule *rule, int override)
{
/* There was no rule to replace. */
if (pattern_rules == 0)
pattern_rules = rule;
pattern_rules = rule;
else
last_pattern_rule->next = rule;
last_pattern_rule->next = rule;
last_pattern_rule = rule;
}
@@ -355,7 +351,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)
@@ -377,7 +373,7 @@ install_pattern_rule (struct pspec *p, int terminal)
++r->suffixes[0];
ptr = p->dep;
r->deps = PARSE_FILE_SEQ (&ptr, struct dep, '\0', NULL, 0);
r->deps = PARSE_SIMPLE_SEQ (&ptr, struct dep);
if (new_pattern_rule (r, 0))
{
@@ -386,9 +382,10 @@ install_pattern_rule (struct pspec *p, int terminal)
r->cmds->fileinfo.filenm = 0;
r->cmds->fileinfo.lineno = 0;
/* These will all be string literals, but we malloc space for them
anyway because somebody might want to free them later. */
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 +409,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);
@@ -471,7 +468,7 @@ create_pattern_rule (const char **targets, const char **target_percents,
/* Print the data base of rules. */
static void /* Useful to call from gdb. */
static void /* Useful to call from gdb. */
print_rule (struct rule *r)
{
unsigned int i;
@@ -507,7 +504,7 @@ print_rule_data_base (void)
print_rule (r);
if (r->terminal)
++terminal;
++terminal;
}
if (rules == 0)
@@ -515,12 +512,12 @@ print_rule_data_base (void)
else
{
printf (_("\n# %u implicit rules, %u"), rules, terminal);
#ifndef NO_FLOAT
#ifndef NO_FLOAT
printf (" (%.1f%%)", (double) terminal / (double) rules * 100.0);
#else
{
int f = (terminal * 1000 + 5) / rules;
printf (" (%d.%d%%)", f/10, f%10);
int f = (terminal * 1000 + 5) / rules;
printf (" (%d.%d%%)", f/10, f%10);
}
#endif
puts (_(" terminal."));

18
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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -22,14 +20,14 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
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. */
struct dep *deps; /* Dependencies of the rule. */
struct commands *cmds; /* Commands to execute. */
const char **targets; /* Targets of the rule. */
unsigned int *lens; /* Lengths 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. */
char terminal; /* If terminal (double-colon). */
char in_use; /* If in use by a parent pattern_search. */
char terminal; /* If terminal (double-colon). */
char in_use; /* If in use by a parent pattern_search. */
};
/* For calling install_pattern_rule. */

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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -16,7 +14,7 @@ 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 "makeint.h"
/* If the system provides strsignal, we don't need it. */
@@ -29,11 +27,11 @@ this program. If not, see <http://www.gnu.org/licenses/>. */
#if !HAVE_DECL_SYS_SIGLIST
/* Some systems do not define NSIG in <signal.h>. */
#ifndef NSIG
#ifdef _NSIG
#define NSIG _NSIG
#ifndef NSIG
#ifdef _NSIG
#define NSIG _NSIG
#else
#define NSIG 32
#define NSIG 32
#endif
#endif
@@ -194,10 +192,10 @@ signame_init (void)
init_sig (SIGURG, "URG", _("Urgent I/O condition"));
#endif
#if defined (SIGIO)
/* "I/O pending" has also been suggested. A disadvantage is
that signal only happens when the process has
asked for it, not everytime I/O is pending. Another disadvantage
is the confusion from giving it a different name than under Unix. */
/* "I/O pending" has also been suggested. A disadvantage is that signal
only happens when the process has asked for it, not every time I/O is
pending. Another disadvantage is the confusion from giving it a
different name than under Unix. */
init_sig (SIGIO, "IO", _("I/O possible"));
#endif
#if defined (SIGWIND)
@@ -246,7 +244,7 @@ strsignal (int sig)
# endif
#endif
if (sig > 0 || sig < NSIG)
if (sig > 0 && sig < NSIG)
return (char *) sys_siglist[sig];
sprintf (buf, "Signal %d", sig);

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-2013 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify it under the
@@ -14,31 +14,42 @@ 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 "makeint.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
@@ -46,53 +57,68 @@ static struct strcache *strcache = NULL;
that this doesn't seem to be much of an issue in practice.
*/
static struct strcache *
new_cache()
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-2013 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

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