Compare commits

...

115 Commits
3.81 ... 3.82

Author SHA1 Message Date
Paul Smith
95f1a32d27 Release GNU make 3.82
- Update tests for Solaris bizarre-ness
- Update files for release
2010-07-28 05:39:50 +00:00
Eli Zaretskii
59691939f9 job.c 2010-07-24 08:27:50 +00:00
Eli Zaretskii
e954532d48 job.c (pid2str) [WINDOWS32]: Fix CPP conditionals for using %Id format. 2010-07-24 08:27:26 +00:00
Paul Smith
f5d7411c49 Fix up incorrect prototype. 2010-07-20 13:12:06 +00:00
Paul Smith
fba20a776d - Many fixup patches from Savannah.
- Fix the test suite on Solaris (from Boris)
- Update the manual for .ONESHELL
2010-07-19 07:10:53 +00:00
Boris Kolpackov
df2fa7c5a5 Fix buffer overrun in concat(). 2010-07-16 13:01:15 +00:00
Paul Smith
9903cda2a7 Update copyrights for 2010. 2010-07-13 01:20:10 +00:00
Paul Smith
ded9121846 Fixes to build_w32.bat for building with MSVC 64bit. 2010-07-12 20:32:59 +00:00
Eli Zaretskii
02ff72c970 Add missing one_shell declaration. 2010-07-12 17:18:31 +00:00
Eli Zaretskii
90b30b6e0e *** empty log message *** 2010-07-12 17:17:45 +00:00
Eli Zaretskii
96c0761689 make.h (alloca) [!__GNUC__]: Don't define prototype.
(int w32_kill): Use pid_t for process ID argument.
 Savannah bug #27809.
2010-07-12 17:16:54 +00:00
Paul Smith
bbe7b86718 Forgot to add the ONESHELL regression tests. 2010-07-12 05:29:25 +00:00
Paul Smith
7ba7dbca47 Add the beginning of the .ONESHELL special feature.
Original patch by David Boyce.  Modified by Paul Smith.
2010-07-12 05:23:19 +00:00
Eli Zaretskii
b85b7e0a55 w32/subproc/sub_proc.c: Include stdint.h.
(sub_process_t): Use intptr_t for file handles and pid_t for
 process ID.
 (process_pipes, process_init_fd, process_begin): Use intptr_t for
 file handles and pid_t for process ID.
 Savannah bug #27809.  Patch by Ozkan Sezer <sezeroz@gmail.com>
2010-07-09 12:05:10 +00:00
Eli Zaretskii
587588c1fa Fix Savannah bug #30312.
function.c (abspath): Support absolute file names in UNC format.
2010-07-09 11:40:19 +00:00
Eli Zaretskii
94bda718c4 config.h.W32.template (pid_t): Add a definition for 64-bit Windows builds that don't use GCC. 2010-07-09 11:38:01 +00:00
Eli Zaretskii
4e4d8f246f job.c (pid2str) [WINDOWS32]: Don't use %Id with GCC < 4.x.
(exec_command) [WINDOWS32]: Use pid2str instead of non-portable
 %Id.

 main.c (handle_runtime_exceptions): Use %p to print addresses,
 to DTRT on both 32-bit and 64-bit hosts.  Savannah bug #27809.

 job.c (w32_kill, start_job_command, create_batch_file): Use
 pid_t for process IDs and intptr_t for the 1st arg of
 _open_osfhandle.
 function.c (windows32_openpipe): Use pid_t for process IDs and
 intptr_t for the 1st arg of _open_osfhandle.
 (func_shell): Use pid_t for process IDs.
 main.c (main) [WINDOWS32]: Pacify the compiler.
 config.h.W32.template (pid_t): Add a definition for 64-bit
 Windows builds that don't use GCC.
 Savannah bug #27809.  Patch by Ozkan Sezer <sezeroz@gmail.com>
2010-07-09 11:10:04 +00:00
Paul Smith
8a0f9d7b42 Fix FTP upload rules. 2010-07-07 02:06:48 +00:00
Paul Smith
c7b469f0f3 - Enhance .POSIX to set -e when invoking shells, as demanded by a
backward-incompatible change in the 2008 POSIX specification.
- Add the .SHELLFLAGS variable so people can choose their own shell flags.
- Add tests for this.
- Add documentation for this.
2010-07-06 06:37:42 +00:00
Paul Smith
c78b7265bd Fixups for warnings on Windows (esp 64bit). 2010-07-05 18:32:03 +00:00
Paul Smith
fc644b4c45 Do not consider filenames that contain parens but don't END in a paren,
to be an archive group.  Fixes Savannah bug #28525.
2010-07-03 16:45:45 +00:00
Paul Smith
97f106fa10 - Add whitespace to command line invocation in features/recursion
- Set up .FEATURES with separate calls for optional features, as some
  compilers don't like conditionals inside macro invocations.
2010-07-01 07:16:00 +00:00
Paul Smith
7746a1f74f - Rename strieq() to patheq() for clarity.
- Convert xmalloc/memset pairs to xcalloc.
2010-07-01 05:59:08 +00:00
Eli Zaretskii
c0239cdbfa *** empty log message *** 2009-12-11 15:55:16 +00:00
Eli Zaretskii
866aa6267a (construct_command_argv_internal) <sh_cmds_dos> [WINDOWS32]: Add "echo." and
a few more commands that are built into cmd.exe.  Fixes Savannah bug #28126.
2009-12-11 15:54:19 +00:00
Eli Zaretskii
b4cec7790f *** empty log message *** 2009-12-11 12:03:05 +00:00
Eli Zaretskii
deace771d6 (lookup_file) [HAVE_DOS_PATHS]: Treat '\\' like we do with '/'. 2009-12-11 12:02:45 +00:00
Eli Zaretskii
f4d9937274 (construct_vpath_list): Correct the argument names in the commentary. 2009-12-11 09:47:41 +00:00
Paul Smith
b6f45ddc53 Add VMS enhancements from Hartmut Becker. 2009-11-16 02:31:23 +00:00
Boris Kolpackov
fe43fa9de3 Implement linker-compatible library search. 2009-11-12 16:42:36 +00:00
Paul Smith
5f188b39a4 Update copyright years. 2009-10-25 18:56:44 +00:00
Paul Smith
76d2d2ca41 Fix fat-finger bug that left implicit rules with identical stem lengths
being sorted indeterminately.
2009-10-25 18:34:43 +00:00
Paul Smith
4e51b6d9a4 New command line option: --eval=STRING will cause STRING to be
evaluated as a makefile statement before the first makefile is
read.
2009-10-25 00:46:52 +00:00
Paul Smith
606cf9b169 Various simple code cleanups. 2009-10-25 00:26:34 +00:00
Boris Kolpackov
131f115730 Get the old behavior for a situation when no makefile is found in a directory. 2009-10-22 14:29:22 +00:00
Paul Smith
b1d34394a8 Massage the NEWS file 2009-10-12 22:24:54 +00:00
Boris Kolpackov
baee33eb0f Minor fix and code rework. 2009-10-07 09:34:42 +00:00
Boris Kolpackov
bd2d124f27 Fix savannah bug 25780. Optimize things a bit. 2009-10-06 12:36:29 +00:00
Boris Kolpackov
4254e88cfa Implement the new undefine directive. 2009-10-06 06:56:57 +00:00
Boris Kolpackov
174e910a1d Performance improvements 2009-10-05 14:40:18 +00:00
Paul Smith
acbdc33e1c Add a test for another (still open) bug. 2009-10-04 19:18:16 +00:00
Paul Smith
f87715a62c - Include <alloca.h> even on non-__GNUC__ systems.
- Add some tests for unresolved bugs.
2009-10-03 20:08:20 +00:00
Boris Kolpackov
56653d8524 Fix Savannah bugs #15110, #25493, #12686, and #17740. 2009-09-30 09:54:26 +00:00
Paul Smith
f907a4d90c - Update manual description for pattern rule search algorithm
- Add new "-all" flag to the test suite to run tests that don't pass yet
- Add some non-passing tests
- Fix from Andreas Buening for OS/2.
2009-09-28 23:08:49 +00:00
Boris Kolpackov
f5891a26d8 Implement the shortest stem first search order for pattern-specific variables and pattern rules. 2009-09-28 12:31:55 +00:00
Eli Zaretskii
f9c15cac35 * glob.c (my_realloc) [__DJGPP__]: Don't define, and don't
redefine realloc to call it, since the DJGPP's realloc handles
	NULL pointers correctly.
2009-09-28 06:46:03 +00:00
Eli Zaretskii
bf1794767e Fix typo. 2009-09-27 17:56:24 +00:00
Eli Zaretskii
5d19c91605 * configh.dos.template: Remove unconditional definition of
SYS_SIGLIST_DECLARED.
	Include <sys/version.h> because ports of GCC 4.3.0 and later no
	longer include it, so macros like __DJGPP_MINOR__ are no longer
	defined automatically.

	* Makefile.DOS.template (INCLUDES): Use $(prefix) and the
	corresponding variables to define LIBDIR, INCLUDEDIR and LOCALEDIR
	instead of using the hardcoded ones.
	(SUBDIRS): doc subdir added.
	(INFO_DEPS, DVIS): Values changed to 'make.info' and 'make.dvi'.
	(TEXI2HTML, TEXI2HTML_FLAGS): Removed.  Use makeinfo --html to
	create html formated docs.  texi2html may not be ported to DOS.
	(make.info, make.dvi, make.ps, make.html): Make targets depend on
	'make.texi'.
	(.texi.info, .texi, .texi.dvi): Now recursively invocate.  Change
	-I switch to look in ./ instead of ./doc.
	(html): Target depend on html-recursive instead of make_1.html.
	(make_1.html): Removed.
	(mostlyclean-aminfo): Use $(srcdir)/doc instead of ./ as prefix.
	(all-recursive): Allow for more than one subdir in the build
	process.
	(mostlyclean-recursive, clean-recursive, distclean-recursive)
	(maintainer-clean-recursive, check-recursive): Enter in doc/ too.
	(tags-recursive): Allow for more than one subdir in the build
	process.
	(info-recursive, dvi-recursive, ps-recursive, html-recursive): New
	targets.  Enter into doc/ to produce the targets.
	(all-am): $(INFO_DEPS) replaced by info.
2009-09-27 16:22:50 +00:00
Paul Smith
8688ef20cf - Add static pattern targets to the string cache.
- Use specific free_*() calls where appropriate.
2009-09-27 02:15:36 +00:00
Paul Smith
44ac2cdb4d Fix some memory leaks, found with valgrind. 2009-09-26 23:01:55 +00:00
Boris Kolpackov
48045f99e5 Performance improvement. 2009-09-25 15:51:11 +00:00
Boris Kolpackov
5973926ce6 Merge three parallel arrays into one. Make sure sufficient space is allocated. 2009-09-25 15:44:27 +00:00
Paul Smith
d65b267e4a - Fix broken handling of order-only prereqs in secondary expansion
of implicit rules.
- Fix leaked memory when dealing with implicit rule chains that
  have file variables or pattern variables.
2009-09-24 20:59:22 +00:00
Paul Smith
0afbbf8595 - Rework secondary expansion so we only defer it if there's a possibility
it might be needed: for most situations we parse prereqs immediately as
  we used to.  Reduces memory usage.
- Fixes Savannah bug #18622.
2009-09-24 02:41:44 +00:00
Paul Smith
3cc351decd Added Italian (it) language support. 2009-09-16 17:42:09 +00:00
Paul Smith
8f30b68871 - Add xcalloc() and call it
- Fix memory errors found by valgrind
- Remove multi_glob() and empower parse_file_seq() to do its job:
  the goal here is to remove the confusing reverse/re-reverse we do on
  the file lists: needed for future fixes.
- Add a prefix arg to parse_file_seq()
- Make concat() variadic so it can take arbitrary #'s of strings
2009-09-16 17:07:01 +00:00
Eli Zaretskii
5abe477620 *** empty log message *** 2009-09-14 18:20:02 +00:00
Eli Zaretskii
295a05fbd6 * w32/subproc/sub_proc.c (process_begin): Check *ep non-NULL
inside the loop that looks up environment for PATH.
2009-09-14 18:18:37 +00:00
Paul Smith
958ea92eb8 - Fix Savannah bug #21824: don't loop through NULL cmds pointer
- Fix Savannah bugs #24509, 18963: doc enhancements
2009-09-12 21:28:33 +00:00
Eli Zaretskii
70c726c875 * function.c (windows32_openpipe): Update envp after calling
sync_Path_environment.
2009-08-31 17:54:11 +00:00
Paul Smith
7deb42aafd - Fix Savannah bug #27093
- Fix Savannah bug #27143
- Fix Savannah bug #23960
- Fix Savannah bug #27148
2009-08-02 16:05:42 +00:00
Paul Smith
e2f16fdf45 Changes from Ralf Wildenhues. 2009-08-01 22:09:40 +00:00
Eli Zaretskii
139c28ae69 function.c (func_realpath) [!HAVE_REALPATH]: Require the file to
exist, as realpath(3) does where it's supported.
2009-07-04 11:34:32 +00:00
Eli Zaretskii
e8fd23cc83 (func_realpath) [!HAVE_REALPATH]: Require the file to exist, as
realpath(3) does where it's supported.
2009-07-04 11:33:33 +00:00
Eli Zaretskii
1471af2de2 * function.c (IS_ABSOLUTE, ROOT_LEN): New macros.
(abspath): Support systems that define HAVE_DOS_PATHS (have
	drive letters in their file names).  Use IS_PATHSEP instead of a
	literal '/' comparison.
2009-07-04 11:15:14 +00:00
Paul Smith
56f70324e8 - Forgot changelog for fix 13529 2009-06-14 06:08:54 +00:00
Paul Smith
be6b22a283 - Fix Savannah bug #13529 2009-06-14 06:08:11 +00:00
Paul Smith
dceb954f9c - Fix Savannah bug #13401 2009-06-13 23:10:52 +00:00
Paul Smith
38b23bc3f0 - Fixes Savannah bug #18435 2009-06-13 22:47:40 +00:00
Paul Smith
bf9822658f - Fix Savannah bug 17825
- Fix Savannah bug 21231
2009-06-13 21:21:48 +00:00
Paul Smith
c8840352ac - Fix Savannah bug #19108
- Fix Savannah bug #17752
- Test suite:
  * When tests fail keep a "run" file containing the command invoked.
  * Support for the Valgrind "memcheck" and "massif" tools.
2009-06-10 02:21:09 +00:00
Paul Smith
d4ee001292 - Fix Savannah bug #18124
- Fix Savannah bug #17521
- Fix Savannah bug #16401
- Fix Savannah bug #16469
- Fix Savannah bug #16473
2009-06-09 15:35:38 +00:00
Paul Smith
a72bff7cb3 - Fix Savannah bug #24622 2009-06-07 18:16:15 +00:00
Paul Smith
0b30c8d9ce - Add a new test suite for LIBPATTERNS
- Fix Savannah bug #21198
- Fix Savannah bug #21823
- Fix Savannah bug #22010
2009-06-07 17:40:06 +00:00
Paul Smith
668af46980 Add attribution. 2009-06-06 23:23:36 +00:00
Paul Smith
b9f831b858 - Work around a bug in glibc glob(3), by avoiding GLOB_NOCHECK.
- Fix issue in very parallel builds found building glibc.
2009-06-06 23:16:46 +00:00
Paul Smith
71385e1225 - Add forgotten variable/define test suite
- Skip initial whitespace including formfeeds, vertical tab, etc.
- Add tests for that
- Fix the variable/SHELL test; it was wrong!
2009-06-05 01:17:29 +00:00
Paul Smith
81f3e4babd - Modify access of config and gnulib Savannah modules to use GIT
- Fix Savannah bug #24655.
- Fix Savannah bug #24588.
- Fix Savannah bug #24277.
- Fix Savannah bug #25697.
- Fix Savannah bug #25694.
- Fix Savannah bug #25460.
- Fix Savannah bug #26207.
- Fix Savannah bug #25712.
- Fix Savannah bug #26593.
- Fix various doc issues.
2009-06-04 06:30:27 +00:00
Paul Smith
5b4d419476 Add 'private' variable modifier, feature submitted by Ramon Garcia.
Rework the parser for variables to allow multiple modifiers and also
allow for variables and targets with modifier names, like "export" and
"private".
2009-05-26 01:31:40 +00:00
Paul Smith
7b16a8e3ca We had the incorrect ISBN in the manual; not sure what happened here
but the FSF confirmed that we had the wrong one.
2009-05-24 19:06:04 +00:00
Paul Smith
14f3f501bc Found this change in an old CVS workspace: rewrite savestring() to the
more standard xstrndup().
2009-05-24 18:31:18 +00:00
Eli Zaretskii
3fd62c76c2 (convert_Path_to_windows32): Fix last change. Fixes Savannah bug #25412. 2009-03-14 16:31:57 +00:00
Eli Zaretskii
27ef86f6b1 <top level>: Update Copyright years. Add prototype for xmalloc.
(find_file): Accept 3 arguments PATH_VAR, FULL_FNAME, and FULL_LEN
instead of an LPOFSTRUCT pointer.  Use xmalloc instead of malloc.
Loop over an array of extensions, instead of duplicating the same
code inline.  Use SearchPath followed by CreateFile, instead of
the obsolete OpenFile.  Fixes Savannah bug #17277.
(process_begin): Find $(PATH) in `envp', and pass a pointer to it
to `find_file'.  Fixes Savannah bug #25662.
2009-03-14 14:42:06 +00:00
Eli Zaretskii
656b15a404 * function.c (func_shell): Don't close pipedes[1] if it is -1.
Fixes Savannah bug #20495.
2009-03-07 17:30:30 +00:00
Eli Zaretskii
f8f3b9005b * build_w32.bat (GCCBuild): Use "-gdwarf-2 -g3" instead of
"-gstabs+ -ggdb3".

	* w32/subproc/build.bat (GCCBuild): Likewise.
2008-09-30 11:26:16 +00:00
Eli Zaretskii
4c995f262a * job.c (construct_command_argv_internal): Avoid extra backslash
in batch-mode Unixy shells.  Under DB_JOBS, display the contents
	of the batch file.
2008-09-30 11:19:58 +00:00
Eli Zaretskii
c7f2c384ee *** empty log message *** 2008-05-31 08:06:44 +00:00
Eli Zaretskii
ed4a06e6de Remove obsolete text about non-support for -jN without Unixy shell.
Remove obsolete text about not supplying Visual Studio project files
(we do supply them).
Modify text to prefer GCC builds to MSC builds.
2008-05-31 08:06:05 +00:00
Paul Smith
b50116c4ae Manual typo.
New translation.
2008-05-18 15:11:39 +00:00
Paul Smith
b23b0c3552 Update the translation project location for PO files (again)
Apply fix for Savannah bug #22379.
2008-03-28 03:46:39 +00:00
Eli Zaretskii
bb7cb05da5 *** empty log message *** 2008-01-26 13:51:55 +00:00
Eli Zaretskii
8d5b3d4298 (target_environment): Don't use shell_var if its `value' field is NULL. 2008-01-26 13:51:14 +00:00
Eli Zaretskii
2750526aa5 Makefile.DOS.template (info_TEXINFOS): Remove unused variable.
(TEXINFOS): Value changed to `doc/make.texi'.
(.SUFFIXES): Use .texi instead of .texinfo.
(make.info, make.dvi): Depend on doc/make.texi.
(.texi.info): New target, instead of ".texinfo.info".  Change -I switch
to $(MAKEINFO) to look in doc/.  Use --no-split.
(.texi): New target, instead of ".texinfo".  Change -I switch to $(MAKEINFO)
to look in doc/.  Use --no-split.
(.texi.dvi): New target, instead of ".texinfo.dvi".  Change -I switch
to $(MAKEINFO) to look in doc/.
(install-info-am, uninstall-info): Don't look for "*.i[0-9]" and
"*.i[0-9][0-9]" (due to --no-split above).
(noinst_TEXINFOS, TEXI2HTML, TEXI2HTML_FLAGS): New variables.
(html, make_1.html): New targets.
(.PHONY): Add "html".
(.SUFFIXES): Add .html.
2007-12-22 12:07:36 +00:00
Eli Zaretskii
84e9bcd65e glob/glob.c [__GNU_LIBRARY__ && __DJGPP__]: Add a realloc declaration
that matches the one in the DJGPP libc.
2007-12-22 11:28:49 +00:00
Eli Zaretskii
91b016c414 configh.dos.template [__DJGPP__]: Replace HAVE_SYS_SIGLIST with
HAVE_DECL_SYS_SIGLIST.

job.c (child_execute_job): Remove __MSDOS__ because MSDOS/DJGPP build does
not use child_execute_job.

variable.c (define_automatic_variables) [__MSDOS__]: Always export the SHELL
environment variable to the child.
2007-12-22 11:27:02 +00:00
Eli Zaretskii
be883de241 config.h.W32: Include sys/types.h.
[!_PID_T_] (pid_t): Define only if not already defined.
2007-12-22 11:00:29 +00:00
Eli Zaretskii
c233a70323 vpath.c (construct_vpath_list) [HAVE_DOS_PATHS]: Support VPATH values that
use `:' in drive letters, when PATH_SEPARATOR_CHAR is also `:'.
2007-12-22 10:55:30 +00:00
Paul Smith
8025f93312 For mod times farther in the future, print the value in fixed-point rather
than exponential notation (patch from Bruno Haible).
2007-11-05 14:15:19 +00:00
Paul Smith
43d81ff866 New special variable: .RECIPEPREFIX
Allows the user to reset the prefix character for introducing recipe lines
from the default (tab) to any other single character, and back again.
Also, reworked the manual to consistently use the word "recipe" to describe
the set of commands we use to update a target, instead of the various
phrases used in the past: "commands", "command lines", "command scripts",
etc.
2007-11-04 21:54:00 +00:00
Eli Zaretskii
c1f71b0336 Convert to Unix line-endings. 2007-10-24 20:06:32 +00:00
Paul Smith
0b17d143ba Windows: allow SHELL to be set to a more complex value by checking its
expansion to see if it's a valid shell, not just the unexpanded value.
2007-10-13 14:46:04 +00:00
Paul Smith
2a23064da5 Fixes from Eli Zaretskii:
Fix to allow quoted directories in PATH.
Fix for Savannah bug #20549.
2007-10-10 13:22:21 +00:00
Paul Smith
e54dfb4284 Some Windows fixes to allow builds to succeed. 2007-10-10 04:32:15 +00:00
Paul Smith
19b6504f8a Incorporate Icarus Sparry's fix for 3330 and 15919, and test cases.
One of our translations disappeared from the translations site so remove it.

The fdl.texi file was changed to not contain any @node entries, so add some
around it in make.texi.
2007-08-15 13:53:53 +00:00
Paul Smith
bb4d040fad Fix Savannah bug #20452.
Add a new feature to the test suite suggested by Icarus Sparry:
set a timer before invoking a test, so that if it loops infinitely we
will wake up and have a chance to kill the process and continue.
2007-07-14 02:57:46 +00:00
Paul Smith
891ebd4d97 * Update to GPLv3
* Update copyright to 2007
* Fix download URL for translation files (thanks to Thiemo Seufer)
2007-07-04 19:35:15 +00:00
Paul Smith
a940199072 Fix a core dump when reading_file is 0 (20033).
Fix some manual typos (20018).
2007-06-19 04:47:58 +00:00
Paul Smith
eda0e24ccd Fix some documentation gitches.
Fix an uninitialized variable.
Add builtin rules for Objective C.
Add a new debug line that shows where the commands that are about to be run
were defined.
2007-05-11 20:57:21 +00:00
Paul Smith
52ebc531ce Fix Savannah bug #19656: rationalize our use of case-insensitive string
comparison functions to always use POSIX strcasecmp().  For non-POSIX
systems that use other functions (strcmpi or stricmp) use a macro to alias
strcasecmp to those.  If we can't find any of them (VMS, plus whatever
UNIX doesn't have them) then define our own version in misc.c.
2007-05-09 02:01:53 +00:00
Paul Smith
891409f212 Fix Savannah bug #19348: if the user specified
--disable-case-insensitive-file-system, don't turn it on.
2007-03-21 13:49:34 +00:00
Paul Smith
6ccf33cdbd This is a major update, which switches virtually every allocated-but-not-freed
string into the strcache.  As a side-effect, many more structure members and
function arguments can/should be declared const.

As mentioned in the changelog, unfortunately measurement shows that this
change does not yet reduce memory.  The problem is with secondary expansion:
because of this we store all the prerequisites in the string cache twice.
First we store the prerequisite string after initial expansion but before
secondary expansion, then we store each individual file after secondary
expansion and expand_deps().  I plan to change expand_deps() to be callable
in either context (eval or snap_deps) then have non-second-expansion
targets call expand_deps() during eval, so that we only need to store that
dependency list once.
2007-03-20 03:02:26 +00:00
Paul Smith
e4da308580 Fix from Eli for incorrect value of $(MAKE) on Cygwin.
A few changes from char* to void* where appropriate, and removing of
unnecessary casts.

Much more work on const-ifying the codebase.  This round involves some code
changes to make it correct.  NOTE!!  There will almost certainly be problems
on the non-POSIX ports that will need to be addressed after the const changes
are finished: they will need to be const-ified properly and there may need to
be some changes to allocate memory, etc. as well.

The next (last?) big push for this, still to come, is const-ifying the
filenames in struct file, struct dep, etc.  This will allow us to store file
names in the string cache and finally resolve Savannah bug #15182 (make uses
too much memory), among other advantages.
2006-11-18 20:53:44 +00:00
Paul Smith
7595f38f62 Fixed a number of documentation bugs, plus some build/install issues:
16304, 16468, 16577, 17701, 17880, 16051, 16652, 16698
Plus some from the mailing list.

Imported a patch from Eli to allow Cygwin builds to support DOS-style
pathnames.
2006-10-01 05:38:38 +00:00
Paul Smith
c25294ad3b Another round of cleanups:
- Add more warnings.
- Rename variables that mask out-scope vars with the same name.
- Remove all casts of return values from xmalloc, xrealloc, and alloca.
- Remove casts of the first argument to xrealloc.
- Convert all bcopy/bzero/bcmp invocations to use memcp/memmove/memset/memcmp.
2006-04-09 22:09:24 +00:00
Paul Smith
f222b19158 Code cleanup: Remove all references to PARAMS() & ansi2knr. 2006-04-07 01:43:44 +00:00
155 changed files with 13638 additions and 8743 deletions

View File

@@ -7,6 +7,7 @@ stamp-*
makebook*
.*gdbinit
.gdb_history
*.dep *.dvi *.toc *.aux *.log
*.cp *.cps *.fn *.fns *.vr *.vrs *.tp *.tps *.ky *.kys *.pg *.pgs
@@ -21,7 +22,7 @@ config.ami configh.dos config.h.W32 config.h-vms
loadavg loadavg.c make
.deps .dep_segment
.deps .dep_segment ID TAGS
_*
sun4 i386 i386-netbsd hp300-netbsd hp300 rs6000 sun3 news800 amiga

11
AUTHORS
View File

@@ -60,23 +60,24 @@ Other contributors:
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>
With suggestions/comments/bug reports from a cast of ... well ...
hundreds, anyway :)
-------------------------------------------------------------------------------
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Copyright (C) 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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
this program. If not, see <http://www.gnu.org/licenses/>.

850
COPYING
View File

@@ -1,286 +1,626 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
TERMS AND CONDITIONS
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
0. Definitions.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
"This License" refers to version 3 of the GNU General Public License.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
A "covered work" means either the unmodified Program or a work based
on the Program.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
1. Source Code.
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
The Corresponding Source for a work in source code form is that
same work.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
13. Use with the GNU Affero General Public License.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
14. Revised Versions of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
NO WARRANTY
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
15. Disclaimer of Warranty.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@@ -288,15 +628,15 @@ free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
This program 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 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -305,36 +645,30 @@ the "copyright" line and a pointer to where the full notice is found.
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, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

1278
ChangeLog

File diff suppressed because it is too large Load Diff

View File

@@ -4982,17 +4982,18 @@ 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 Free Software Foundation, Inc.
1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2008, 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
terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
this program. If not, see <http://www.gnu.org/licenses/>.

View File

@@ -6638,17 +6638,17 @@ for earlier changes.
Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
2001, 2002, 2003, 2005, 2006, 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
terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
this program. If not, see <http://www.gnu.org/licenses/>.

View File

@@ -2,20 +2,21 @@
# 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 Free Software Foundation, Inc.
# 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 2, or (at your option) any later version.
# 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.
# 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
# GNU Make; see the file COPYING. If not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
# this program. If not, see <http://www.gnu.org/licenses/>.
SHELL = /bin/sh
@@ -82,16 +83,15 @@ make_SOURCES = %SOURCES%
libglob_a_SOURCES = %GLOB_SOURCES%
make_LDADD = glob/libglob.a
info_TEXINFOS = make.texinfo
man_MANS = make.1
INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"c:/djgpp/lib\" -DINCLUDEDIR=\"c:/djgpp/include\" -DLOCALEDIR=\"$(localedir)\"
INCLUDES = -I$(srcdir)/glob -DLIBDIR=\"$(prefix)$(libdir)\" -DINCLUDEDIR=\"$(prefix)$(includedir)\" -DLOCALEDIR=\"$(prefix)$(localedir)\"
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
SUBDIRS = glob
SUBDIRS = glob doc
mkinstalldirs = ${exec_prefix}/bin/gmkdir -p
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = build.sh
@@ -115,9 +115,10 @@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
TEXI2DVI = texi2dvi
TEXINFO_TEX = $(srcdir)/config/texinfo.tex
INFO_DEPS = make.info
DVIS = make.dvi
TEXINFOS = make.texinfo
INFO_DEPS = doc/make.info
DVIS = doc/make.dvi
TEXINFOS = doc/make.texi
noinst_TEXINFOS = doc/fdl.texi doc/make-stds.texi
man1dir = $(mandir)/man1
MANS = $(man_MANS)
@@ -135,7 +136,7 @@ HEADERS = $(wildcard $(srcdir)/*.h)
default: all
.SUFFIXES:
.SUFFIXES: .c .dvi .info .o .obj .ps .texinfo .tex
.SUFFIXES: .c .dvi .info .o .obj .ps .texi .tex .html
mostlyclean-hdr:
@@ -185,56 +186,70 @@ make$(EXEEXT): $(make_OBJECTS) $(make_DEPENDENCIES)
@command.com /c if exist make.exe del make.exe
$(LINK) $(make_LDFLAGS) $(make_OBJECTS) $(make_LDADD) $(LIBS)
make.info: make.texinfo
make.dvi: make.texinfo
# Documentation
make.info: make.texi
make.dvi: make.texi
make.ps: make.dvi make.texi
make.html: make.texi
DVIPS = dvips
.texinfo.info:
.texi.info:
@command.com /c if exist make.info* del make.info*
@command.com /c if exist make.i* del make.i*
$(MAKEINFO) -I$(srcdir) $< -o ./$@
$(MAKEINFO) -I$(srcdir) --no-split $< -o ./$@
.texinfo:
.texi:
@command.com /c if exist make.info* del make.info*
@command.com /c if exist make.i* del make.i*
$(MAKEINFO) -I$(srcdir) $< -o ./$@
$(MAKEINFO) -I$(srcdir) --no-split $< -o ./$@
.texinfo.dvi:
.texi.dvi:
TEXINPUTS="$(srcdir);$$TEXINPUTS" MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
.dvi.ps:
$(DVIPS) $< -o $@
# Other documentation formats
html: html-recursive
.texi.html:
@command.com /c if exist make.html* del make.html*
$(MAKEINFO) --html -I$(srcdir) --no-split $< -o ./$@
install-info-am: $(INFO_DEPS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(infodir)
@for file in $(INFO_DEPS) make.i; do d=$(srcdir); for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9] $$file[0-9] $$file[0-9][0-9]`; do if test -f $$d/$$ifile; then echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; else : ; fi; done; done
@for file in $(INFO_DEPS); do iifile=`echo $$file | sed "s|doc/||"`; d=$(srcdir); for ifile in `cd $$d && echo $$file`; do if test -f $$d/$$ifile; then echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$iifile"; $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$iifile; else : ; fi; done; done
@$(POST_INSTALL)
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then for file in $(INFO_DEPS); do echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file"; install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :; done; else : ; fi
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then for file in $(INFO_DEPS); do iifile=`echo $$file | sed "s|doc/||"`; echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$iifile"; install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$iifile || :; done; else : ; fi
uninstall-info:
$(PRE_UNINSTALL)
@if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then ii=yes; else ii=; fi; for file in $(INFO_DEPS); do test -z $ii || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; done
$(NORMAL_UNINSTALL)
for file in $(INFO_DEPS) make.i; do (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9] $$file[0-9] $$file[0-9][0-9]); done
for file in $(INFO_DEPS); do (cd $(DESTDIR)$(infodir) && rm -f $$file); done
dist-info: $(INFO_DEPS)
for base in $(INFO_DEPS); do d=$(srcdir); for file in `cd $$d && eval echo $$base*`; do test -f $(distdir)/$$file || ln $$d/$$file $(distdir)/$$file 2> /dev/null || cp -p $$d/$$file $(distdir)/$$file; done; done
mostlyclean-aminfo:
-rm -f make.aux make.cp make.cps make.dvi make.fn make.fns make.ky \
make.kys make.ps make.log make.pg make.toc make.tp make.tps \
make.vr make.vrs make.op make.tr make.cv make.cn
-rm -f $(srcdir)/doc/make.aux $(srcdir)/doc/make.cp $(srcdir)/doc/make.cps $(srcdir)/doc/make.dvi \
$(srcdir)/doc/make.fn $(srcdir)/doc/make.fns $(srcdir)/doc/make.ky $(srcdir)/doc/make.kys \
$(srcdir)/doc/make.ps $(srcdir)/doc/make.log $(srcdir)/doc/make.pg $(srcdir)/doc/make.toc \
$(srcdir)/doc/make.tp $(srcdir)/doc/make.tps $(srcdir)/doc/make.vr $(srcdir)/doc/make.vrs \
$(srcdir)/doc/make.op $(srcdir)/doc/make.tr $(srcdir)/doc/make.cv $(srcdir)/doc/make.cn \
$(srcdir)/doc/make.html
clean-aminfo:
distclean-aminfo:
maintainer-clean-aminfo:
for i in $(INFO_DEPS) make.i; do rm -f `eval echo $$i*`; done
for i in $(INFO_DEPS); do rm -f $$i*; done
install-man1:
$(mkinstalldirs) $(DESTDIR)$(man1dir)
@@ -279,13 +294,10 @@ uninstall-man:
# but do a sanity check: if $SUBDIRS will ever have more than
# a single directory, yell bloody murder.
all-recursive:
ifeq ($(words $(SUBDIRS)), 1)
ifeq ($(findstring glob, $(SUBDIRS)), glob)
@command.com /c if not exist glob\\nul md glob
@echo Making all in $(SUBDIRS)
$(MAKE) -C $(SUBDIRS) -f ../Makefile INCLUDES='-I$(srcdir) -I$(srcdir)/glob' DEFS='-I.. -I$(srcdir)' VPATH=$(srcdir)/glob libglob.a
else
@echo FATAL: There is more than one directory in "($(SUBDIRS))"
@$(EXIT_FAIL)
@echo Making all in glob
$(MAKE) -C glob -f ../Makefile INCLUDES='-I$(srcdir) -I$(srcdir)/glob' DEFS='-I.. -I$(srcdir)' VPATH=$(srcdir)/glob libglob.a
endif
$(SUBDIRS):
@@ -298,11 +310,13 @@ libglob.a: $(libglob_a_OBJECTS)
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive check-recursive:
ifeq ($(words $(SUBDIRS)), 1)
@echo Making $(shell echo $@ | sed s/-recursive//) in $(SUBDIRS)
$(MAKE) -C $(SUBDIRS) -f ../Makefile $(shell echo $@ | sed s/-recursive//)-am
ifeq ($(words $(SUBDIRS)), 2)
@echo Making $(shell echo $@ | sed s/-recursive//) in glob
$(MAKE) -C glob -f ../Makefile $(shell echo $@ | sed s/-recursive//)-am
@echo Making $(shell echo $@ | sed s/-recursive//) in doc
$(MAKE) -C doc -f ../Makefile $(shell echo $@ | sed s/-recursive//)-am
else
@echo FATAL: There is more than one directory in "($(SUBDIRS))"
@echo FATAL: There is more than two directory in "($(SUBDIRS))"
@$(EXIT_FAIL)
endif
@@ -310,10 +324,10 @@ tags-in-glob: $(libglob_a_SOURCES)
etags $(addprefix $(srcdir)/,$^) -o ./glob/TAGS
tags-recursive:
ifeq ($(words $(SUBDIRS)), 1)
ifeq ($(words $(SUBDIRS)), 2)
$(MAKE) tags-in-glob
else
@echo FATAL: There is more than one directory in "($(SUBDIRS))"
@echo FATAL: There is more than two directory in "($(SUBDIRS))"
@$(EXIT_FAIL)
endif
@@ -364,15 +378,44 @@ distdir: $(DISTFILES)
$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
$(MAKE) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook
info: $(INFO_DEPS) info-recursive
dvi: $(DVIS) dvi-recursive
info: info-recursive
info-recursive:
ifeq ($(findstring doc, $(SUBDIRS)), doc)
@command.com /c if not exist doc\\nul md doc
@echo Making all in doc
$(MAKE) -C doc -f ../Makefile VPATH=$(srcdir)/doc make.info
endif
dvi: dvi-recursive
dvi-recursive:
ifeq ($(findstring doc, $(SUBDIRS)), doc)
@command.com /c if not exist doc\\nul md doc
@echo Making all in doc
$(MAKE) -C doc -f ../Makefile VPATH=$(srcdir)/doc make.dvi
endif
ps: ps-recursive
ps-recursive:
ifeq ($(findstring doc, $(SUBDIRS)), doc)
@command.com /c if not exist doc\\nul md doc
@echo Making all in doc
$(MAKE) -C doc -f ../Makefile VPATH=$(srcdir)/doc make.ps
endif
html-recursive:
ifeq ($(findstring doc, $(SUBDIRS)), doc)
@command.com /c if not exist doc\\nul md doc
@echo Making all in doc
$(MAKE) -C doc -f ../Makefile VPATH=$(srcdir)/doc make.html
endif
check: all-am check-recursive check-local
@:
installcheck: installcheck-recursive
all-recursive-am: config.h
$(MAKE) all-recursive
all-am: Makefile $(INFO_DEPS) $(PROGRAMS) config.h
all-am: Makefile $(PROGRAMS) config.h info
install-exec-am: install-binPROGRAMS
@@ -454,7 +497,8 @@ maintainer-clean-depend info dvi check-local installcheck \
all-recursive-am all-am install-exec-am install-data-am uninstall-am \
install-exec install-data install uninstall all installdirs \
mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
maintainer-clean-generic clean mostlyclean distclean maintainer-clean \
html
# --------------- Local DIST Section

View File

@@ -1,22 +1,23 @@
# This is a -*-Makefile-*-, or close enough
#
# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc.
# Copyright (C) 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 2, or (at your option) any later version.
# 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.
# 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
# GNU Make; see the file COPYING. If not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
# this program. If not, see <http://www.gnu.org/licenses/>.
AUTOMAKE_OPTIONS = 1.8 dist-bzip2 check-news ansi2knr
AUTOMAKE_OPTIONS = 1.8 dist-bzip2 check-news
ACLOCAL_AMFLAGS = -I config
MAKE_HOST = @MAKE_HOST@

View File

@@ -4,20 +4,21 @@
# `build.sh' instead.
#
# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006 Free Software Foundation, Inc.
# 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 2, or (at your option) any later version.
# 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.
# 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
# GNU Make; see the file COPYING. If not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
# this program. If not, see <http://www.gnu.org/licenses/>.
#
# Makefile for GNU Make

311
NEWS
View File

@@ -1,6 +1,6 @@
GNU make NEWS -*-indented-text-*-
History of user-visible changes.
1 April 2006
28 July 2010
See the end of this file for copyrights and conditions.
@@ -8,6 +8,112 @@ All changes mentioned here are more fully described in the GNU make
manual, which is contained in this distribution as the file doc/make.texi.
See the README file and the GNU make manual for instructions for
reporting bugs.
Version 3.82
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=104&set=custom
* 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
the '-e' flag were provided. Because this would break many makefiles that
have been written to conform to the original text of the standard, the
default behavior of GNU make remains to invoke the shell with simply '-c'.
However, any makefile specifying the .POSIX special target will follow the
new POSIX standard and pass '-e' to the shell. See also .SHELLFLAGS
below.
* WARNING: Backward-incompatibility!
The '$?' variable now contains all prerequisites that caused the target to
be considered out of date, even if they do not exist (previously only
existing targets were provided in $?).
* WARNING: Backward-incompatibility!
As a result of parser enhancements, three backward-compatibility issues
exist: first, a prerequisite containing an "=" cannot be escaped with a
backslash any longer. You must create a variable containing an "=" and
use that variable in the prerequisite. Second, variable names can no
longer contain whitespace, unless you put the whitespace in a variable and
use the variable. Third, in previous versions of make it was sometimes
not flagged as an error for explicit and pattern targets to appear in the
same rule. Now this is always reported as an error.
* WARNING: Backward-incompatibility!
The pattern-specific variables and pattern rules are now applied in the
shortest stem first order instead of the definition order (variables
and rules with the same stem length are still applied in the definition
order). This produces the usually-desired behavior where more specific
patterns are preferred. To detect this feature search for 'shortest-stem'
in the .FEATURES special variable.
* WARNING: Backward-incompatibility!
The library search behavior has changed to be compatible with the standard
linker behavior. Prior to this version for prerequisites specified using
the -lfoo syntax make first searched for libfoo.so in the current
directory, vpath directories, and system directories. If that didn't yield
a match, make then searched for libfoo.a in these directories. Starting
with this version make searches first for libfoo.so and then for libfoo.a
in each of these directories in order.
* New command line option: --eval=STRING causes STRING to be evaluated as
makefile syntax (akin to using the $(eval ...) function). The evaluation
is performed after all default rules and variables are defined, but before
any makefiles are read.
* New special variable: .RECIPEPREFIX allows you to reset the recipe
introduction character from the default (TAB) to something else. The
first character of this variable value is the new recipe introduction
character. If the variable is set to the empty string, TAB is used again.
It can be set and reset at will; recipes will use the value active when
they were first parsed. To detect this feature check the value of
$(.RECIPEPREFIX).
* New special variable: .SHELLFLAGS allows you to change the options passed
to the shell when it invokes recipes. By default the value will be "-c"
(or "-ec" if .POSIX is set).
* New special target: .ONESHELL instructs make to invoke a single instance
of the shell and provide it with the entire recipe, regardless of how many
lines it contains. As a special feature to allow more straightforward
conversion of makefiles to use .ONESHELL, any recipe line control
characters ('@', '+', or '-') will be removed from the second and
subsequent recipe lines. This happens _only_ if the SHELL value is deemed
to be a standard POSIX-style shell. If not, then no interior line control
characters are removed (as they may be part of the scripting language used
with the alternate SHELL).
* New variable modifier 'private': prefixing a variable assignment with the
modifier 'private' suppresses inheritance of that variable by
prerequisites. This is most useful for target- and pattern-specific
variables.
* New make directive: 'undefine' allows you to undefine a variable so that
it appears as if it was never set. Both $(flavor) and $(origin) functions
will return 'undefined' for such a variable. To detect this feature search
for 'undefine' in the .FEATURES special variable.
* The parser for variable assignments has been enhanced to allow multiple
modifiers ('export', 'override', 'private') on the same line as variables,
including define/endef variables, and in any order. Also, it is possible
to create variables and targets named as these modifiers.
* The 'define' make directive now allows a variable assignment operator
after the variable name, to allow for simple, conditional, or appending
multi-line variable assignment.
Version 3.81
@@ -45,12 +151,12 @@ Version 3.81
* WARNING: Backward-incompatibility!
In order to comply with POSIX, the way in which GNU make processes
backslash-newline sequences in command strings has changed. If your
makefiles use backslash-newline sequences inside of single-quoted
strings in command scripts you will be impacted by this change. See
the GNU make manual subsection "Splitting Command Lines" (node
"Splitting Lines"), in section "Command Syntax", chapter "Writing the
Commands in Rules", for details.
backslash-newline sequences in recipes has changed. If your makefiles
use backslash-newline sequences inside of single-quoted strings in
recipes you will be impacted by this change. See the GNU make manual
subsection "Splitting Recipe Lines" (node "Splitting Lines"), in
section "Recipe Syntax", chapter "Writing Recipe in Rules", for
details.
* WARNING: Backward-incompatibility!
Some previous versions of GNU make had a bug where "#" in a function
@@ -59,7 +165,7 @@ Version 3.81
fixed: if your makefile uses "\#" in a function invocation the
backslash is now preserved, so you'll need to remove it.
* New command-line option: -L (--check-symlink-times). On systems that
* New command line option: -L (--check-symlink-times). On systems that
support symbolic links, if this option is given then GNU make will
use the most recent modification time of any symbolic links that are
used to resolve target files. The default behavior remains as it
@@ -120,7 +226,7 @@ Version 3.81
argument if all arguments are true.
* Changes made for POSIX compatibility:
- Only touch targets (under -t) if they have at least one command.
- Only touch targets (under -t) if they have a recipe.
- Setting the SHELL make variable does NOT change the value of the
SHELL environment variable given to programs invoked by make. As
an enhancement to POSIX, if you export the make variable SHELL then
@@ -193,7 +299,7 @@ Version 3.80
expanded it returns a complete list of variable names defined by all
makefiles at that moment.
* A new command-line option is defined, -B or --always-make. If
* A new command line option is defined, -B or --always-make. If
specified GNU make will consider all targets out-of-date even if they
would otherwise not be.
@@ -474,7 +580,7 @@ Version 3.72
* The `MAKEFLAGS' variable (in the environment or in a makefile) can now
contain variable definitions itself; these are treated just like
command-line variable definitions. Make will automatically insert any
command line variable definitions. Make will automatically insert any
variable definitions from the environment value of `MAKEFLAGS' or from
the command line, into the `MAKEFLAGS' value exported to children. The
`MAKEOVERRIDES' variable previously included in the value of `$(MAKE)'
@@ -483,8 +589,8 @@ Version 3.72
in the environment when its size is limited.
* If `.DELETE_ON_ERROR' appears as a target, Make will delete the target of
a rule if it has changed when its commands exit with a nonzero status,
just as when the commands get a signal.
a rule if it has changed when its recipe exits with a nonzero status,
just as when the recipe gets a signal.
* The automatic variable `$+' is new. It lists all the dependencies like
`$^', but preserves duplicates listed in the makefile. This is useful
@@ -494,9 +600,9 @@ Version 3.72
* You can now specify the `.IGNORE' and `.SILENT' special targets with
dependencies to limit their effects to those files. If a file appears as
a dependency of `.IGNORE', then errors will be ignored while running the
commands to update that file. Likewise if a file appears as a dependency
of `.SILENT', then the commands to update that file will not be printed
before they are run. (This change was made to conform to POSIX.2.)
recipe to update that file. Likewise if a file appears as a dependency
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
@@ -544,22 +650,22 @@ Version 3.69
Make, and a string describing the remote job support compiled in (if any).
Thus the value (in this release) is something like `3.69' or `3.69-Customs'.
* Commands in an invocation of the `shell' function are no longer run with
a modified environment like target commands are. As in versions before
* Commands in an invocation of the `shell' function are no longer run
with a modified environment like recipes are. As in versions before
3.68, they now run with the environment that `make' started with. We
have reversed the change made in version 3.68 because it turned out to
cause a paradoxical situation in cases like:
export variable = $(shell echo value)
When Make attempted to put this variable in the environment for a target
command, it would try expand the value by running the shell command
When Make attempted to put this variable in the environment for a
recipe, it would try expand the value by running the shell command
`echo value'. In version 3.68, because it constructed an environment
for that shell command in the same way, Make would begin to go into an
infinite loop and then get a fatal error when it detected the loop.
* The commands given for `.DEFAULT' are now used for phony targets with no
commands.
* The recipe given for `.DEFAULT' is now used for phony targets with no
recipe.
Version 3.68
@@ -583,8 +689,8 @@ Version 3.68
no error (not even a warning) for a nonexistent makefile.
* Commands in an invocation of the `shell' function are now run with a
modified environment like target commands are, so you can use `export' et
al to set up variables for them. They used to run with the environment
modified environment like recipes are, so you can use `export' et al
to set up variables for them. They used to run with the environment
that `make' started with.
Version 3.66
@@ -628,8 +734,8 @@ Version 3.63
change directory, and recursive use of Make, now set `-w' automatically.
* Multiple double-colon rules for the same target will no longer have their
commands run simultaneously under -j, as this could result in the two
commands trying to change the file at the same time and interfering with
recipes run simultaneously under -j, as this could result in the two
recipes trying to change the file at the same time and interfering with
one another.
* The `SHELL' variable is now never taken from the environment.
@@ -641,7 +747,7 @@ Version 3.63
that tells you what all the options are and what they do. Try `make --help'.
* There are two new directives: `export' and `unexport'. All variables are
no longer automatically put into the environments of the commands that
no longer automatically put into the environments of the recipe lines that
Make runs. Instead, only variables specified on the command line or in
the environment are exported by default. To export others, use:
export VARIABLE
@@ -656,8 +762,8 @@ Version 3.63
to get the old behavior. See the node `Variables/Recursion' in the manual
for a full description.
* The commands from the `.DEFAULT' special target are only applied to
targets which have no rules at all, not all targets with no commands.
* The recipe from the `.DEFAULT' special target is only applied to
targets which have no rules at all, not all targets with no recipe.
This change was made for compatibility with Unix make.
* All fatal error messages now contain `***', so they are easy to find in
@@ -709,8 +815,8 @@ Version 3.61
* Built-in rules for C++ source files with the `.C' suffix.
We still recommend that you use `.cc' instead.
* If commands are given too many times for a single target,
the last set given is used, and a warning message is printed.
* If a recipe is given too many times for a single target, the last one
given is used, and a warning message is printed.
* Error messages about makefiles are in standard GNU error format,
so C-x ` in Emacs works on them.
@@ -727,7 +833,7 @@ Version 3.60
* Archives on AIX now supposedly work.
* When the commands specified for .DEFAULT are used to update a target,
* When the recipes specified for .DEFAULT are used to update a target,
the $< automatic variable is given the same value as $@ for that target.
This is how Unix make behaves, and this behavior is mandated by POSIX.2.
@@ -752,18 +858,18 @@ Version 3.57
Version 3.55
* There is now a Unix man page for GNU Make. It is certainly not a replacement
for the Texinfo manual, but it documents the basic functionality and the
switches. For full documentation, you should still read the Texinfo manual.
Thanks to Dennis Morse of Stanford University for contributing the initial
version of this.
* There is now a Unix man page for GNU Make. It is certainly not a
replacement for the Texinfo manual, but it documents the basic
functionality and the switches. For full documentation, you should
still read the Texinfo manual. Thanks to Dennis Morse of Stanford
University for contributing the initial version of this.
* Variables which are defined by default (e.g., `CC') will no longer be put
into the environment for child processes. (If these variables are reset by the
environment, makefiles, or the command line, they will still go into the
environment.)
* Variables which are defined by default (e.g., `CC') will no longer be
put into the environment for child processes. (If these variables are
reset by the environment, makefiles, or the command line, they will
still go into the environment.)
* Makefiles which have commands but no dependencies (and thus are always
* Makefiles which have recipes but no dependencies (and thus are always
considered out of date and in need of remaking), will not be remade (if they
were being remade only because they were makefiles). This means that GNU
Make will no longer go into an infinite loop when fed the makefiles that
@@ -775,45 +881,45 @@ pathname (instead of a `%' pattern).
Version 3.51
* When removing intermediate files, only one `rm' command line is printed,
listing all file names.
listing all file names.
* There are now automatic variables `$(^D)', `$(^F)', `$(?D)', and `$(?F)'.
These are the directory-only and file-only versions of `$^' and `$?'.
These are the directory-only and file-only versions of `$^' and `$?'.
* Library dependencies given as `-lNAME' will use "libNAME.a" in the current
directory if it exists.
directory if it exists.
* The automatic variable `$($/)' is no longer defined.
* Leading `+' characters on a command line make that line be executed even
under -n, -t, or -q (as if the line contained `$(MAKE)').
* Leading `+' characters on a recipe line make that line be executed even
under -n, -t, or -q (as if the line contained `$(MAKE)').
* For command lines containing `$(MAKE)', `${MAKE}', or leading `+' characters,
only those lines are executed, not their entire rules.
(This is how Unix make behaves for lines containing `$(MAKE)' or `${MAKE}'.)
* For recipe lines containing `$(MAKE)', `${MAKE}', or leading `+' characters,
only those lines are executed, not the entire recipe.
(This is how Unix make behaves for lines containing `$(MAKE)' or `${MAKE}'.)
Version 3.50
* Filenames in rules will now have ~ and ~USER expanded.
* The `-p' output has been changed so it can be used as a makefile.
(All information that isn't specified by makefiles is prefaced with comment
characters.)
(All information that isn't specified by makefiles is prefaced with comment
characters.)
Version 3.49
* The % character can be quoted with backslash in implicit pattern rules,
static pattern rules, `vpath' directives, and `patsubst', `filter', and
`filter-out' functions. A warning is issued if a `vpath' directive's
pattern contains no %.
static pattern rules, `vpath' directives, and `patsubst', `filter', and
`filter-out' functions. A warning is issued if a `vpath' directive's
pattern contains no %.
* The `wildcard' variable expansion function now expands ~ and ~USER.
* Messages indicating failed commands now contain the target name:
* Messages indicating failed recipe lines now contain the target name:
make: *** [target] Error 1
* The `-p' output format has been changed somewhat to look more like
makefile rules and to give all information that Make has about files.
makefile rules and to give all information that Make has about files.
Version 3.48
@@ -822,49 +928,49 @@ Version 3.47
* The `-l' switch with no argument removes any previous load-average limit.
* When the `-w' switch is in effect, and Make has updated makefiles,
it will write a `Leaving directory' messagfe before re-executing itself.
This makes the `directory change tracking' changes to Emacs's compilation
commands work properly.
it will write a `Leaving directory' message before re-executing itself.
This makes the `directory change tracking' changes to Emacs's compilation
commands work properly.
Version 3.46
* The automatic variable `$*' is now defined for explicit rules,
as it is in Unix make.
as it is in Unix make.
Version 3.45
* The `-j' switch is now put in the MAKEFLAGS and MFLAGS variables when
specified without an argument (indicating infinite jobs).
The `-l' switch is not always put in the MAKEFLAGS and MFLAGS variables.
specified without an argument (indicating infinite jobs).
The `-l' switch is not always put in the MAKEFLAGS and MFLAGS variables.
* Make no longer checks hashed directories after running commands.
The behavior implemented in 3.41 caused too much slowdown.
* Make no longer checks hashed directories after running recipes.
The behavior implemented in 3.41 caused too much slowdown.
Version 3.44
* A dependency is NOT considered newer than its dependent if
they have the same modification time. The behavior implemented
in 3.43 conflicts with RCS.
they have the same modification time. The behavior implemented
in 3.43 conflicts with RCS.
Version 3.43
* Dependency loops are no longer fatal errors.
* A dependency is considered newer than its dependent if
they have the same modification time.
they have the same modification time.
Version 3.42
* The variables F77 and F77FLAGS are now set by default to $(FC) and
$(FFLAGS). Makefiles designed for System V make may use these variables in
explicit rules and expect them to be set. Unfortunately, there is no way to
make setting these affect the Fortran implicit rules unless FC and FFLAGS
are not used (and these are used by BSD make).
$(FFLAGS). Makefiles designed for System V make may use these variables in
explicit rules and expect them to be set. Unfortunately, there is no way to
make setting these affect the Fortran implicit rules unless FC and FFLAGS
are not used (and these are used by BSD make).
Version 3.41
* Make now checks to see if its hashed directories are changed by commands.
Other makes that hash directories (Sun, 4.3 BSD) don't do this.
* Make now checks to see if its hashed directories are changed by recipes.
Other makes that hash directories (Sun, 4.3 BSD) don't do this.
Version 3.39
@@ -873,7 +979,7 @@ Version 3.39
Version 3.32
* A file beginning with a dot can be the default target if it also contains
a slash (e.g., `../bin/foo'). (Unix make allows this as well.)
a slash (e.g., `../bin/foo'). (Unix make allows this as well.)
Version 3.31
@@ -882,8 +988,8 @@ Version 3.31
* Yet more USG stuff.
* Minimal support for Microport System V (a 16-bit machine and a
brain-damaged compiler). This has even lower priority than other USG
support, so if it gets beyond trivial, I will take it out completely.
brain-damaged compiler). This has even lower priority than other USG
support, so if it gets beyond trivial, I will take it out completely.
* Revamped default implicit rules (not much visible change).
@@ -894,13 +1000,13 @@ Version 3.30
* Improved support for USG and HPUX (hopefully).
* A variable reference like `$(foo:a=b)', if `a' contains a `%', is
equivalent to `$(patsubst a,b,$(foo))'.
equivalent to `$(patsubst a,b,$(foo))'.
* Defining .DEFAULT with no deps or commands clears its commands.
* Defining .DEFAULT with no deps or recipe clears its recipe.
* New default implicit rules for .S (cpp, then as), and .sh (copy and make
executable). All default implicit rules that use cpp (even indirectly), use
$(CPPFLAGS).
* New default implicit rules for .S (cpp, then as), and .sh (copy and
make executable). All default implicit rules that use cpp (even
indirectly), use $(CPPFLAGS).
Version 3.29
@@ -909,21 +1015,21 @@ Version 3.29
Version 3.28
* New option: "-l LOAD" says not to start any new jobs while others are
running if the load average is not below LOAD (a floating-point number).
running if the load average is not below LOAD (a floating-point number).
* There is support in place for implementations of remote command execution
in Make. See the file remote.c.
in Make. See the file remote.c.
Version 3.26
* No more than 10 directories will be kept open at once.
(This number can be changed by redefining MAX_OPEN_DIRECTORIES in dir.c.)
(This number can be changed by redefining MAX_OPEN_DIRECTORIES in dir.c.)
Version 3.25
* Archive files will have their modification times recorded before doing
anything that might change their modification times by updating an archive
member.
anything that might change their modification times by updating an archive
member.
Version 3.20
@@ -932,25 +1038,25 @@ Version 3.20
Version 3.19
* The recursion level indications in error messages are much shorter than
they were in version 3.14.
they were in version 3.14.
Version 3.18
* Leading spaces before directives are ignored (as documented).
* Included makefiles can determine the default goal target.
(System V Make does it this way, so we are being compatible).
(System V Make does it this way, so we are being compatible).
Version 3.14.
* Variables that are defaults built into Make will not be put in the
environment for children. This just saves some environment space and,
except under -e, will be transparent to sub-makes.
environment for children. This just saves some environment space and,
except under -e, will be transparent to sub-makes.
* Error messages from sub-makes will indicate the level of recursion.
* Hopefully some speed-up for large directories due to a change in the
directory hashing scheme.
directory hashing scheme.
* One child will always get a standard input that is usable.
@@ -959,7 +1065,7 @@ directory hashing scheme.
Version 3.13.
* Count parentheses inside expansion function calls so you can
have nested calls: `$(sort $(foreach x,a b,$(x)))'.
have nested calls: `$(sort $(foreach x,a b,$(x)))'.
Version 3.12.
@@ -975,15 +1081,15 @@ Version 3.12.
* Makefiles will be updated and re-read if necessary.
* Can now run several commands at once (parallelism), -j option.
* Can now run several recipes at once (parallelism), -j option.
* Error messages will contain the level of Make recursion, if any.
* The `MAKEFLAGS' and `MFLAGS' variables will be scanned for options after
makefiles are read.
makefiles are read.
* A double-colon rule with no dependencies will always have its commands run.
(This is how both the BSD and System V versions of Make do it.)
* A double-colon rule with no dependencies will always have its recipe run.
(This is how both the BSD and System V versions of Make do it.)
Version 3.05
@@ -991,18 +1097,17 @@ Version 3.05
-------------------------------------------------------------------------------
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
Foundation, Inc.
This file is part of GNU Make.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
this program. If not, see <http://www.gnu.org/licenses/>.

View File

@@ -4,20 +4,21 @@
# run 'build_w32.bat' instead.
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
# 2006 Free Software Foundation, Inc.
# 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 2, or (at your option) any later version.
# 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.
# 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
# GNU Make; see the file COPYING. If not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
# this program. If not, see <http://www.gnu.org/licenses/>.
LINK = link
CC = cl
@@ -32,10 +33,9 @@ CFLAGS_debug = $(CFLAGS_any) /Od /D DEBUG /D _DEBUG /FR.\WinDebug/ /Fp.\WinDebug
CFLAGS_release = $(CFLAGS_any) /O2 /D NDEBUG /FR.\WinRel/ /Fp.\WinRel/make.pch /Fo.\WinRel/
LDFLAGS_debug = w32\subproc\WinDebug\subproc.lib /NOLOGO /SUBSYSTEM:console\
/INCREMENTAL:no /PDB:WinDebug/make.pdb /MACHINE:I386 \
/OUT:WinDebug/make.exe /DEBUG
/INCREMENTAL:no /PDB:WinDebug/make.pdb /OUT:WinDebug/make.exe /DEBUG
LDFLAGS_release = w32\subproc\WinRel\subproc.lib /NOLOGO /SUBSYSTEM:console\
/INCREMENTAL:no /MACHINE:I386 /OUT:WinRel/make.exe
/INCREMENTAL:no /OUT:WinRel/make.exe
all: config.h subproc Release Debug

View File

@@ -62,17 +62,17 @@ If you plan to use recursive makes, install make resident:
-------------------------------------------------------------------------------
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006 Free Software Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
this program. If not, see <http://www.gnu.org/licenses/>.

View File

@@ -325,17 +325,17 @@ Bug reports:
-------------------------------------------------------------------------------
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006 Free Software Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
this program. If not, see <http://www.gnu.org/licenses/>.

View File

@@ -13,7 +13,7 @@ GNU make supports both shell types. The following list defines the order
that is used to determine the shell:
1. The shell specified by the environment variable MAKESHELL.
2. The shell specified by the SHELL variable within a Makefile. As on
2. The shell specified by the SHELL variable within a Makefile. Like
Unix, SHELL is NOT taken from the environment.
3. The shell specified by the COMSPEC environment variable.
4. The shell specified by the OS2_SHELL environment variable.
@@ -64,7 +64,7 @@ A standard Unix like build environment:
- GNU texinfo (you can use 3.1 (gnuinfo.zip), but I recommend 4.0)
If you want to recreate the configuration files (developers only!)
you need also: GNU m4 1.4, autoconf 2.59, automake 1.8.2 (or compatible)
you need also: GNU m4 1.4, autoconf 2.59, automake 1.9.6 (or compatible)
III. ***** COMPILATION AND INSTALLATION *****
@@ -83,7 +83,7 @@ b) Installation into x:/usr
Note: Although it is possible to compile make using "./configure",
"make", "make install" this is not recommended. In particular,
you must ALWAYS use LDFLAGS="-Zstack 0x8000" because the default
you must ALWAYS use LDFLAGS="-Zstack 0x6000" because the default
stack size is far to small and make will not work properly!
Recommended environment variables and installation options:
@@ -91,13 +91,13 @@ Recommended environment variables and installation options:
export ac_executable_extensions=".exe"
export CPPFLAGS="-D__ST_MT_ERRNO__"
export CFLAGS="-O2 -Zomf -Zmt"
export LDFLAGS="-Zcrtdll -Zlinker /exepack:2 -Zlinker /pm:vio -Zstack 0x8000"
export LDFLAGS="-Zcrtdll -Zlinker /exepack:2 -Zlinker /pm:vio -Zstack 0x6000"
export RANLIB="echo"
./configure --prefix=x:/usr --infodir=x:/usr/share/info --mandir=x:/usr/share/man --without-included-gettext
make AR=emxomfar
make install
Note: If you use gcc 2.9.x or higher I recommend to set also LIBS="-lgcc"
Note: If you use gcc 2.9.x I recommend to set also LIBS="-lgcc"
Note: You can add -DNO_CMD_DEFAULT and -DNO_CHDIR2 to CPPFLAGS.
See section I. for details.
@@ -148,29 +148,30 @@ To run the testsuite do the following:
export CPPFLAGS="-D__ST_MT_ERRNO__ -DNO_CMD_DEFAULT -DNO_CHDIR2"
export CFLAGS="-Zomf -O2 -Zmt"
export LDFLAGS="-Zcrtdll -s -Zlinker /exepack:2 -Zlinker /pm:vio -Zstack 0x8000"
export LDFLAGS="-Zcrtdll -s -Zlinker /exepack:2 -Zlinker /pm:vio -Zstack 0x6000"
export RANLIB="echo"
./configure --prefix=x:/usr --disable-nls
make AR=emxomfar
make check
All tests should work fine with the exception of "default_names" which
is because OS/2 file systems are not case sensitive ("makefile" and
"Makefile" specify the same file).
All tests should work fine with the exception of one of the "INCLUDE_DIRS"
tests which will fail if your /usr/include directory is on a drive different
from the make source tree.
-------------------------------------------------------------------------------
Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Copyright (C) 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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
this program. If not, see <http://www.gnu.org/licenses/>.

View File

@@ -1,10 +1,10 @@
This version of GNU make has been tested on Microsoft Windows 2000/XP/2003.
It has also been used on Windows 95/98/NT, and on OS/2.
It builds natively with MSVC 2.x, 4.x, 5.x, 6.x, and 2003 as well as
.NET 7.x and .NET 2003.
It builds with the MinGW port of GCC (tested with GCC 3.4.2).
It builds with the MinGW port of GCC 3.x (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.
The Windows 32-bit port of GNU make is maintained jointly by various
people. It was originally made by Rob Tulloh.
@@ -27,7 +27,8 @@ Using make_msvc_net2003.vcproj
------------------------------
2. Open make_msvc_net2003.vcproj in MSVS71 or MSVC71 or any compatible IDE,
then build this project as usual.
then build this project as usual. There's also a solution file for
Studio 2003.
Building with (MinGW-)GCC using build_w32.bat
@@ -68,10 +69,12 @@ 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 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 version of Visual C++,
which is the predominant compiler used on 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
@@ -79,11 +82,11 @@ GNU make on Windows 32-bit platforms:
GNU make and sh.exe:
This port prefers 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"
@@ -108,9 +111,25 @@ GNU make and brain-dead shells (BATCH_MODE_ONLY_SHELL):
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%). Note that parallel
builds (-j) require a working Bourne shell; they will not work
with COM.
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.
GNU make and Cygnus GNU Windows32 tools:
@@ -171,29 +190,11 @@ GNU make test suite:
on Windows NT). All tests pass in an environment that includes
sh.exe. Tests were performed on both Windows NT and Windows 95.
Building GNU make on Windows NT and Windows 95/98 with Microsoft Visual C:
I did not provide a Visual C project file with this port as
the project file would not be considered freely distributable
(or so I think). It is easy enough to create one, though, if
you know how to use Visual C.
I build the program statically to avoid problems locating DLL's
on machines that may not have MSVC runtime installed. If you
prefer, you can change make to build with shared libraries by
changing /MT to /MD in the NMakefile (or in build_w32.bat).
The program has not been built for non-Intel architectures (yet).
I have not tried to build with any other compilers than MSVC. I
have heard that this is possible though so don't be afraid to
notify me of your successes!
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 legal under Unix too, but are never encouraged.
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
@@ -272,17 +273,17 @@ Bug reports:
-------------------------------------------------------------------------------
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006 Free Software Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
this program. If not, see <http://www.gnu.org/licenses/>.

View File

@@ -96,18 +96,18 @@ SunOS 4.1.x:
-------------------------------------------------------------------------------
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
Copyright (C) 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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
this program. If not, see <http://www.gnu.org/licenses/>.

View File

@@ -1,20 +1,20 @@
-*-text-*-
-------------------------------------------------------------------------------
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Make.
Copyright (C) 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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
this program. If not, see <http://www.gnu.org/licenses/>.
-------------------------------------------------------------------------------
Obtaining CVS Code
@@ -169,6 +169,13 @@ what you do:
It will 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>
Where to Announce
-----------------
@@ -203,6 +210,10 @@ make update
make
make check
Or, for a debugging version:
autoreconf -i && ./configure CFLAGS=-g && make update && make && make check
Or, all-in-one:
autoreconf -i && ./configure && make update && make && make check

View File

@@ -172,18 +172,18 @@ 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 Free Software Foundation,
Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
this program. If not, see <http://www.gnu.org/licenses/>.

View File

@@ -4,20 +4,21 @@
# run 'build.sh' instead.
#
# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006 Free Software Foundation, Inc.
# 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 2, or (at your option) any later version.
# 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.
# 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
# GNU Make; see the file COPYING. If not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
# this program. If not, see <http://www.gnu.org/licenses/>.
#
# Makefile for GNU Make

View File

@@ -65,10 +65,7 @@ The Rest of the List
what does that mean?
3) Multi-token pattern rule matching (allow %1/%2.c : %1/obj/%2.o,
etc., or something like that). I have an implementation of this
already, it just needs some refinement... maybe. Additionally I
think it only works for static pattern rules; it might need to be
fixed up to work with normal pattern rules, too.
etc., or something like that). Maybe using regex?
4) Provide a .TARGETS variable, containing the names of the targets
defined in the makefile.
@@ -128,18 +125,18 @@ The Rest of the List
-------------------------------------------------------------------------------
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
Software Foundation, Inc.
Copyright (C) 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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
this program. If not, see <http://www.gnu.org/licenses/>.

View File

@@ -1,25 +1,22 @@
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
dnl Free Software Foundation, Inc.
dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
dnl 2008, 2009, 2010 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
dnl under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2, or (at your option)
dnl GNU Make is free software; you can redistribute it and/or modify it under
dnl the terms of the GNU General Public License as published by the Free
dnl Software Foundation; either version 3 of the License, or (at your option)
dnl any later version.
dnl
dnl GNU Make is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl General Public License for more details.
dnl GNU Make is distributed in the hope that it will be useful, but WITHOUT
dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
dnl more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with GNU Make; see the file COPYING. If not, write to the
dnl Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
dnl MA 02110-1301 USA.
dnl You should have received a copy of the GNU General Public License along
dnl with this program. If not, see <http://www.gnu.org/licenses/>.
dnl ---------------------------------------------------------------------------
dnl Got this from the lynx 2.8 distribution.
@@ -62,9 +59,6 @@ fi
#
AC_CHECK_FUNCS(gethostbyname,,[
CF_RECHECK_FUNC(gethostbyname,nsl,cf_cv_netlibs)])
#
AC_CHECK_FUNCS(strcasecmp,,[
CF_RECHECK_FUNC(strcasecmp,resolv,cf_cv_netlibs)])
])
LIBS="$LIBS $cf_cv_netlibs"
test $cf_test_netlibs = no && echo "$cf_cv_netlibs" >&AC_FD_MSG

View File

@@ -1,19 +1,19 @@
/* Running commands on Amiga
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006 Free Software Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
#include "make.h"
#include "variable.h"
@@ -116,4 +116,3 @@ wildcard_expansion (char *wc, char *o)
return o;
}

13
amiga.h
View File

@@ -1,20 +1,19 @@
/* Definitions for amiga specific things
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006 Free Software Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
extern int MyExecute PARAMS ((char ** argv));
extern char * wildcard_expansion PARAMS ((char * wc, char * o));
this program. If not, see <http://www.gnu.org/licenses/>. */
int MyExecute (char ** argv);
char * wildcard_expansion (char * wc, char * o);

150
ar.c
View File

@@ -1,20 +1,21 @@
/* 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 Free Software
Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
#include "make.h"
@@ -24,29 +25,23 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
#include "dep.h"
#include <fnmatch.h>
/* Defined in arscan.c. */
extern long int ar_scan PARAMS ((char *archive, long int (*function) (), long int arg));
extern int ar_name_equal PARAMS ((char *name, char *mem, int truncated));
#ifndef VMS
extern int ar_member_touch PARAMS ((char *arname, char *memname));
#endif
/* Return nonzero if NAME is an archive-member reference, zero if not.
An archive-member reference is a name like `lib(member)'.
/* 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
non-empty string.
If a name like `lib((entry))' is used, a fatal error is signaled at
the attempt to use this unsupported feature. */
int
ar_name (char *name)
ar_name (const char *name)
{
char *p = strchr (name, '(');
char *end;
const char *p = strchr (name, '(');
const char *end;
if (p == 0 || p == name)
return 0;
end = p + strlen (p) - 1;
if (*end != ')')
if (*end != ')' || end == p + 1)
return 0;
if (p[1] == '(' && end[-1] == ')')
@@ -57,31 +52,41 @@ ar_name (char *name)
/* Parse the archive-member reference NAME into the archive and member names.
Put the malloc'd archive name in *ARNAME_P if ARNAME_P is non-nil;
put the malloc'd member name in *MEMNAME_P if MEMNAME_P is non-nil. */
Creates one allocated string containing both names, pointed to by ARNAME_P.
MEMNAME_P points to the member. */
void
ar_parse_name (char *name, char **arname_p, char **memname_p)
ar_parse_name (const char *name, char **arname_p, char **memname_p)
{
char *p = strchr (name, '('), *end = name + strlen (name) - 1;
char *p;
if (arname_p != 0)
*arname_p = savestring (name, p - name);
if (memname_p != 0)
*memname_p = savestring (p + 1, end - (p + 1));
*arname_p = xstrdup (name);
p = strchr (*arname_p, '(');
*(p++) = '\0';
p[strlen(p) - 1] = '\0';
*memname_p = p;
}
static long int ar_member_date_1 PARAMS ((int desc, char *mem, int truncated, long int hdrpos,
long int datapos, long int size, long int date, int uid, int gid, int mode, char *name));
/* 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 size UNUSED, long int date,
int uid UNUSED, int gid UNUSED, int mode UNUSED,
const void *name)
{
return ar_name_equal (name, mem, truncated) ? date : 0;
}
/* Return the modtime of NAME. */
time_t
ar_member_date (char *name)
ar_member_date (const char *name)
{
char *arname;
int arname_used = 0;
char *memname;
long int val;
@@ -98,67 +103,43 @@ ar_member_date (char *name)
struct file *arfile;
arfile = lookup_file (arname);
if (arfile == 0 && file_exists_p (arname))
{
arfile = enter_file (arname);
arname_used = 1;
}
arfile = enter_file (strcache_add (arname));
if (arfile != 0)
(void) f_mtime (arfile, 0);
}
val = ar_scan (arname, ar_member_date_1, (long int) memname);
val = ar_scan (arname, ar_member_date_1, memname);
if (!arname_used)
free (arname);
free (memname);
free (arname);
return (val <= 0 ? (time_t) -1 : (time_t) val);
}
/* 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, char *mem, int truncated,
long int hdrpos UNUSED, long int datapos UNUSED,
long int size UNUSED, long int date,
int uid UNUSED, int gid UNUSED, int mode UNUSED, char *name)
{
return ar_name_equal (name, mem, truncated) ? date : 0;
}
/* Set the archive-member NAME's modtime to now. */
#ifdef VMS
int
ar_touch (char *name)
ar_touch (const char *name)
{
error (NILF, _("touch archive member is not available on VMS"));
return -1;
}
#else
int
ar_touch (char *name)
ar_touch (const char *name)
{
char *arname, *memname;
int arname_used = 0;
register int val;
int val;
ar_parse_name (name, &arname, &memname);
/* Make sure we know the modtime of the archive itself before we
touch the member, since this will change the archive itself. */
touch the member, since this will change the archive modtime. */
{
struct file *arfile;
arfile = lookup_file (arname);
if (arfile == 0)
{
arfile = enter_file (arname);
arname_used = 1;
}
(void) f_mtime (arfile, 0);
arfile = enter_file (strcache_add (arname));
f_mtime (arfile, 0);
}
val = 1;
@@ -185,9 +166,7 @@ ar_touch (char *name)
_("touch: Bad return code from ar_member_touch on `%s'"), name);
}
if (!arname_used)
free (arname);
free (memname);
free (arname);
return val;
}
@@ -197,8 +176,8 @@ ar_touch (char *name)
struct ar_glob_state
{
char *arname;
char *pattern;
const char *arname;
const char *pattern;
unsigned int size;
struct nameseq *chain;
unsigned int n;
@@ -208,16 +187,18 @@ struct ar_glob_state
element against the pattern in STATE. */
static long int
ar_glob_match (int desc UNUSED, char *mem, int truncated UNUSED,
ar_glob_match (int desc UNUSED, const char *mem, int truncated UNUSED,
long int hdrpos UNUSED, long int datapos UNUSED,
long int size UNUSED, long int date UNUSED, int uid UNUSED,
int gid UNUSED, int mode UNUSED, struct ar_glob_state *state)
int gid UNUSED, int mode UNUSED, const void *arg)
{
struct ar_glob_state *state = (struct ar_glob_state *)arg;
if (fnmatch (state->pattern, mem, FNM_PATHNAME|FNM_PERIOD) == 0)
{
/* We have a match. Add it to the chain. */
struct nameseq *new = (struct nameseq *) xmalloc (state->size);
new->name = concat (state->arname, mem, ")");
struct nameseq *new = xcalloc (state->size);
new->name = strcache_add (concat (4, state->arname, "(", mem, ")"));
new->next = state->chain;
state->chain = new;
++state->n;
@@ -232,7 +213,7 @@ static int
glob_pattern_p (const char *pattern, int quote)
{
const char *p;
int open = 0;
int opened = 0;
for (p = pattern; *p != '\0'; ++p)
switch (*p)
@@ -247,11 +228,11 @@ glob_pattern_p (const char *pattern, int quote)
break;
case '[':
open = 1;
opened = 1;
break;
case ']':
if (open)
if (opened)
return 1;
break;
}
@@ -263,11 +244,11 @@ glob_pattern_p (const char *pattern, int quote)
Return a malloc'd chain of matching elements (or nil if none). */
struct nameseq *
ar_glob (char *arname, char *member_pattern, unsigned int size)
ar_glob (const char *arname, const char *member_pattern, unsigned int size)
{
struct ar_glob_state state;
char **names;
struct nameseq *n;
const char **names;
unsigned int i;
if (! glob_pattern_p (member_pattern, 1))
@@ -275,28 +256,25 @@ ar_glob (char *arname, char *member_pattern, unsigned int size)
/* Scan the archive for matches.
ar_glob_match will accumulate them in STATE.chain. */
i = strlen (arname);
state.arname = (char *) alloca (i + 2);
bcopy (arname, state.arname, i);
state.arname[i] = '(';
state.arname[i + 1] = '\0';
state.arname = arname;
state.pattern = member_pattern;
state.size = size;
state.chain = 0;
state.n = 0;
(void) ar_scan (arname, ar_glob_match, (long int) &state);
ar_scan (arname, ar_glob_match, &state);
if (state.chain == 0)
return 0;
/* Now put the names into a vector for sorting. */
names = (char **) alloca (state.n * sizeof (char *));
names = alloca (state.n * sizeof (const char *));
i = 0;
for (n = state.chain; n != 0; n = n->next)
names[i++] = n->name;
/* Sort them alphabetically. */
qsort ((char *) names, i, sizeof (*names), alpha_compare);
/* MSVC erroneously warns without a cast here. */
qsort ((void *)names, i, sizeof (*names), alpha_compare);
/* Put them back into the chain in the sorted order. */
i = 0;

219
arscan.c
View File

@@ -1,20 +1,20 @@
/* 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 Free Software Foundation,
Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
#include "make.h"
@@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
#endif
#ifndef NO_ARCHIVES
#ifdef VMS
#include <lbrdef.h>
#include <mhddef.h>
@@ -66,7 +66,7 @@ VMS_get_member_info (struct dsc$descriptor_s *module, unsigned long *rfa)
&bufdesc.dsc$w_length, 0);
if (! (status & 1))
{
error (NILF, _("lbr$set_module failed to extract module info, status = %d"),
error (NILF, _("lbr$set_module() failed to extract module info, status = %d"),
status);
lbr$close (&VMS_lib_idx);
@@ -81,7 +81,28 @@ VMS_get_member_info (struct dsc$descriptor_s *module, unsigned long *rfa)
* but that decc$fix_time() isn't documented to work this way. Let me
* know if this causes problems in other VMS environments.
*/
val = decc$fix_time (&mhd->mhd$l_datim) + timezone - daylight*3600;
{
/* Modified by M. Gehre at 11-JAN-2008 because old formula is wrong:
* val = decc$fix_time (&mhd->mhd$l_datim) + timezone - daylight*3600;
* a) daylight specifies, if the timezone has daylight saving enabled, not
* if it is active
* b) what we need is the information, if daylight saving was active, if
* the library module was replaced. This information we get using the
* localtime function
*/
struct tm *tmp;
/* Conversion from VMS time to C time */
val = decc$fix_time (&mhd->mhd$l_datim);
/*
* Conversion from local time (stored in library) to GMT (needed for gmake)
* Note: The tm_gmtoff element is a VMS extension to the ANSI standard.
*/
tmp = localtime (&val);
val -= tmp->tm_gmtoff;
}
#endif
for (i = 0; i < module->dsc$w_length; i++)
@@ -134,7 +155,7 @@ VMS_get_member_info (struct dsc$descriptor_s *module, unsigned long *rfa)
Returns 0 if have scanned successfully. */
long int
ar_scan (char *archive, long int (*function) PARAMS ((void)), long int arg)
ar_scan (const char *archive, ar_member_func_t function, const void *arg)
{
char *p;
@@ -151,11 +172,12 @@ ar_scan (char *archive, long int (*function) PARAMS ((void)), long int arg)
if (! (status & 1))
{
error (NILF, _("lbr$ini_control failed with status = %d"),status);
error (NILF, _("lbr$ini_control() failed with status = %d"), status);
return -2;
}
libdesc.dsc$a_pointer = archive;
/* there is no such descriptor with "const char *dsc$a_pointer" */
libdesc.dsc$a_pointer = (char *)archive;
libdesc.dsc$w_length = strlen (archive);
status = lbr$open (&VMS_lib_idx, &libdesc, 0, 0, 0, 0, 0);
@@ -250,6 +272,7 @@ struct ar_hdr
char ar_fmag[2]; /* Always contains ARFMAG. */
};
# endif
# define TOCHAR(_m) (_m)
#else
/* These should allow us to read Windows (VC++) libraries (according to Frank
* Libbrecht <frankl@abzx.belgium.hp.com>)
@@ -266,6 +289,8 @@ struct ar_hdr
# define ar_date Date
# define ar_uid UserID
# define ar_gid GroupID
/* In Windows the member names have type BYTE so we must cast them. */
# define TOCHAR(_m) ((char *)(_m))
#endif
/* Cray's <ar.h> apparently defines this. */
@@ -301,7 +326,7 @@ struct ar_hdr
Returns 0 if have scanned successfully. */
long int
ar_scan (char *archive, long int (*function)(), long int arg)
ar_scan (const char *archive, ar_member_func_t function, const void *arg)
{
#ifdef AIAMAG
FL_HDR fl_header;
@@ -313,14 +338,14 @@ ar_scan (char *archive, long int (*function)(), long int arg)
int long_name = 0;
#endif
char *namemap = 0;
register int desc = open (archive, O_RDONLY, 0);
int desc = open (archive, O_RDONLY, 0);
if (desc < 0)
return -1;
#ifdef SARMAG
{
char buf[SARMAG];
register int nread = read (desc, buf, SARMAG);
if (nread != SARMAG || bcmp (buf, ARMAG, SARMAG))
if (nread != SARMAG || memcmp (buf, ARMAG, SARMAG))
{
(void) close (desc);
return -2;
@@ -329,7 +354,7 @@ ar_scan (char *archive, long int (*function)(), long int arg)
#else
#ifdef AIAMAG
{
register int nread = read (desc, (char *) &fl_header, FL_HSZ);
register int nread = read (desc, &fl_header, FL_HSZ);
if (nread != FL_HSZ)
{
@@ -339,7 +364,7 @@ ar_scan (char *archive, long int (*function)(), long int arg)
#ifdef AIAMAGBIG
/* If this is a "big" archive, then set the flag and
re-read the header into the "big" structure. */
if (!bcmp (fl_header.fl_magic, AIAMAGBIG, SAIAMAG))
if (!memcmp (fl_header.fl_magic, AIAMAGBIG, SAIAMAG))
{
big_archive = 1;
@@ -351,7 +376,7 @@ ar_scan (char *archive, long int (*function)(), long int arg)
}
/* re-read the header into the "big" structure */
nread = read (desc, (char *) &fl_header_big, FL_HSZ_BIG);
nread = read (desc, &fl_header_big, FL_HSZ_BIG);
if (nread != FL_HSZ_BIG)
{
(void) close (desc);
@@ -361,7 +386,7 @@ ar_scan (char *archive, long int (*function)(), long int arg)
else
#endif
/* Check to make sure this is a "normal" archive. */
if (bcmp (fl_header.fl_magic, AIAMAG, SAIAMAG))
if (memcmp (fl_header.fl_magic, AIAMAG, SAIAMAG))
{
(void) close (desc);
return -2;
@@ -455,7 +480,7 @@ ar_scan (char *archive, long int (*function)(), long int arg)
#ifdef AIAMAGBIG
if (big_archive)
{
nread = read (desc, (char *) &member_header_big,
nread = read (desc, &member_header_big,
AR_MEMHDR_SZ(member_header_big) );
if (nread != AR_MEMHDR_SZ(member_header_big))
@@ -487,7 +512,7 @@ ar_scan (char *archive, long int (*function)(), long int arg)
else
#endif
{
nread = read (desc, (char *) &member_header,
nread = read (desc, &member_header,
AR_MEMHDR_SZ(member_header) );
if (nread != AR_MEMHDR_SZ(member_header))
@@ -525,7 +550,7 @@ ar_scan (char *archive, long int (*function)(), long int arg)
eltmode, arg);
#else /* Not AIAMAG. */
nread = read (desc, (char *) &member_header, AR_HDR_SIZE);
nread = read (desc, &member_header, AR_HDR_SIZE);
if (nread == 0)
/* No data left means end of file; that is OK. */
break;
@@ -534,13 +559,13 @@ ar_scan (char *archive, long int (*function)(), long int arg)
#if defined(ARFMAG) || defined(ARFZMAG)
|| (
# ifdef ARFMAG
bcmp (member_header.ar_fmag, ARFMAG, 2)
memcmp (member_header.ar_fmag, ARFMAG, 2)
# else
1
# endif
&&
# ifdef ARFZMAG
bcmp (member_header.ar_fmag, ARFZMAG, 2)
memcmp (member_header.ar_fmag, ARFZMAG, 2)
# else
1
# endif
@@ -553,7 +578,7 @@ ar_scan (char *archive, long int (*function)(), long int arg)
}
name = namebuf;
bcopy (member_header.ar_name, name, sizeof member_header.ar_name);
memcpy (name, member_header.ar_name, sizeof member_header.ar_name);
{
register char *p = name + sizeof member_header.ar_name;
do
@@ -563,11 +588,11 @@ ar_scan (char *archive, long int (*function)(), long int arg)
#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, "//")
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. */
@@ -575,41 +600,41 @@ ar_scan (char *archive, long int (*function)(), long int arg)
*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)
/* 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);
else if (name[0] == '#'
&& name[1] == '1'
&& name[2] == '/')
{
int namesize = atoi (name + 3);
name = (char *) 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;
}
}
#endif /* Not AIAMAG. */
}
#ifndef M_XENIX
sscanf (member_header.ar_mode, "%o", &eltmode);
eltsize = atol (member_header.ar_size);
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;
@@ -619,9 +644,9 @@ ar_scan (char *archive, long int (*function)(), long int arg)
(*function) (desc, name, ! long_name, member_offset,
member_offset + AR_HDR_SIZE, eltsize,
#ifndef M_XENIX
atol (member_header.ar_date),
atoi (member_header.ar_uid),
atoi (member_header.ar_gid),
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,
@@ -644,7 +669,7 @@ ar_scan (char *archive, long int (*function)(), long int arg)
#ifdef AIAMAGBIG
if (big_archive)
sscanf (member_header_big.ar_nxtmem, "%20ld", &member_offset);
sscanf (member_header_big.ar_nxtmem, "%20ld", &member_offset);
else
#endif
sscanf (member_header.ar_nxtmem, "%12ld", &member_offset);
@@ -656,38 +681,38 @@ ar_scan (char *archive, long int (*function)(), long int arg)
}
#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 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;
{
char *clear;
char *limit;
namemap = (char *) 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;
}
}
member_offset += AR_HDR_SIZE + eltsize;
if (member_offset % 2 != 0)
@@ -706,9 +731,9 @@ ar_scan (char *archive, long int (*function)(), long int arg)
sizeof (struct ar_hdr.ar_name) - 1. */
int
ar_name_equal (char *name, char *mem, int truncated)
ar_name_equal (const char *name, const char *mem, int truncated)
{
char *p;
const char *p;
p = strrchr (name, '/');
if (p != 0)
@@ -737,10 +762,10 @@ ar_name_equal (char *name, char *mem, int truncated)
#ifndef VMS
/* ARGSUSED */
static long int
ar_member_pos (int desc UNUSED, char *mem, int truncated,
ar_member_pos (int desc UNUSED, const char *mem, int truncated,
long int hdrpos, long int datapos UNUSED, long int size UNUSED,
long int date UNUSED, int uid UNUSED, int gid UNUSED,
int mode UNUSED, char *name)
int mode UNUSED, const void *name)
{
if (!ar_name_equal (name, mem, truncated))
return 0;
@@ -755,9 +780,9 @@ ar_member_pos (int desc UNUSED, char *mem, int truncated,
1 if valid but member MEMNAME does not exist. */
int
ar_member_touch (char *arname, char *memname)
ar_member_touch (const char *arname, const char *memname)
{
long int pos = ar_scan (arname, ar_member_pos, (long int) memname);
long int pos = ar_scan (arname, ar_member_pos, memname);
int fd;
struct ar_hdr ar_hdr;
int i;
@@ -775,12 +800,12 @@ ar_member_touch (char *arname, char *memname)
/* Read in this member's header */
if (lseek (fd, pos, 0) < 0)
goto lose;
if (AR_HDR_SIZE != read (fd, (char *) &ar_hdr, AR_HDR_SIZE))
if (AR_HDR_SIZE != read (fd, &ar_hdr, AR_HDR_SIZE))
goto lose;
/* Write back the header, thus touching the archive file. */
if (lseek (fd, pos, 0) < 0)
goto lose;
if (AR_HDR_SIZE != write (fd, (char *) &ar_hdr, AR_HDR_SIZE))
if (AR_HDR_SIZE != write (fd, &ar_hdr, AR_HDR_SIZE))
goto lose;
/* The file's mtime is the time we we want. */
EINTRLOOP (i, fstat (fd, &statbuf));
@@ -790,7 +815,7 @@ ar_member_touch (char *arname, char *memname)
/* Advance member's time to that time */
for (ui = 0; ui < sizeof ar_hdr.ar_date; ui++)
ar_hdr.ar_date[ui] = ' ';
sprintf (ar_hdr.ar_date, "%ld", (long int) statbuf.st_mtime);
sprintf (TOCHAR (ar_hdr.ar_date), "%ld", (long int) statbuf.st_mtime);
#ifdef AIAMAG
ar_hdr.ar_date[strlen(ar_hdr.ar_date)] = ' ';
#endif
@@ -800,7 +825,7 @@ ar_member_touch (char *arname, char *memname)
/* Write back this member's header */
if (lseek (fd, pos, 0) < 0)
goto lose;
if (AR_HDR_SIZE != write (fd, (char *) &ar_hdr, AR_HDR_SIZE))
if (AR_HDR_SIZE != write (fd, &ar_hdr, AR_HDR_SIZE))
goto lose;
close (fd);
return 0;
@@ -816,9 +841,9 @@ ar_member_touch (char *arname, char *memname)
#ifdef TEST
long int
describe_member (int desc, char *name, int truncated,
describe_member (int desc, const char *name, int truncated,
long int hdrpos, long int datapos, long int size,
long int date, int uid, int gid, int mode)
long int date, int uid, int gid, int mode, const void *arg)
{
extern char *ctime ();
@@ -834,7 +859,7 @@ describe_member (int desc, char *name, int truncated,
int
main (int argc, char **argv)
{
ar_scan (argv[1], describe_member);
ar_scan (argv[1], describe_member, NULL);
return 0;
}

View File

@@ -3,20 +3,21 @@
# @configure_input@
# Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# 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 2, or (at your option) any later version.
# 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.
# 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
# GNU Make; see the file COPYING. If not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
# this program. If not, see <http://www.gnu.org/licenses/>.
# See Makefile.in for comments describing these variables.

View File

@@ -1,20 +1,26 @@
@echo off
rem Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
rem 2006 Free Software Foundation, Inc.
rem 2006, 2007, 2008, 2009, 2010 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
rem the terms of the GNU General Public License as published by the Free
rem Software Foundation; either version 3 of the License, or (at your option)
rem any later version.
rem
rem GNU Make is distributed in the hope that it will be useful, but WITHOUT
rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
rem more details.
rem
rem You should have received a copy of the GNU General Public License along
rem with this program. If not, see <http://www.gnu.org/licenses/>.
rem GNU Make is free software; you can redistribute it and/or modify it under the
rem terms of the GNU General Public License as published by the Free Software
rem Foundation; either version 2, or (at your option) any later version.
rem GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
rem WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
rem A PARTICULAR PURPOSE. See the GNU General Public License for more details.
rem You should have received a copy of the GNU General Public License along with
rem GNU Make; see the file COPYING. If not, write to the Free Software
rem Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
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
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
cd w32\subproc
echo "Creating the subproc library"
@@ -88,9 +94,9 @@ cl.exe /nologo /MT /W4 /GX /Zi /YX /Od /I . /I glob /I w32/include /D _DEBUG /D
echo WinDebug\pathstuff.obj >>link.dbg
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 /MACHINE:I386 /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
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
link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:yes /PDB:.\WinDebug/%make%.pdb /DEBUG /MACHINE:I386 /OUT:.\WinDebug/%make%.exe @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!"
if not exist .\WinRel\nul mkdir .\WinRel
@@ -155,43 +161,43 @@ cl.exe /nologo /MT /W4 /GX /YX /O2 /I . /I glob /I w32/include /D NDEBUG /D WIND
echo WinRel\pathstuff.obj >>link.rel
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 /MACHINE:I386 /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
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
link.exe /NOLOGO /SUBSYSTEM:console /INCREMENTAL:no /PDB:.\WinRel/%make%.pdb /MACHINE:I386 /OUT:.\WinRel/%make%.exe @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!"
set make=
GoTo BuildEnd
:GCCBuild
echo on
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c variable.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c rule.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c remote-stub.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c commands.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c file.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c getloadavg.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c default.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c signame.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c expand.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c dir.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c main.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c getopt1.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c job.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c read.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c version.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c getopt.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c arscan.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c remake.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c hash.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c strcache.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c misc.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ar.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c function.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c vpath.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c implicit.c
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./glob/glob.c -o glob.o
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./glob/fnmatch.c -o fnmatch.o
gcc -mthreads -Wall -gstabs+ -ggdb3 -O2 -I. -I./glob -I./w32/include -DWINDOWS32 -DHAVE_CONFIG_H -c ./w32/pathstuff.c -o pathstuff.o
gcc -mthreads -gstabs+ -ggdb3 -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
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
echo on

View File

@@ -1,20 +1,20 @@
/* 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 Free Software
Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
#include "make.h"
#include "dep.h"
@@ -33,19 +33,42 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
# define FILE_LIST_SEPARATOR ' '
#endif
extern int remote_kill PARAMS ((int id, int sig));
int remote_kill (int id, int sig);
#ifndef HAVE_UNISTD_H
extern int getpid ();
int getpid ();
#endif
static unsigned long
dep_hash_1 (const void *key)
{
const struct dep *d = key;
return_STRING_HASH_1 (dep_name (d));
}
static unsigned long
dep_hash_2 (const void *key)
{
const struct dep *d = key;
return_STRING_HASH_2 (dep_name (d));
}
static int
dep_hash_cmp (const void *x, const void *y)
{
const struct dep *dx = x;
const struct dep *dy = y;
return strcmp (dep_name (dx), dep_name (dy));
}
/* Set FILE's automatic variables up. */
void
set_file_variables (struct file *file)
{
struct dep *d;
char *at, *percent, *star, *less;
const char *at, *percent, *star, *less;
#ifndef NO_ARCHIVES
/* If the target is an archive member `lib(member)',
@@ -54,16 +77,19 @@ set_file_variables (struct file *file)
if (ar_name (file->name))
{
unsigned int len;
const char *cp;
char *p;
p = strchr (file->name, '(');
at = (char *) alloca (p - file->name + 1);
bcopy (file->name, at, p - file->name);
at[p - file->name] = '\0';
len = strlen (p + 1);
percent = (char *) alloca (len);
bcopy (p + 1, percent, len - 1);
percent[len - 1] = '\0';
cp = strchr (file->name, '(');
p = alloca (cp - file->name + 1);
memcpy (p, file->name, cp - file->name);
p[cp - file->name] = '\0';
at = p;
len = strlen (cp + 1);
p = alloca (len);
memcpy (p, cp + 1, len - 1);
p[len - 1] = '\0';
percent = p;
}
else
#endif /* NO_ARCHIVES. */
@@ -78,8 +104,7 @@ set_file_variables (struct file *file)
/* In Unix make, $* is set to the target name with
any suffix in the .SUFFIXES list stripped off for
explicit rules. We store this in the `stem' member. */
register struct dep *d;
char *name;
const char *name;
unsigned int len;
#ifndef NO_ARCHIVES
@@ -95,12 +120,12 @@ set_file_variables (struct file *file)
len = strlen (name);
}
for (d = enter_file (".SUFFIXES")->deps; d != 0; d = d->next)
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 = savestring (name, len - slen);
file->stem = strcache_add_len (name, len - slen);
break;
}
}
@@ -114,7 +139,8 @@ set_file_variables (struct file *file)
for (d = file->deps; d != 0; d = d->next)
if (!d->ignore_mtime)
{
less = dep_name (d);
if (!d->need_2nd_expansion)
less = dep_name (d);
break;
}
@@ -137,7 +163,7 @@ set_file_variables (struct file *file)
{
static char *plus_value=0, *bar_value=0, *qmark_value=0;
static unsigned int qmark_max=0, plus_max=0, bar_max=0;
static unsigned int plus_max=0, bar_max=0, qmark_max=0;
unsigned int qmark_len, plus_len, bar_len;
char *cp;
@@ -146,25 +172,41 @@ set_file_variables (struct file *file)
char *bp;
unsigned int len;
struct hash_table dep_hash;
void **slot;
/* Compute first the value for $+, which is supposed to contain
duplicate dependencies as they were listed in the makefile. */
plus_len = 0;
bar_len = 0;
for (d = file->deps; d != 0; d = d->next)
if (! d->ignore_mtime)
plus_len += strlen (dep_name (d)) + 1;
{
if (!d->need_2nd_expansion)
{
if (d->ignore_mtime)
bar_len += strlen (dep_name (d)) + 1;
else
plus_len += strlen (dep_name (d)) + 1;
}
}
if (bar_len == 0)
bar_len++;
if (plus_len == 0)
plus_len++;
if (plus_len > plus_max)
plus_value = xrealloc (plus_value, plus_max = plus_len);
cp = plus_value;
qmark_len = plus_len + 1; /* Will be this or less. */
for (d = file->deps; d != 0; d = d->next)
if (! d->ignore_mtime)
if (! d->ignore_mtime && ! d->need_2nd_expansion)
{
char *c = dep_name (d);
const char *c = dep_name (d);
#ifndef NO_ARCHIVES
if (ar_name (c))
@@ -176,10 +218,10 @@ set_file_variables (struct file *file)
#endif
len = strlen (c);
bcopy (c, cp, len);
memcpy (cp, c, len);
cp += len;
*cp++ = FILE_LIST_SEPARATOR;
if (! d->changed)
if (! (d->changed || always_make_flag))
qmark_len -= len + 1; /* Don't space in $? for this one. */
}
@@ -188,19 +230,6 @@ set_file_variables (struct file *file)
cp[cp > plus_value ? -1 : 0] = '\0';
DEFINE_VARIABLE ("+", 1, plus_value);
/* Make sure that no dependencies are repeated. This does not
really matter for the purpose of updating targets, but it
might make some names be listed twice for $^ and $?. */
uniquize_deps (file->deps);
bar_len = 0;
for (d = file->deps; d != 0; d = d->next)
if (d->ignore_mtime)
bar_len += strlen (dep_name (d)) + 1;
if (bar_len == 0)
bar_len++;
/* Compute the values for $^, $?, and $|. */
cp = caret_value = plus_value; /* Reuse the buffer; it's big enough. */
@@ -213,12 +242,43 @@ set_file_variables (struct file *file)
bar_value = xrealloc (bar_value, bar_max = bar_len);
bp = bar_value;
/* Make sure that no dependencies are repeated in $^, $?, and $|. It
would be natural to combine the next two loops but we can't do it
because of a situation where we have two dep entries, the first
is order-only and the second is normal (see below). */
hash_init (&dep_hash, 500, dep_hash_1, dep_hash_2, dep_hash_cmp);
for (d = file->deps; d != 0; d = d->next)
{
char *c = dep_name (d);
if (d->need_2nd_expansion)
continue;
slot = hash_find_slot (&dep_hash, d);
if (HASH_VACANT (*slot))
hash_insert_at (&dep_hash, d, slot);
else
{
/* Check if the two prerequisites have different ignore_mtime.
If so then we need to "upgrade" one that is order-only. */
struct dep* hd = (struct dep*) *slot;
if (d->ignore_mtime != hd->ignore_mtime)
d->ignore_mtime = hd->ignore_mtime = 0;
}
}
for (d = file->deps; d != 0; d = d->next)
{
const char *c;
if (d->need_2nd_expansion || hash_find_item (&dep_hash, d) != d)
continue;
c = dep_name (d);
#ifndef NO_ARCHIVES
if (ar_name (c))
if (ar_name (c))
{
c = strchr (c, '(') + 1;
len = strlen (c) - 1;
@@ -229,24 +289,26 @@ set_file_variables (struct file *file)
if (d->ignore_mtime)
{
bcopy (c, bp, len);
memcpy (bp, c, len);
bp += len;
*bp++ = FILE_LIST_SEPARATOR;
}
else
{
bcopy (c, cp, len);
{
memcpy (cp, c, len);
cp += len;
*cp++ = FILE_LIST_SEPARATOR;
if (d->changed)
if (d->changed || always_make_flag)
{
bcopy (c, qp, len);
memcpy (qp, c, len);
qp += len;
*qp++ = FILE_LIST_SEPARATOR;
}
}
}
hash_free (&dep_hash, 0);
/* Kill the last spaces and define the variables. */
cp[cp > caret_value ? -1 : 0] = '\0';
@@ -268,7 +330,6 @@ set_file_variables (struct file *file)
void
chop_commands (struct commands *cmds)
{
register char *p;
unsigned int nlines, idx;
char **lines;
@@ -278,66 +339,82 @@ chop_commands (struct commands *cmds)
if (!cmds || cmds->command_lines != 0)
return;
/* Chop CMDS->commands up into lines in CMDS->command_lines.
Also set the corresponding CMDS->lines_flags elements,
and the CMDS->any_recurse flag. */
/* Chop CMDS->commands up into lines in CMDS->command_lines. */
nlines = 5;
lines = (char **) xmalloc (5 * sizeof (char *));
idx = 0;
p = cmds->commands;
while (*p != '\0')
if (one_shell)
{
char *end = p;
find_end:;
end = strchr (end, '\n');
if (end == 0)
end = p + strlen (p);
else if (end > p && end[-1] == '\\')
int l = strlen (cmds->commands);
nlines = 1;
lines = xmalloc (nlines * sizeof (char *));
lines[0] = xstrdup (cmds->commands);
/* Strip the trailing newline. */
if (l > 0 && lines[0][l-1] == '\n')
lines[0][l-1] = '\0';
}
else
{
const char *p;
nlines = 5;
lines = xmalloc (nlines * sizeof (char *));
idx = 0;
p = cmds->commands;
while (*p != '\0')
{
int backslash = 1;
register char *b;
for (b = end - 2; b >= p && *b == '\\'; --b)
backslash = !backslash;
if (backslash)
const char *end = p;
find_end:;
end = strchr (end, '\n');
if (end == 0)
end = p + strlen (p);
else if (end > p && end[-1] == '\\')
{
++end;
goto find_end;
int backslash = 1;
const char *b;
for (b = end - 2; b >= p && *b == '\\'; --b)
backslash = !backslash;
if (backslash)
{
++end;
goto find_end;
}
}
if (idx == nlines)
{
nlines += 2;
lines = xrealloc (lines, nlines * sizeof (char *));
}
lines[idx++] = xstrndup (p, end - p);
p = end;
if (*p != '\0')
++p;
}
if (idx == nlines)
if (idx != nlines)
{
nlines += 2;
lines = (char **) xrealloc ((char *) lines,
nlines * sizeof (char *));
nlines = idx;
lines = xrealloc (lines, nlines * sizeof (char *));
}
lines[idx++] = savestring (p, end - p);
p = end;
if (*p != '\0')
++p;
}
if (idx != nlines)
{
nlines = idx;
lines = (char **) xrealloc ((char *) lines,
nlines * sizeof (char *));
}
/* Finally, set the corresponding CMDS->lines_flags elements and the
CMDS->any_recurse flag. */
cmds->ncommand_lines = nlines;
cmds->command_lines = lines;
cmds->any_recurse = 0;
cmds->lines_flags = (char *) xmalloc (nlines);
cmds->lines_flags = xmalloc (nlines);
for (idx = 0; idx < nlines; ++idx)
{
int flags = 0;
const char *p = lines[idx];
for (p = lines[idx];
isblank ((unsigned char)*p) || *p == '-' || *p == '@' || *p == '+';
++p)
switch (*p)
while (isblank (*p) || *p == '-' || *p == '@' || *p == '+')
switch (*(p++))
{
case '+':
flags |= COMMANDS_RECURSE;
@@ -367,7 +444,7 @@ chop_commands (struct commands *cmds)
void
execute_file_commands (struct file *file)
{
register char *p;
const char *p;
/* Don't go through all the preparations if
the commands are nothing but whitespace. */
@@ -455,7 +532,7 @@ fatal_error_signal (int sig)
if (sig == SIGTERM)
{
register struct child *c;
struct child *c;
for (c = children; c != 0; c = c->next)
if (!c->remote)
(void) kill (c->pid, SIGTERM);
@@ -473,7 +550,7 @@ fatal_error_signal (int sig)
#endif
)
{
register struct child *c;
struct child *c;
/* Remote children won't automatically get signals sent
to the process group, so we must send them. */
@@ -525,7 +602,7 @@ fatal_error_signal (int sig)
and it has changed on disk since we last stat'd it. */
static void
delete_target (struct file *file, char *on_behalf_of)
delete_target (struct file *file, const char *on_behalf_of)
{
struct stat st;
int e;
@@ -580,7 +657,7 @@ delete_child_targets (struct child *child)
return;
/* Delete the target file if it changed. */
delete_target (child->file, (char *) 0);
delete_target (child->file, NULL);
/* Also remove any non-precious targets listed in the `also_make' member. */
for (d = child->file->also_make; d != 0; d = d->next)
@@ -592,11 +669,11 @@ delete_child_targets (struct child *child)
/* Print out the commands in CMDS. */
void
print_commands (struct commands *cmds)
print_commands (const struct commands *cmds)
{
register char *s;
const char *s;
fputs (_("# commands to execute"), stdout);
fputs (_("# recipe to execute"), stdout);
if (cmds->fileinfo.filenm == 0)
puts (_(" (built-in):"));
@@ -607,17 +684,14 @@ print_commands (struct commands *cmds)
s = cmds->commands;
while (*s != '\0')
{
char *end;
while (isspace ((unsigned char)*s))
++s;
const char *end;
end = strchr (s, '\n');
if (end == 0)
end = s + strlen (s);
printf ("\t%.*s\n", (int) (end - s), s);
printf ("%c%.*s\n", cmd_prefix, (int) (end - s), s);
s = end;
s = end + (end[0] == '\n');
}
}

View File

@@ -1,20 +1,20 @@
/* 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 Free Software
Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
/* Structure that gives the commands to make a file
and information about where these commands came from. */
@@ -35,8 +35,8 @@ struct commands
#define COMMANDS_SILENT 2 /* Silent: @. */
#define COMMANDS_NOERROR 4 /* No errors: -. */
extern void execute_file_commands PARAMS ((struct file *file));
extern void print_commands PARAMS ((struct commands *cmds));
extern void delete_child_targets PARAMS ((struct child *child));
extern void chop_commands PARAMS ((struct commands *cmds));
extern void set_file_variables PARAMS ((struct file *file));
void execute_file_commands (struct file *file);
void print_commands (const struct commands *cmds);
void delete_child_targets (struct child *child);
void chop_commands (struct commands *cmds);
void set_file_variables (struct file *file);

View File

@@ -1,19 +1,19 @@
/* config.h -- hand-massaged for Amiga -*-C-*-
Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
2005, 2006 Free Software Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
/* Define if on AIX 3.
System headers sometimes define this.
@@ -262,9 +262,15 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
/* Define if you have the socket function. */
/* #undef HAVE_SOCKET */
/* Define if you have the strcasecmp function. */
/* Define to 1 if you have the strcasecmp function. */
/* #undef HAVE_STRCASECMP */
/* Define to 1 if you have the strcmpi function. */
/* #undef HAVE_STRCMPI */
/* Define to 1 if you have the stricmp function. */
/* #undef HAVE_STRICMP */
/* Define if you have the strerror function. */
#define HAVE_STRERROR 1

View File

@@ -1,25 +1,25 @@
/* 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 Free Software Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
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. */
/* Define if on AIX 3.
/* Define to 1 if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE
@@ -35,7 +35,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
/* Define as 1 if you have gettext and don't want to use GNU gettext. */
/* #undef HAVE_GETTEXT */
/* Define if your locale.h file contains LC_MESSAGES. */
/* Define to 1 if your locale.h file contains LC_MESSAGES. */
/* #undef HAVE_LC_MESSAGES */
/* Define to the installation directory for locales. */
@@ -44,7 +44,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
/* Define as 1 if you have the stpcpy function. */
/* #undef HAVE_STPCPY */
/* Define 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 empty if the keyword does not work. */
@@ -57,7 +57,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
/* Define for DGUX with <sys/dg_sys_info.h>. */
/* #undef DGUX */
/* Define 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'
@@ -67,89 +67,92 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef gid_t */
/* Define 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 if you have <alloca.h> and it should be used (not on Ultrix). */
/* Define to 1 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. */
/* Define to 1 if you don't have vprintf but do have _doprnt. */
/* #undef HAVE_DOPRNT */
/* Define if your system has a working fnmatch function. */
/* 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 if your system has its own `getloadavg' function. */
/* Define to 1 if your system has its own `getloadavg' function. */
/* #undef HAVE_GETLOADAVG */
/* Define if you have the getmntent function. */
/* Define to 1 if you have the getmntent function. */
/* #undef HAVE_GETMNTENT */
/* Define if the `long double' type works. */
/* Define to 1 if the `long double' type works. */
/* #undef HAVE_LONG_DOUBLE */
/* Define if you support file names longer than 14 characters. */
/* Define to 1 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 to 1 if you have a working `mmap' system call. */
/* #undef HAVE_MMAP */
/* Define if system calls automatically restart after interruption
/* Define to 1 if system calls automatically restart after interruption
by a signal. */
/* #undef HAVE_RESTARTABLE_SYSCALLS */
/* Define if your struct stat has st_blksize. */
/* Define to 1 if your struct stat has st_blksize. */
/* #undef HAVE_ST_BLKSIZE */
/* Define if your struct stat has st_blocks. */
/* Define to 1 if your struct stat has st_blocks. */
/* #undef HAVE_ST_BLOCKS */
/* Define 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. */
/* #undef HAVE_STRCOLL */
/* Define if your struct stat has st_rdev. */
/* Define to 1 if your struct stat has st_rdev. */
/* #undef HAVE_ST_RDEV */
/* Define if you have the strftime function. */
/* Define to 1 if you have the strftime function. */
/* #undef HAVE_STRFTIME */
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
/* #undef HAVE_SYS_WAIT_H */
/* Define if your struct tm has tm_zone. */
/* Define to 1 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
/* Define to 1 if you don't have tm_zone but do have the external array
tzname. */
/* #undef HAVE_TZNAME */
/* Define if you have <unistd.h>. */
/* Define to 1 if you have <unistd.h>. */
#ifdef __DECC
#define HAVE_UNISTD_H 1
#endif
/* Define if utime(file, NULL) sets file's timestamp to the present. */
/* Define to 1 if utime(file, NULL) sets file's timestamp to the present. */
/* #undef HAVE_UTIME_NULL */
/* Define if you have <vfork.h>. */
/* Define to 1 if you have <vfork.h>. */
/* #undef HAVE_VFORK_H */
/* Define if you have the vprintf function. */
/* Define to 1 if you have the vprintf function. */
#define HAVE_VPRINTF 1
/* Define if you have the wait3 system call. */
/* Define to 1 if you have the wait3 system call. */
/* #undef HAVE_WAIT3 */
/* Define if on MINIX. */
/* Define to 1 if on MINIX. */
/* #undef _MINIX */
/* Define if your struct nlist has an n_un member. */
/* Define to 1 if your struct nlist has an n_un member. */
/* #undef NLIST_NAME_UNION */
/* Define if you have <nlist.h>. */
/* Define to 1 if you have <nlist.h>. */
/* #undef NLIST_STRUCT */
/* Define if your C compiler doesn't accept -c and -o together. */
/* 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. */
@@ -158,17 +161,17 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
#define pid_t int
#endif
/* Define if the system does not provide POSIX.1 features except
/* Define to 1 if the system does not provide POSIX.1 features except
with this defined. */
/* #undef _POSIX_1_SOURCE */
/* Define if you need to in order for stat and other things to work. */
/* Define to 1 if you need to in order for stat and other things to work. */
/* #undef _POSIX_SOURCE */
/* Define as the return type of signal handlers (int or void). */
#define RETSIGTYPE void
/* Define if the setvbuf function takes the buffering type as its second
/* 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 */
@@ -182,16 +185,16 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
*/
/* #undef STACK_DIRECTION */
/* Define 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 if you have the ANSI C header files. */
/* Define to 1 if you have the ANSI C header files. */
/* #undef STDC_HEADERS */
/* Define on System V Release 4. */
/* #undef SVR4 */
/* Define 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. */
@@ -228,137 +231,143 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
if it exists. */
/* #undef ST_MTIM_NSEC */
/* Define this 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 this 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 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 if you have the dup2 function. */
/* Define to 1 if you have the dup2 function. */
#define HAVE_DUP2 1
/* Define if you have the getcwd function. */
/* Define to 1 if you have the getcwd function. */
#define HAVE_GETCWD 1
/* Define if you have the getgroups function. */
/* Define to 1 if you have the getgroups function. */
/* #undef HAVE_GETGROUPS */
/* Define if you have the gethostbyname function. */
/* Define to 1 if you have the gethostbyname function. */
/* #undef HAVE_GETHOSTBYNAME */
/* Define if you have the gethostname function. */
/* Define to 1 if you have the gethostname function. */
/* #undef HAVE_GETHOSTNAME */
/* Define if you have the getloadavg function. */
/* Define to 1 if you have the getloadavg function. */
/* #undef HAVE_GETLOADAVG */
/* Define if you have the memmove function. */
/* Define to 1 if you have the memmove function. */
#define HAVE_MEMMOVE 1
/* Define if you have the mktemp function. */
/* Define to 1 if you have the mktemp function. */
#define HAVE_MKTEMP 1
/* Define if you have the psignal function. */
/* Define to 1 if you have the psignal function. */
/* #undef HAVE_PSIGNAL */
/* Define if you have the pstat_getdynamic function. */
/* Define to 1 if you have the pstat_getdynamic function. */
/* #undef HAVE_PSTAT_GETDYNAMIC */
/* Define if you have the setegid function. */
/* Define to 1 if you have the setegid function. */
/* #undef HAVE_SETEGID */
/* Define if you have the seteuid function. */
/* Define to 1 if you have the seteuid function. */
/* #undef HAVE_SETEUID */
/* Define if you have the setlinebuf function. */
/* Define to 1 if you have the setlinebuf function. */
/* #undef HAVE_SETLINEBUF */
/* Define if you have the setregid function. */
/* Define to 1 if you have the setregid function. */
/* #undefine HAVE_SETREGID */
/* Define if you have the setreuid function. */
/* Define to 1 if you have the setreuid function. */
/* #define HAVE_SETREUID */
/* Define if you have the sigsetmask function. */
/* Define to 1 if you have the sigsetmask function. */
#define HAVE_SIGSETMASK 1
/* Define if you have the socket function. */
/* Define to 1 if you have the socket function. */
/* #undef HAVE_SOCKET */
/* Define if you have the strcasecmp function. */
/* #undef HAVE_STRCASECMP */
/* Define to 1 if you have the strcasecmp function. */
#define HAVE_STRCASECMP 1
/* Define if you have the strerror function. */
/* Define to 1 if you have the strcmpi function. */
/* #undef HAVE_STRCMPI */
/* Define to 1 if you have the stricmp function. */
/* #undef HAVE_STRICMP */
/* Define to 1 if you have the strerror function. */
#define HAVE_STRERROR 1
/* Define if you have the strsignal function. */
/* Define to 1 if you have the strsignal function. */
/* #undef HAVE_STRSIGNAL */
/* Define if you have the wait3 function. */
/* Define to 1 if you have the wait3 function. */
/* #undef HAVE_WAIT3 */
/* Define if you have the waitpid function. */
/* Define to 1 if you have the waitpid function. */
/* #undef HAVE_WAITPID */
/* Define if you have the <dirent.h> header file. */
/* Define to 1 if you have the <dirent.h> header file. */
#define HAVE_DIRENT_H 1
/* Define if you have the <fcntl.h> header file. */
/* Define to 1 if you have the <fcntl.h> header file. */
#ifdef __DECC
#define HAVE_FCNTL_H 1
#endif
/* Define if you have the <limits.h> header file. */
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define if you have the <mach/mach.h> header file. */
/* Define to 1 if you have the <mach/mach.h> header file. */
/* #undef HAVE_MACH_MACH_H */
/* Define if you have the <memory.h> header file. */
/* Define to 1 if you have the <memory.h> header file. */
/* #undef HAVE_MEMORY_H */
/* Define if you have the <ndir.h> header file. */
/* Define to 1 if you have the <ndir.h> header file. */
/* #undef HAVE_NDIR_H */
/* Define if your compiler conforms to the ANSI C standard. */
/* Define to 1 if your compiler conforms to the ANSI C standard. */
#define HAVE_ANSI_COMPILER 1
/* Define to 1 if you have the <stdarg.h> header file. */
#define HAVE_STDARG_H 1
/* Define if you have the <stdlib.h> header file. */
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define if you have the <string.h> header file. */
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define if you have the <sys/dir.h> header file. */
/* Define to 1 if you have the <sys/dir.h> header file. */
/* #undef HAVE_SYS_DIR_H */
/* Define if you have the <sys/ndir.h> header file. */
/* Define to 1 if you have the <sys/ndir.h> header file. */
/* #undef HAVE_SYS_NDIR_H */
/* Define if you have the <sys/param.h> header file. */
/* Define to 1 if you have the <sys/param.h> header file. */
/* #undef HAVE_SYS_PARAM_H */
/* Define if you have the <sys/timeb.h> header file. */
/* Define to 1 if you have the <sys/timeb.h> header file. */
#ifndef __GNUC__
#define HAVE_SYS_TIMEB_H 1
#endif
/* Define if you have the <sys/wait.h> header file. */
/* Define to 1 if you have the <sys/wait.h> header file. */
/* #undef HAVE_SYS_WAIT_H */
/* Define if you have the dgc library (-ldgc). */
/* Define to 1 if you have the dgc library (-ldgc). */
/* #undef HAVE_LIBDGC */
/* Define if you have the kstat library (-lkstat). */
/* Define to 1 if you have the kstat library (-lkstat). */
/* #undef HAVE_LIBKSTAT *
/* Define if you have the sun library (-lsun). */
/* Define to 1 if you have the sun library (-lsun). */
/* #undef HAVE_LIBSUN */
/* Use high resolution file timestamps if nonzero. */
@@ -409,14 +418,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
#define glob gnu_glob
#endif
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
#undef PARAMS
#define PARAMS(protos) protos
#else /* Not C++ or ANSI C. */
#undef PARAMS
#define PARAMS(protos) ()
#endif /* C++ or ANSI C. */
/* Define if using alloca.c. */
/* #undef C_ALLOCA */
/* maybe this should be placed into make.h */

View File

@@ -1,20 +1,20 @@
/* 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 Free Software Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
/* Suppress some Visual C++ warnings.
Maybe after the code cleanup for ISO C we can remove some/all of these. */
@@ -24,6 +24,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
# pragma warning(disable:4127) /* conditional expression is constant */
# pragma warning(disable:4131) /* uses old-style declarator */
# pragma warning(disable:4702) /* unreachable code */
# define _CRT_SECURE_NO_WARNINGS /* function or variable may be unsafe */
# define _CRT_NONSTDC_NO_WARNINGS /* functions w/o a leading underscore */
#endif
/* Define to 1 if the `closedir' function returns void instead of `int'. */
@@ -81,6 +83,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
*/
#define HAVE_DIRENT_H 1
/* Define to 1 if you have the <direct.h> header file, and it defines getcwd()
and chdir().
*/
#if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(__INTERIX)
# define HAVE_DIRECT_H 1
#endif
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
/* #undef HAVE_DOPRNT */
@@ -219,6 +228,21 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
/* Define to 1 if you have the `strcasecmp' function. */
/* #undef HAVE_STRCASECMP */
/* Define to 1 if you have the `strcmpi' function. */
/* #undef HAVE_STRCMPI */
/* 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
@@ -405,11 +429,20 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
/* 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 gid_t int
/* Define to `int' if <sys/types.h> does not define. */
/* GCC 4.x reportedly defines pid_t. */
#ifndef _PID_T_
#ifdef _WIN64
#define pid_t __int64
#else
#define pid_t int
#endif
#endif
/* Define to `int' if <sys/types.h> doesn't define. */
#define uid_t int

View File

@@ -3,5 +3,9 @@ config.*
mkinstalldirs
texinfo.tex
mdate-sh
compile
depcomp
install-sh
missing
Makefile Makefile.in

View File

@@ -28,17 +28,18 @@
* Makefile.am: New file.
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 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
terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
this program. If not, see <http://www.gnu.org/licenses/>.

View File

@@ -1,18 +1,20 @@
# -*-Makefile-*-, or close enough
# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# Copyright (C) 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 2, or (at your option) any later version.
# 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.
# 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
# GNU Make; see the file COPYING. If not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
# 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 \

View File

@@ -1,28 +1,29 @@
# 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 Free Software Foundation, Inc.
# 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 2, or (at your option) any later version.
# 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.
# 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
# GNU Make; see the file COPYING. If not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
# 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([
#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ && !defined __EMX__ && !defined __MSYS__
#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ && !defined __EMX__ && !defined __MSYS__ && !defined __CYGWIN__
neither MSDOS nor Windows nor OS2
#endif
],

View File

@@ -1,31 +1,35 @@
/* 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 Free Software Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
/* Include this header to make __DJGPP_MINOR__ available because DJGPP ports
of GCC 4.3.0 and later no longer do it automatically. */
#include <sys/version.h>
/* Many things are defined already by a system header. */
#include <sys/config.h>
#if __DJGPP__ > 2 || __DJGPP_MINOR__ > 1
/* Define if `sys_siglist' is declared by <signal.h>. */
/* Define to 1 if `sys_siglist' is declared by <signal.h> or <unistd.h>. */
# define SYS_SIGLIST_DECLARED 1
/* Define this if the C library defines the variable `_sys_siglist'. */
# define HAVE_SYS_SIGLIST 1
/* Define to 1 if the C library defines the variable `_sys_siglist'. */
# define HAVE_DECL_SYS_SIGLIST 1
#else
@@ -40,16 +44,16 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
/* Define to 1 if you have `alloca', as a function or macro. */
#define HAVE_ALLOCA 1
/* Define if you have the fdopen function. */
/* Define to 1 if you have the fdopen function. */
#define HAVE_FDOPEN 1
/* Define to 1 if you have the `getgroups' function. */
#define HAVE_GETGROUPS 1
/* Define if you have the <memory.h> header file. */
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define if you have the mkstemp function. */
/* Define to 1 if you have the mkstemp function. */
#define HAVE_MKSTEMP 1
/* Define to 1 if you have the `mktemp' function. */
@@ -70,19 +74,22 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
/* Define the type of the first arg to select(). */
#define fd_set_size_t int
/* Define if you have the select function. */
/* Define to 1 if you have the select function. */
#define HAVE_SELECT 1
/* Define if your compiler conforms to the ANSI C standard. */
/* Define to 1 if your compiler conforms to the ANSI C standard. */
#define HAVE_ANSI_COMPILER 1
/* Define to 1 if you have the <stdarg.h> header file. */
#define HAVE_STDARG_H 1
/* Define if you have the vprintf library function. */
/* 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
/* Name of the package */
#define PACKAGE "%PACKAGE%"
@@ -104,9 +111,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
/* Define to 1 if the C compiler supports function prototypes. */
#define PROTOTYPES 1
/* Define to 1 if `sys_siglist' is declared by <signal.h> or <unistd.h>. */
#define SYS_SIGLIST_DECLARED 1
/* Version number of package */
#define VERSION "%VERSION%"

View File

@@ -1,21 +1,20 @@
@echo off
rem Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
rem 2004, 2005, 2006 Free Software Foundation, Inc.
rem 2004, 2005, 2006, 2007, 2008, 2009, 2010 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
rem the terms of the GNU General Public License as published by the Free
rem Software Foundation; either version 2, or (at your option) any later
rem version.
rem Software Foundation; either version 3 of the License, or (at your option)
rem any later version.
rem
rem GNU Make is distributed in the hope that it will be useful, but WITHOUT
rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
rem more details.
rem
rem You should have received a copy of the GNU General Public License along
rem with GNU Make; see the file COPYING. If not, write to the Free Software
rem Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
rem with this program. If not, see <http://www.gnu.org/licenses/>.
echo Configuring MAKE for DJGPP

View File

@@ -1,22 +1,23 @@
# 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 Free Software Foundation, Inc.
# 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 2, or (at your option) any later version.
# 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.
# 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
# GNU Make; see the file COPYING. If not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
# this program. If not, see <http://www.gnu.org/licenses/>.
AC_INIT([GNU make],[3.81],[bug-make@gnu.org])
AC_INIT([GNU make],[3.82],[bug-make@gnu.org])
AC_PREREQ(2.59)
AC_REVISION([[$Id$]])
@@ -44,9 +45,6 @@ AC_AIX
AC_ISC_POSIX
AC_MINIX
# Needed for ansi2knr
AM_C_PROTOTYPES
# Enable gettext, in "external" mode.
AM_GNU_GETTEXT_VERSION(0.14.1)
@@ -71,7 +69,7 @@ AC_CHECK_HEADERS(stdlib.h locale.h unistd.h limits.h fcntl.h string.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 if your compiler conforms to the ANSI C standard.])
[Define to 1 if your compiler conforms to the ANSI C standard.])
fi
@@ -122,7 +120,7 @@ if test "$make_cv_file_timestamp_hi_res" = yes; then
AC_SEARCH_LIBS(clock_gettime, [rt posix4])
if test "$ac_cv_search_clock_gettime" != no; then
AC_DEFINE(HAVE_CLOCK_GETTIME, 1,
[Define if you have the clock_gettime function.])
[Define to 1 if you have the clock_gettime function.])
fi
fi
@@ -146,17 +144,27 @@ AC_CACHE_CHECK([for standard gettimeofday], ac_cv_func_gettimeofday,
[ac_cv_func_gettimeofday="no (cross-compiling)"])])
if test "$ac_cv_func_gettimeofday" = yes; then
AC_DEFINE(HAVE_GETTIMEOFDAY, 1,
[Define if you have a standard gettimeofday function])
[Define to 1 if you have a standard gettimeofday function])
fi
AC_CHECK_FUNCS( memcpy memmove strchr strdup mkstemp mktemp fdopen \
bsd_signal dup2 getcwd realpath sigsetmask sigaction \
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
@@ -179,7 +187,7 @@ if test "$ac_cv_header_nlist_h" = yes; then
[make_cv_nlist_struct=no])
if test "$make_cv_nlist_struct" = yes; then
AC_DEFINE(NLIST_STRUCT, 1,
[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.])
fi
fi
@@ -194,7 +202,7 @@ AC_CHECK_DECLS([sys_siglist, _sys_siglist, __sys_siglist], , ,
# Check out the wait reality.
AC_CHECK_HEADERS(sys/wait.h)
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
@@ -220,7 +228,7 @@ AC_CACHE_VAL(make_cv_union_wait, [dnl
[make_cv_union_wait=no])])
if test "$make_cv_union_wait" = yes; then
AC_DEFINE(HAVE_UNION_WAIT, 1,
[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>.])
fi
AC_MSG_RESULT($make_cv_union_wait)
@@ -228,7 +236,7 @@ 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 this if your system requires backslashes or drive specs in pathnames.])
[Define to 1 if your system requires backslashes or drive specs in pathnames.])
fi
@@ -264,9 +272,10 @@ AM_CONDITIONAL(USE_CUSTOMS, test "$use_customs" = true)
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],
[enable case insensitive file system support]),
case_insensitive_fs="yes" AC_DEFINE(HAVE_CASE_INSENSITIVE_FS),
case_insensitive_fs="no")
[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.
@@ -289,7 +298,7 @@ AC_CACHE_CHECK(for SA_RESTART, make_cv_sa_restart, [
if test "$make_cv_sa_restart" != no; then
AC_DEFINE(HAVE_SA_RESTART, 1,
[Define if <signal.h> defines the SA_RESTART constant.])
[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,
@@ -301,7 +310,7 @@ 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 this to enable job server support in GNU make.]);;
[Define to 1 to enable job server support in GNU make.]);;
esac
# if we have both lstat() and readlink() then we can support symlink
@@ -309,7 +318,7 @@ esac
case "$ac_cv_func_lstat/$ac_cv_func_readlink" in
yes/yes)
AC_DEFINE(MAKE_SYMLINKS, 1,
[Define this to enable symbolic link timestamp checking.]);;
[Define to 1 to enable symbolic link timestamp checking.]);;
esac
# Find the SCCS commands, so we can include them in our default rules.
@@ -336,14 +345,13 @@ if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 &&
fi])
case "$make_cv_sys_get_minus_G" in
yes) AC_DEFINE(SCCS_GET_MINUS_G, 1,
[Define this if the SCCS 'get' command understands the '-G<file>' option.]);;
[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,[
@@ -360,9 +368,14 @@ AC_CACHE_VAL(make_cv_sys_gnu_glob, [
#endif
], [AC_MSG_RESULT(yes)
make_cv_sys_gnu_glob=yes], [AC_MSG_RESULT([no; using local copy])
AC_SUBST(GLOBINC) GLOBINC='-I$(srcdir)/glob'
AC_SUBST(GLOBLIB) GLOBLIB=glob/libglob.a
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)
@@ -384,6 +397,8 @@ case "$host" in
;;
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

10
debug.h
View File

@@ -1,19 +1,19 @@
/* Debugging macros and interface.
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
Foundation, Inc.
Copyright (C) 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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
#define DB_NONE (0x000)
#define DB_BASIC (0x001)

View File

@@ -1,20 +1,20 @@
/* 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 Free Software
Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
#include "make.h"
#include "filedef.h"
@@ -41,11 +41,11 @@ static char default_suffixes[]
.s .ss .i .ii .mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
.w .ch .cweb .web .com .sh .elc .el";
#elif defined(__EMX__)
= ".out .a .ln .o .c .cc .C .cpp .p .f .F .r .y .l .s .S \
= ".out .a .ln .o .c .cc .C .cpp .p .f .F .m .r .y .l .ym .yl .s .S \
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
.w .ch .web .sh .elc .el .obj .exe .dll .lib";
#else
= ".out .a .ln .o .c .cc .C .cpp .p .f .F .r .y .l .s .S \
= ".out .a .ln .o .c .cc .C .cpp .p .f .F .m .r .y .l .ym .yl .s .S \
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
.w .ch .web .sh .elc .el";
#endif
@@ -192,6 +192,8 @@ static char *default_suffix_rules[] =
"$(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".f",
"$(LINK.f) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".m",
"$(LINK.m) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".p",
"$(LINK.p) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".F",
@@ -221,6 +223,8 @@ static char *default_suffix_rules[] =
"$(COMPILE.cpp) $(OUTPUT_OPTION) $<",
".f.o",
"$(COMPILE.f) $(OUTPUT_OPTION) $<",
".m.o",
"$(COMPILE.m) $(OUTPUT_OPTION) $<",
".p.o",
"$(COMPILE.p) $(OUTPUT_OPTION) $<",
".F.o",
@@ -249,15 +253,18 @@ static char *default_suffix_rules[] =
#endif
".l.c",
"@$(RM) $@ \n $(LEX.l) $< > $@",
".ym.m",
"$(YACC.m) $< \n mv -f y.tab.c $@",
".lm.m",
"@$(RM) $@ \n $(LEX.m) $< > $@",
".F.f",
"$(PREPROCESS.F) $(OUTPUT_OPTION) $<",
".r.f",
"$(PREPROCESS.r) $(OUTPUT_OPTION) $<",
/* This might actually make lex.yy.c if there's no %R%
directive in $*.l, but in that case why were you
trying to make $*.r anyway? */
/* This might actually make lex.yy.c if there's no %R% directive in $*.l,
but in that case why were you trying to make $*.r anyway? */
".l.r",
"$(LEX.l) $< > $@ \n mv -f lex.yy.r $@",
@@ -302,7 +309,7 @@ static char *default_suffix_rules[] =
0, 0,
};
static char *default_variables[] =
static const char *default_variables[] =
{
#ifdef VMS
#ifdef __ALPHA
@@ -398,9 +405,11 @@ static char *default_variables[] =
# else
"CXX", "gcc",
# endif /* __MSDOS__ */
"OBJC", "gcc",
#else
"CC", "cc",
"CXX", "g++",
"OBJC", "cc",
#endif
/* This expands to $(CO) $(COFLAGS) $< $@ if $@ does not exist,
@@ -468,6 +477,8 @@ static char *default_variables[] =
"LINK.o", "$(CC) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
"LINK.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.m", "$(OBJC) $(OBJCFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
"LINK.m", "$(OBJC) $(OBJCFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
"COMPILE.C", "$(COMPILE.cc)",
"COMPILE.cpp", "$(COMPILE.cc)",
@@ -476,6 +487,8 @@ static char *default_variables[] =
"LINK.cpp", "$(LINK.cc)",
"YACC.y", "$(YACC) $(YFLAGS)",
"LEX.l", "$(LEX) $(LFLAGS) -t",
"YACC.m", "$(YACC) $(YFLAGS)",
"LEX.m", "$(LEX) $(LFLAGS) -t",
"COMPILE.f", "$(FC) $(FFLAGS) $(TARGET_ARCH) -c",
"LINK.f", "$(FC) $(FFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
@@ -522,40 +535,40 @@ static char *default_variables[] =
void
set_default_suffixes (void)
{
suffix_file = enter_file (".SUFFIXES");
suffix_file = enter_file (strcache_add (".SUFFIXES"));
if (no_builtin_rules_flag)
(void) define_variable ("SUFFIXES", 8, "", o_default, 0);
define_variable_cname ("SUFFIXES", "", o_default, 0);
else
{
char *p = default_suffixes;
suffix_file->deps = (struct dep *)
multi_glob (parse_file_seq (&p, '\0', sizeof (struct dep), 1),
sizeof (struct dep));
(void) define_variable ("SUFFIXES", 8, default_suffixes, o_default, 0);
suffix_file->deps = enter_prereqs(PARSE_FILE_SEQ (&p, struct dep, '\0',
NULL, 0),
NULL);
define_variable_cname ("SUFFIXES", default_suffixes, o_default, 0);
}
}
/* Enter the default suffix rules as file rules. This used to be done in
install_default_implicit_rules, but that loses because we want the
suffix rules installed before reading makefiles, and thee pattern rules
suffix rules installed before reading makefiles, and the pattern rules
installed after. */
void
install_default_suffix_rules (void)
{
register char **s;
char **s;
if (no_builtin_rules_flag)
return;
for (s = default_suffix_rules; *s != 0; s += 2)
for (s = default_suffix_rules; *s != 0; s += 2)
{
register struct file *f = enter_file (s[0]);
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 = (struct commands *) xmalloc (sizeof (struct commands));
f->cmds = xmalloc (sizeof (struct commands));
f->cmds->fileinfo.filenm = 0;
f->cmds->commands = s[1];
f->cmds->command_lines = 0;
@@ -569,7 +582,7 @@ install_default_suffix_rules (void)
void
install_default_implicit_rules (void)
{
register struct pspec *p;
struct pspec *p;
if (no_builtin_rules_flag)
return;
@@ -584,11 +597,11 @@ install_default_implicit_rules (void)
void
define_default_variables (void)
{
register char **s;
const char **s;
if (no_builtin_variables_flag)
return;
for (s = default_variables; *s != 0; s += 2)
(void) define_variable (s[0], strlen (s[0]), s[1], o_default, 1);
define_variable (s[0], strlen (s[0]), s[1], o_default, 1);
}

64
dep.h
View File

@@ -1,20 +1,20 @@
/* 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 Free Software
Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
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
@@ -36,13 +36,14 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
struct dep
{
struct dep *next;
char *name;
char *stem;
const char *name;
const char *stem;
struct file *file;
unsigned int changed : 8;
unsigned int ignore_mtime : 1;
unsigned int staticpattern : 1;
unsigned int need_2nd_expansion : 1;
unsigned int dontcare : 1;
};
@@ -51,35 +52,42 @@ struct dep
struct nameseq
{
struct nameseq *next;
char *name;
const char *name;
};
extern struct nameseq *multi_glob PARAMS ((struct nameseq *chain, unsigned int size));
#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))
#ifdef VMS
extern struct nameseq *parse_file_seq ();
void *parse_file_seq ();
#else
extern struct nameseq *parse_file_seq PARAMS ((char **stringp, int stopchar, unsigned int size, int strip));
void *parse_file_seq (char **stringp, unsigned int size,
int stopchar, const char *prefix, int flags);
#endif
extern char *tilde_expand PARAMS ((char *name));
char *tilde_expand (const char *name);
#ifndef NO_ARCHIVES
extern struct nameseq *ar_glob PARAMS ((char *arname, char *member_pattern, unsigned int size));
struct nameseq *ar_glob (const char *arname, const char *member_pattern, unsigned int size);
#endif
#ifndef iAPX286
#define dep_name(d) ((d)->name == 0 ? (d)->file->name : (d)->name)
#else
/* Buggy compiler can't hack this. */
extern char *dep_name ();
#endif
#define dep_name(d) ((d)->name == 0 ? (d)->file->name : (d)->name)
extern struct dep *alloc_dep PARAMS ((void));
extern void free_dep PARAMS ((struct dep *d));
extern struct dep *copy_dep_chain PARAMS ((const struct dep *d));
extern void free_dep_chain PARAMS ((struct dep *d));
extern void free_ns_chain PARAMS ((struct nameseq *n));
extern struct dep *read_all_makefiles PARAMS ((char **makefiles));
extern int eval_buffer PARAMS ((char *buffer));
extern int update_goal_chain PARAMS ((struct dep *goals));
extern void uniquize_deps PARAMS ((struct dep *));
#define alloc_dep() (xcalloc (sizeof (struct dep)))
#define free_ns(_n) free (_n)
#define free_dep(_d) free_ns (_d)
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);

340
dir.c
View File

@@ -1,20 +1,20 @@
/* 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 Free Software
Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
#include "make.h"
#include "hash.h"
@@ -23,7 +23,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
# include <dirent.h>
# define NAMLEN(dirent) strlen((dirent)->d_name)
# ifdef VMS
extern char *vmsify PARAMS ((char *name, int type));
/* its prototype is in vmsdir.h, which is not needed for HAVE_DIRENT_H */
const char *vmsify (const char *name, int type);
# endif
#else
# define dirent direct
@@ -67,8 +68,8 @@ extern char *vmsify PARAMS ((char *name, int type));
#define _USE_LFN 0
#endif
static char *
dosify (char *filename)
static const char *
dosify (const char *filename)
{
static char dos_filename[14];
char *df;
@@ -117,24 +118,21 @@ dosify (char *filename)
#endif
#ifdef HAVE_CASE_INSENSITIVE_FS
static char *
downcase (char *filename)
static const char *
downcase (const char *filename)
{
static PATH_VAR (new_filename);
char *df;
int i;
if (filename == 0)
return 0;
df = new_filename;
/* First, transform the name part. */
for (i = 0; *filename != '\0'; ++i)
{
*df++ = tolower ((unsigned char)*filename);
++filename;
}
while (*filename != '\0')
{
*df++ = tolower ((unsigned char)*filename);
++filename;
}
*df = 0;
@@ -145,7 +143,7 @@ downcase (char *filename)
#ifdef VMS
static int
vms_hash (char *name)
vms_hash (const char *name)
{
int h = 0;
int g;
@@ -171,7 +169,7 @@ vms_hash (char *name)
/* fake stat entry for a directory */
static int
vmsstat_dir (char *name, struct stat *st)
vmsstat_dir (const char *name, struct stat *st)
{
char *s;
int h;
@@ -184,6 +182,7 @@ vmsstat_dir (char *name, struct stat *st)
s = strchr (name, ':'); /* find device */
if (s)
{
/* to keep the compiler happy we said "const char *name", now we cheat */
*s++ = 0;
st->st_dev = (char *)vms_hash (name);
h = vms_hash (s);
@@ -192,8 +191,7 @@ vmsstat_dir (char *name, struct stat *st)
else
{
st->st_dev = 0;
s = name;
h = vms_hash (s);
h = vms_hash (name);
}
st->st_ino[0] = h & 0xff;
@@ -214,27 +212,24 @@ struct directory_contents
{
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 filesystems. The most unique attribute I can
* come up with is the fully qualified name of the directory. Beware
* though, this is also unreliable. I'm open to suggestion on a better
* way to emulate inode.
*/
/* Inode means nothing on WINDOWS32. Even file key information is
* unreliable because it is random per file open and undefined for remote
* filesystems. The most unique attribute I can come up with is the fully
* qualified name of the directory. Beware though, this is also
* unreliable. I'm open to suggestion on a better way to emulate inode. */
char *path_key;
int ctime;
int mtime; /* controls check for stale directory cache */
int fs_flags; /* FS_FAT, FS_NTFS, ... */
#define FS_FAT 0x1
#define FS_NTFS 0x2
#define FS_UNKNOWN 0x4
# define FS_FAT 0x1
# define FS_NTFS 0x2
# define FS_UNKNOWN 0x4
#else
#ifdef VMS
# ifdef VMS
ino_t ino[3];
#else
# else
ino_t ino;
#endif
# endif
#endif /* WINDOWS32 */
struct hash_table dirfiles; /* Files in this directory. */
DIR *dirstream; /* Stream reading this directory. */
@@ -243,7 +238,7 @@ struct directory_contents
static unsigned long
directory_contents_hash_1 (const void *key_0)
{
struct directory_contents const *key = (struct directory_contents const *) key_0;
const struct directory_contents *key = key_0;
unsigned long hash;
#ifdef WINDOWS32
@@ -266,7 +261,7 @@ directory_contents_hash_1 (const void *key_0)
static unsigned long
directory_contents_hash_2 (const void *key_0)
{
struct directory_contents const *key = (struct directory_contents const *) key_0;
const struct directory_contents *key = key_0;
unsigned long hash;
#ifdef WINDOWS32
@@ -301,8 +296,8 @@ directory_contents_hash_2 (const void *key_0)
static int
directory_contents_hash_cmp (const void *xv, const void *yv)
{
struct directory_contents const *x = (struct directory_contents const *) xv;
struct directory_contents const *y = (struct directory_contents const *) yv;
const struct directory_contents *x = xv;
const struct directory_contents *y = yv;
int result;
#ifdef WINDOWS32
@@ -338,7 +333,7 @@ static struct hash_table directory_contents;
struct directory
{
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
@@ -349,20 +344,20 @@ struct directory
static unsigned long
directory_hash_1 (const void *key)
{
return_ISTRING_HASH_1 (((struct directory const *) key)->name);
return_ISTRING_HASH_1 (((const struct directory *) key)->name);
}
static unsigned long
directory_hash_2 (const void *key)
{
return_ISTRING_HASH_2 (((struct directory const *) key)->name);
return_ISTRING_HASH_2 (((const struct directory *) key)->name);
}
static int
directory_hash_cmp (const void *x, const void *y)
{
return_ISTRING_COMPARE (((struct directory const *) x)->name,
((struct directory const *) y)->name);
return_ISTRING_COMPARE (((const struct directory *) x)->name,
((const struct directory *) y)->name);
}
/* Table of directories hashed by name. */
@@ -379,7 +374,7 @@ static unsigned int open_directories = 0;
struct dirfile
{
char *name; /* Name of the file. */
const char *name; /* Name of the file. */
short length;
short impossible; /* This file is impossible. */
};
@@ -399,8 +394,8 @@ dirfile_hash_2 (const void *key)
static int
dirfile_hash_cmp (const void *xv, const void *yv)
{
struct dirfile const *x = ((struct dirfile const *) xv);
struct dirfile const *y = ((struct dirfile const *) yv);
const struct dirfile *x = xv;
const struct dirfile *y = yv;
int result = x->length - y->length;
if (result)
return result;
@@ -411,17 +406,18 @@ dirfile_hash_cmp (const void *xv, const void *yv)
#define DIRFILE_BUCKETS 107
#endif
static int dir_contents_file_exists_p PARAMS ((struct directory_contents *dir, char *filename));
static struct directory *find_directory PARAMS ((char *name));
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'. */
static struct directory *
find_directory (char *name)
find_directory (const char *name)
{
register char *p;
register struct directory *dir;
register struct directory **dir_slot;
const char *p;
struct directory *dir;
struct directory **dir_slot;
struct directory dir_key;
int r;
#ifdef WINDOWS32
@@ -450,32 +446,39 @@ find_directory (char *name)
/* The directory was not found. Create a new entry for it. */
p = name + strlen (name);
dir = (struct directory *) xmalloc (sizeof (struct directory));
dir->name = savestring (name, p - name);
dir = xmalloc (sizeof (struct directory));
#if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
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. */
#ifdef WINDOWS32
/* Remove any trailing '\'. Windows32 stat fails even on valid
directories if they end in '\'. */
if (p[-1] == '\\')
p[-1] = '\0';
#endif
#ifdef VMS
r = vmsstat_dir (name, &st);
#elif defined(WINDOWS32)
{
char tem[MAXPATHLEN], *tstart, *tend;
/* Remove any trailing slashes. Windows32 stat fails even on
valid directories if they end in a slash. */
memcpy (tem, name, p - name + 1);
tstart = tem;
if (tstart[1] == ':')
tstart += 2;
for (tend = tem + (p - name - 1);
tend > tstart && (*tend == '/' || *tend == '\\');
tend--)
*tend = '\0';
r = stat (tem, &st);
}
#else
EINTRLOOP (r, stat (name, &st));
#endif
#ifdef WINDOWS32
/* Put back the trailing '\'. If we don't, we're permanently
truncating the value! */
if (p[-1] == '\0')
p[-1] = '\\';
#endif
if (r < 0)
{
/* Couldn't stat the directory. Mark this by
@@ -549,8 +552,8 @@ find_directory (char *name)
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. */
/* Couldn't open the directory. Mark this by setting the
`files' member to a nil pointer. */
dc->dirfiles.ht_vec = 0;
else
{
@@ -561,7 +564,7 @@ find_directory (char *name)
if (open_directories == MAX_OPEN_DIRECTORIES)
/* We have too many directories open already.
Read the entire directory and then close it. */
(void) dir_contents_file_exists_p (dc, (char *) 0);
dir_contents_file_exists_p (dc, 0);
}
}
@@ -577,7 +580,8 @@ find_directory (char *name)
FILENAME must contain no slashes. */
static int
dir_contents_file_exists_p (struct directory_contents *dir, char *filename)
dir_contents_file_exists_p (struct directory_contents *dir,
const char *filename)
{
unsigned int hash;
struct dirfile *df;
@@ -588,10 +592,9 @@ dir_contents_file_exists_p (struct directory_contents *dir, char *filename)
#endif
if (dir == 0 || dir->dirfiles.ht_vec == 0)
{
/* The directory could not be stat'd or opened. */
return 0;
}
return 0;
#ifdef __MSDOS__
filename = dosify (filename);
#endif
@@ -621,11 +624,9 @@ dir_contents_file_exists_p (struct directory_contents *dir, char *filename)
}
dirfile_key.name = filename;
dirfile_key.length = strlen (filename);
df = (struct dirfile *) hash_find_item (&dir->dirfiles, &dirfile_key);
df = hash_find_item (&dir->dirfiles, &dirfile_key);
if (df)
{
return !df->impossible;
}
return !df->impossible;
}
/* The file was not found in the hashed list.
@@ -646,7 +647,7 @@ dir_contents_file_exists_p (struct directory_contents *dir, char *filename)
dir->mtime = time ((time_t *) 0);
rehash = 1;
}
else if (stat(dir->path_key, &st) == 0 && st.st_mtime > dir->mtime)
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;
@@ -658,7 +659,7 @@ dir_contents_file_exists_p (struct directory_contents *dir, char *filename)
return 0;
/* make sure directory can still be opened; if not return. */
dir->dirstream = opendir(dir->path_key);
dir->dirstream = opendir (dir->path_key);
if (!dir->dirstream)
return 0;
}
@@ -677,7 +678,11 @@ dir_contents_file_exists_p (struct directory_contents *dir, char *filename)
ENULLLOOP (d, readdir (dir->dirstream));
if (d == 0)
break;
{
if (errno)
fatal (NILF, "INTERNAL: readdir: %s\n", strerror (errno));
break;
}
#if defined(VMS) && defined(HAVE_DIRENT_H)
/* In VMS we get file versions too, which have to be stripped off */
@@ -702,17 +707,19 @@ dir_contents_file_exists_p (struct directory_contents *dir, char *filename)
if (! rehash || HASH_VACANT (*dirfile_slot))
#endif
{
df = (struct dirfile *) xmalloc (sizeof (struct dirfile));
df->name = savestring (d->d_name, len);
df = xmalloc (sizeof (struct dirfile));
#if defined(HAVE_CASE_INSENSITIVE_FS) && defined(VMS)
df->name = strcache_add_len (downcase(d->d_name), len);
#else
df->name = strcache_add_len (d->d_name, len);
#endif
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 && strieq (d->d_name, filename))
{
return 1;
}
if (filename != 0 && patheq (d->d_name, filename))
return 1;
}
/* If the directory has been completely read in,
@@ -731,7 +738,7 @@ dir_contents_file_exists_p (struct directory_contents *dir, char *filename)
FILENAME must contain no slashes. */
int
dir_file_exists_p (char *dirname, char *filename)
dir_file_exists_p (const char *dirname, const char *filename)
{
return dir_contents_file_exists_p (find_directory (dirname)->contents,
filename);
@@ -740,11 +747,11 @@ dir_file_exists_p (char *dirname, char *filename)
/* Return 1 if the file named NAME exists. */
int
file_exists_p (char *name)
file_exists_p (const char *name)
{
char *dirend;
char *dirname;
char *slash;
const char *dirend;
const char *dirname;
const char *slash;
#ifndef NO_ARCHIVES
if (ar_name (name))
@@ -755,14 +762,14 @@ file_exists_p (char *name)
dirend = strrchr (name, ']');
if (dirend == 0)
dirend = strrchr (name, ':');
if (dirend == (char *)0)
if (dirend == 0)
return dir_file_exists_p ("[]", name);
#else /* !VMS */
dirend = strrchr (name, '/');
#ifdef HAVE_DOS_PATHS
/* Forward and backslashes might be mixed. We need the rightmost one. */
{
char *bslash = strrchr(name, '\\');
const char *bslash = strrchr(name, '\\');
if (!dirend || bslash > dirend)
dirend = bslash;
/* The case of "d:file". */
@@ -783,15 +790,17 @@ file_exists_p (char *name)
dirname = "/";
else
{
char *p;
#ifdef HAVE_DOS_PATHS
/* d:/ and d: are *very* different... */
if (dirend < name + 3 && name[1] == ':' &&
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
dirend++;
#endif
dirname = (char *) alloca (dirend - name + 1);
bcopy (name, dirname, dirend - name);
dirname[dirend - name] = '\0';
p = alloca (dirend - name + 1);
memcpy (p, name, dirend - name);
p[dirend - name] = '\0';
dirname = p;
}
return dir_file_exists_p (dirname, slash + 1);
}
@@ -801,12 +810,12 @@ file_exists_p (char *name)
as an intermediate file, and it has failed. */
void
file_impossible (char *filename)
file_impossible (const char *filename)
{
char *dirend;
register char *p = filename;
register struct directory *dir;
register struct dirfile *new;
const char *dirend;
const char *p = filename;
struct directory *dir;
struct dirfile *new;
#ifdef VMS
dirend = strrchr (p, ']');
@@ -820,7 +829,7 @@ file_impossible (char *filename)
# ifdef HAVE_DOS_PATHS
/* Forward and backslashes might be mixed. We need the rightmost one. */
{
char *bslash = strrchr(p, '\\');
const char *bslash = strrchr(p, '\\');
if (!dirend || bslash > dirend)
dirend = bslash;
/* The case of "d:file". */
@@ -837,34 +846,32 @@ file_impossible (char *filename)
#endif /* VMS */
else
{
char *dirname;
char *slash = dirend;
const char *dirname;
const char *slash = dirend;
if (dirend == p)
dirname = "/";
else
{
char *cp;
#ifdef HAVE_DOS_PATHS
/* d:/ and d: are *very* different... */
if (dirend < p + 3 && p[1] == ':' &&
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
dirend++;
#endif
dirname = (char *) alloca (dirend - p + 1);
bcopy (p, dirname, dirend - p);
dirname[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;
}
if (dir->contents == 0)
{
/* The directory could not be stat'd. We allocate a contents
structure for it, but leave it out of the contents hash table. */
dir->contents = (struct directory_contents *)
xmalloc (sizeof (struct directory_contents));
bzero ((char *) dir->contents, sizeof (struct directory_contents));
}
/* The directory could not be stat'd. We allocate a contents
structure for it, but leave it out of the contents hash table. */
dir->contents = xcalloc (sizeof (struct directory_contents));
if (dir->contents->dirfiles.ht_vec == 0)
{
@@ -874,9 +881,13 @@ file_impossible (char *filename)
/* Make a new entry and put it in the table. */
new = (struct dirfile *) xmalloc (sizeof (struct dirfile));
new->name = xstrdup (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);
#else
new->name = strcache_add_len (filename, new->length);
#endif
new->impossible = 1;
hash_insert (&dir->contents->dirfiles, new);
}
@@ -884,12 +895,12 @@ file_impossible (char *filename)
/* Return nonzero if FILENAME has been marked impossible. */
int
file_impossible_p (char *filename)
file_impossible_p (const char *filename)
{
char *dirend;
register char *p = filename;
register struct directory_contents *dir;
register struct dirfile *dirfile;
const char *dirend;
const char *p = filename;
struct directory_contents *dir;
struct dirfile *dirfile;
struct dirfile dirfile_key;
#ifdef VMS
@@ -901,7 +912,7 @@ file_impossible_p (char *filename)
#ifdef HAVE_DOS_PATHS
/* Forward and backslashes might be mixed. We need the rightmost one. */
{
char *bslash = strrchr(filename, '\\');
const char *bslash = strrchr(filename, '\\');
if (!dirend || bslash > dirend)
dirend = bslash;
/* The case of "d:file". */
@@ -918,21 +929,23 @@ file_impossible_p (char *filename)
#endif /* VMS */
else
{
char *dirname;
char *slash = dirend;
const char *dirname;
const char *slash = dirend;
if (dirend == filename)
dirname = "/";
else
{
char *cp;
#ifdef HAVE_DOS_PATHS
/* d:/ and d: are *very* different... */
if (dirend < filename + 3 && filename[1] == ':' &&
(*dirend == '/' || *dirend == '\\' || *dirend == ':'))
dirend++;
#endif
dirname = (char *) alloca (dirend - filename + 1);
bcopy (p, dirname, dirend - p);
dirname[dirend - p] = '\0';
cp = alloca (dirend - filename + 1);
memcpy (cp, p, dirend - p);
cp[dirend - p] = '\0';
dirname = cp;
}
dir = find_directory (dirname)->contents;
p = filename = slash + 1;
@@ -954,7 +967,7 @@ file_impossible_p (char *filename)
dirfile_key.name = filename;
dirfile_key.length = strlen (filename);
dirfile = (struct dirfile *) hash_find_item (&dir->dirfiles, &dirfile_key);
dirfile = hash_find_item (&dir->dirfiles, &dirfile_key);
if (dirfile)
return dirfile->impossible;
@@ -964,8 +977,8 @@ file_impossible_p (char *filename)
/* Return the already allocated name in the
directory hash table that matches DIR. */
char *
dir_name (char *dir)
const char *
dir_name (const char *dir)
{
return find_directory (dir)->name;
}
@@ -975,10 +988,10 @@ dir_name (char *dir)
void
print_dir_data_base (void)
{
register unsigned int files;
register unsigned int impossible;
register struct directory **dir_slot;
register struct directory **dir_end;
unsigned int files;
unsigned int impossible;
struct directory **dir_slot;
struct directory **dir_end;
puts (_("\n# Directories\n"));
@@ -988,7 +1001,7 @@ print_dir_data_base (void)
dir_end = dir_slot + directories.ht_size;
for ( ; dir_slot < dir_end; dir_slot++)
{
register struct directory *dir = *dir_slot;
struct directory *dir = *dir_slot;
if (! HASH_VACANT (dir))
{
if (dir->contents == 0)
@@ -1013,16 +1026,16 @@ print_dir_data_base (void)
}
else
{
register unsigned int f = 0;
register unsigned int im = 0;
register struct dirfile **files_slot;
register struct dirfile **files_end;
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++)
{
register struct dirfile *df = *files_slot;
struct dirfile *df = *files_slot;
if (! HASH_VACANT (df))
{
if (df->impossible)
@@ -1092,14 +1105,14 @@ struct dirstream
};
/* Forward declarations. */
static __ptr_t open_dirstream PARAMS ((const char *));
static struct dirent *read_dirstream PARAMS ((__ptr_t));
static __ptr_t open_dirstream (const char *);
static struct dirent *read_dirstream (__ptr_t);
static __ptr_t
open_dirstream (const char *directory)
{
struct dirstream *new;
struct directory *dir = find_directory ((char *)directory);
struct directory *dir = find_directory (directory);
if (dir->contents == 0 || dir->contents->dirfiles.ht_vec == 0)
/* DIR->contents is nil if the directory could not be stat'd.
@@ -1109,9 +1122,9 @@ open_dirstream (const char *directory)
/* Read all the contents of the directory now. There is no benefit
in being lazy, since glob will want to see every file anyway. */
(void) dir_contents_file_exists_p (dir->contents, (char *) 0);
dir_contents_file_exists_p (dir->contents, 0);
new = (struct dirstream *) xmalloc (sizeof (struct dirstream));
new = xmalloc (sizeof (struct dirstream));
new->contents = dir->contents;
new->dirfile_slot = (struct dirfile **) new->contents->dirfiles.ht_vec;
@@ -1121,29 +1134,28 @@ open_dirstream (const char *directory)
static struct dirent *
read_dirstream (__ptr_t stream)
{
struct dirstream *const ds = (struct dirstream *) stream;
struct directory_contents *dc = ds->contents;
struct dirfile **dirfile_end = (struct dirfile **) dc->dirfiles.ht_vec + dc->dirfiles.ht_size;
static char *buf;
static unsigned int bufsz;
struct dirstream *const ds = (struct dirstream *) stream;
struct directory_contents *dc = ds->contents;
struct dirfile **dirfile_end = (struct dirfile **) dc->dirfiles.ht_vec + dc->dirfiles.ht_size;
while (ds->dirfile_slot < dirfile_end)
{
register struct dirfile *df = *ds->dirfile_slot++;
struct dirfile *df = *ds->dirfile_slot++;
if (! HASH_VACANT (df) && !df->impossible)
{
/* The glob interface wants a `struct dirent',
so mock one up. */
/* The glob interface wants a `struct dirent', so mock one up. */
struct dirent *d;
unsigned int len = df->length + 1;
if (sizeof *d - sizeof d->d_name + len > bufsz)
unsigned int sz = sizeof (*d) - sizeof (d->d_name) + len;
if (sz > bufsz)
{
if (buf != 0)
free (buf);
bufsz *= 2;
if (sizeof *d - sizeof d->d_name + len > bufsz)
bufsz = sizeof *d - sizeof d->d_name + len;
buf = xmalloc (bufsz);
if (sz > bufsz)
bufsz = sz;
buf = xrealloc (buf, bufsz);
}
d = (struct dirent *) buf;
#ifdef __MINGW32__
@@ -1180,7 +1192,7 @@ ansi_free (void *p)
*/
#ifndef stat
# ifndef VMS
extern int stat PARAMS ((const char *path, struct stat *sbuf));
int stat (const char *path, struct stat *sbuf);
# endif
# define local_stat stat
#else
@@ -1197,7 +1209,6 @@ local_stat (const char *path, struct stat *buf)
void
dir_setup_glob (glob_t *gl)
{
/* Bogus sunos4 compiler complains (!) about & before functions. */
gl->gl_opendir = open_dirstream;
gl->gl_readdir = read_dirstream;
gl->gl_closedir = ansi_free;
@@ -1212,5 +1223,6 @@ hash_init_directories (void)
hash_init (&directories, DIRECTORY_BUCKETS,
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_cmp);
directory_contents_hash_1, directory_contents_hash_2,
directory_contents_hash_cmp);
}

View File

@@ -1,19 +1,20 @@
# -*-Makefile-*-, or close enough
# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
# Foundation, Inc.
# Copyright (C) 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 2, or (at your option) any later version.
# 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.
# 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
# GNU Make; see the file COPYING. If not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
# this program. If not, see <http://www.gnu.org/licenses/>.
TEXI2HTML = texi2html
TEXI2HTML_FLAGS = -split_chapter

File diff suppressed because it is too large Load Diff

View File

@@ -1,19 +1,20 @@
@echo off
rem Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
rem Software Foundation, Inc.
rem Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
rem 2008, 2009, 2010 Free Software Foundation, Inc.
rem This file is part of GNU Make.
rem GNU Make is free software; you can redistribute it and/or modify it under the
rem terms of the GNU General Public License as published by the Free Software
rem Foundation; either version 2, or (at your option) any later version.
rem GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
rem WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
rem A PARTICULAR PURPOSE. See the GNU General Public License for more details.
rem You should have received a copy of the GNU General Public License along with
rem GNU Make; see the file COPYING. If not, write to the Free Software
rem Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
rem
rem GNU Make is free software; you can redistribute it and/or modify it under
rem the terms of the GNU General Public License as published by the Free
rem Software Foundation; either version 3 of the License, or (at your option)
rem any later version.
rem
rem GNU Make is distributed in the hope that it will be useful, but WITHOUT
rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
rem more details.
rem
rem You should have received a copy of the GNU General Public License along
rem with this program. If not, see <http://www.gnu.org/licenses/>.
echo Building Make for MSDOS

147
expand.c
View File

@@ -1,20 +1,20 @@
/* 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 Free Software
Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
#include "make.h"
@@ -55,7 +55,7 @@ char *variable_buffer;
the following call. */
char *
variable_buffer_output (char *ptr, char *string, unsigned int length)
variable_buffer_output (char *ptr, const char *string, unsigned int length)
{
register unsigned int newlen = length + (ptr - variable_buffer);
@@ -65,12 +65,11 @@ variable_buffer_output (char *ptr, char *string, unsigned int length)
variable_buffer_length = (newlen + 100 > 2 * variable_buffer_length
? newlen + 100
: 2 * variable_buffer_length);
variable_buffer = (char *) xrealloc (variable_buffer,
variable_buffer_length);
variable_buffer = xrealloc (variable_buffer, variable_buffer_length);
ptr = variable_buffer + offset;
}
bcopy (string, ptr, length);
memcpy (ptr, string, length);
return ptr + length;
}
@@ -84,7 +83,7 @@ initialize_variable_output (void)
if (variable_buffer == 0)
{
variable_buffer_length = 200;
variable_buffer = (char *) xmalloc (variable_buffer_length);
variable_buffer = xmalloc (variable_buffer_length);
variable_buffer[0] = '\0';
}
@@ -93,7 +92,7 @@ initialize_variable_output (void)
/* Recursively expand V. The returned string is malloc'd. */
static char *allocated_variable_append PARAMS ((const struct variable *v));
static char *allocated_variable_append (const struct variable *v);
char *
recursively_expand_for_file (struct variable *v, struct file *file)
@@ -160,9 +159,9 @@ recursively_expand_for_file (struct variable *v, struct file *file)
__inline
#endif
static char *
reference_variable (char *o, char *name, unsigned int length)
reference_variable (char *o, const char *name, unsigned int length)
{
register struct variable *v;
struct variable *v;
char *value;
v = lookup_variable (name, length);
@@ -191,29 +190,39 @@ reference_variable (char *o, char *name, unsigned int length)
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. */
NULL.
*/
char *
variable_expand_string (char *line, char *string, long length)
variable_expand_string (char *line, const char *string, long length)
{
register struct variable *v;
register char *p, *o, *p1;
char save_char = '\0';
struct variable *v;
const char *p, *p1;
char *abuf = NULL;
char *o;
unsigned int line_offset;
if (!line)
line = initialize_variable_output();
p = string;
o = line;
line_offset = line - variable_buffer;
if (length >= 0)
if (length == 0)
{
save_char = string[length];
string[length] = '\0';
variable_buffer_output (o, "", 1);
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;
while (1)
{
/* Copy all following uninteresting chars all at once to the
@@ -243,10 +252,11 @@ variable_expand_string (char *line, char *string, long length)
{
char openparen = *p;
char closeparen = (openparen == '(') ? ')' : '}';
register char *beg = p + 1;
int free_beg = 0;
char *op, *begp;
char *end, *colon;
const char *begp;
const char *beg = p + 1;
char *op;
char *abeg = NULL;
const char *end, *colon;
op = o;
begp = p;
@@ -282,8 +292,8 @@ variable_expand_string (char *line, char *string, long length)
such as `$($(a)'. */
if (count < 0)
{
beg = expand_argument (beg, p); /* Expand the name. */
free_beg = 1; /* Remember to free BEG when finished. */
abeg = expand_argument (beg, p); /* Expand the name. */
beg = abeg;
end = strchr (beg, '\0');
}
}
@@ -301,7 +311,7 @@ variable_expand_string (char *line, char *string, long length)
if (colon)
{
/* This looks like a substitution reference: $(FOO:A=B). */
char *subst_beg, *subst_end, *replace_beg, *replace_end;
const char *subst_beg, *subst_end, *replace_beg, *replace_end;
subst_beg = colon + 1;
subst_end = lindex (subst_beg, end, '=');
@@ -333,15 +343,14 @@ variable_expand_string (char *line, char *string, long length)
/* Copy the pattern and the replacement. Add in an
extra % at the beginning to use in case there
isn't one in the pattern. */
pattern = (char *) alloca (subst_end - subst_beg + 2);
pattern = alloca (subst_end - subst_beg + 2);
*(pattern++) = '%';
bcopy (subst_beg, pattern, subst_end - subst_beg);
memcpy (pattern, subst_beg, subst_end - subst_beg);
pattern[subst_end - subst_beg] = '\0';
replace = (char *) alloca (replace_end
- replace_beg + 2);
replace = alloca (replace_end - replace_beg + 2);
*(replace++) = '%';
bcopy (replace_beg, replace,
memcpy (replace, replace_beg,
replace_end - replace_beg);
replace[replace_end - replace_beg] = '\0';
@@ -351,7 +360,9 @@ variable_expand_string (char *line, char *string, long length)
if (ppercent)
{
++ppercent;
rpercent = 0;
rpercent = find_percent (replace);
if (rpercent)
++rpercent;
}
else
{
@@ -361,8 +372,8 @@ variable_expand_string (char *line, char *string, long length)
--replace;
}
o = patsubst_expand (o, value, pattern, replace,
ppercent, rpercent);
o = patsubst_expand_pat (o, value, pattern, replace,
ppercent, rpercent);
if (v->recursive)
free (value);
@@ -375,8 +386,8 @@ variable_expand_string (char *line, char *string, long length)
Look up the value of the variable. */
o = reference_variable (o, beg, end - beg);
if (free_beg)
free (beg);
if (abeg)
free (abeg);
}
break;
@@ -396,14 +407,14 @@ variable_expand_string (char *line, char *string, long length)
if (*p == '\0')
break;
else
++p;
++p;
}
if (save_char)
string[length] = save_char;
if (abuf)
free (abuf);
(void)variable_buffer_output (o, "", 1);
variable_buffer_output (o, "", 1);
return (variable_buffer + line_offset);
}
@@ -413,7 +424,7 @@ variable_expand_string (char *line, char *string, long length)
and is valid only until the next time this function is called. */
char *
variable_expand (char *line)
variable_expand (const char *line)
{
return variable_expand_string(NULL, line, (long)-1);
}
@@ -427,42 +438,57 @@ variable_expand (char *line)
char *
expand_argument (const char *str, const char *end)
{
char *tmp;
char *tmp, *alloc = NULL;
char *r;
if (str == end)
return xstrdup("");
if (!end || *end == '\0')
return allocated_variable_expand ((char *)str);
return allocated_variable_expand (str);
tmp = (char *) alloca (end - str + 1);
bcopy (str, tmp, end - str);
if (end - str + 1 > 1000)
tmp = alloc = xmalloc (end - str + 1);
else
tmp = alloca (end - str + 1);
memcpy (tmp, str, end - str);
tmp[end - str] = '\0';
return allocated_variable_expand (tmp);
r = allocated_variable_expand (tmp);
if (alloc)
free (alloc);
return r;
}
/* Expand LINE for FILE. Error messages refer to the file and line where
FILE's commands were found. Expansion uses FILE's variable set list. */
char *
variable_expand_for_file (char *line, struct file *file)
variable_expand_for_file (const char *line, struct file *file)
{
char *result;
struct variable_set_list *save;
struct variable_set_list *savev;
const struct floc *savef;
if (file == 0)
return variable_expand (line);
save = current_variable_set_list;
savev = current_variable_set_list;
current_variable_set_list = file->variables;
savef = reading_file;
if (file->cmds && file->cmds->fileinfo.filenm)
reading_file = &file->cmds->fileinfo;
else
reading_file = 0;
result = variable_expand (line);
current_variable_set_list = save;
reading_file = 0;
current_variable_set_list = savev;
reading_file = savef;
return result;
}
@@ -536,7 +562,7 @@ allocated_variable_append (const struct variable *v)
This function is called a lot. It wants to be efficient. */
char *
allocated_variable_expand_for_file (char *line, struct file *file)
allocated_variable_expand_for_file (const char *line, struct file *file)
{
char *value;
@@ -547,11 +573,6 @@ allocated_variable_expand_for_file (char *line, struct file *file)
value = variable_expand_for_file (line, file);
#if 0
/* Waste a little memory and save time. */
value = xrealloc (value, strlen (value))
#endif
variable_buffer = obuf;
variable_buffer_length = olen;

777
file.c

File diff suppressed because it is too large Load Diff

View File

@@ -1,20 +1,20 @@
/* 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 Free Software
Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
/* Structure that represents the info on one file
@@ -25,14 +25,14 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
struct file
{
char *name;
char *hname; /* Hashed filename */
char *vpath; /* VPATH/vpath pathname */
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. */
char *stem; /* Implicit stem, if an implicit
rule has been used */
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
@@ -94,24 +94,28 @@ struct file
pattern-specific variables. */
unsigned int considered:1; /* equal to 'considered' if file has been
considered on current scan of goal chain */
unsigned int no_diag:1; /* True if the file failed to update and no
diagnostics has been issued (dontcare). */
};
extern struct file *default_goal_file, *suffix_file, *default_file;
extern char **default_goal_name;
extern struct file *suffix_file, *default_file;
extern struct file *lookup_file PARAMS ((char *name));
extern struct file *enter_file PARAMS ((char *name));
extern struct dep *parse_prereqs PARAMS ((char *prereqs));
extern void remove_intermediates PARAMS ((int sig));
extern void snap_deps PARAMS ((void));
extern void rename_file PARAMS ((struct file *file, char *name));
extern void rehash_file PARAMS ((struct file *file, char *name));
extern void set_command_state PARAMS ((struct file *file, enum cmd_state state));
extern void notice_finished_file PARAMS ((struct file *file));
extern void init_hash_files PARAMS ((void));
extern char *build_target_list PARAMS ((char *old_list));
struct file *lookup_file (const char *name);
struct file *enter_file (const char *name);
struct dep *split_prereqs (char *prereqstr);
struct dep *enter_prereqs (struct dep *prereqs, const char *stem);
void remove_intermediates (int sig);
void snap_deps (void);
void rename_file (struct file *file, const char *name);
void rehash_file (struct file *file, const char *name);
void set_command_state (struct file *file, enum cmd_state state);
void notice_finished_file (struct file *file);
void init_hash_files (void);
char *build_target_list (char *old_list);
void print_prereqs (const struct dep *deps);
void print_file_data_base (void);
#if FILE_TIMESTAMP_HI_RES
# define FILE_TIMESTAMP_STAT_MODTIME(fname, st) \
@@ -152,10 +156,9 @@ extern char *build_target_list PARAMS ((char *old_list));
* 302 / 1000) \
+ 1 + 1 + 4 + 25)
extern FILE_TIMESTAMP file_timestamp_cons PARAMS ((char const *,
time_t, int));
extern FILE_TIMESTAMP file_timestamp_now PARAMS ((int *));
extern void file_timestamp_sprintf PARAMS ((char *p, FILE_TIMESTAMP ts));
FILE_TIMESTAMP file_timestamp_cons (char const *, time_t, int);
FILE_TIMESTAMP file_timestamp_now (int *);
void file_timestamp_sprintf (char *p, FILE_TIMESTAMP ts);
/* Return the mtime of file F (a struct file *), caching it.
The value is NONEXISTENT_MTIME if the file does not exist. */
@@ -165,7 +168,7 @@ extern void file_timestamp_sprintf PARAMS ((char *p, FILE_TIMESTAMP ts));
we don't find it.
The value is NONEXISTENT_MTIME if the file does not exist. */
#define file_mtime_no_search(f) file_mtime_1 ((f), 0)
extern FILE_TIMESTAMP f_mtime PARAMS ((struct file *file, int search));
FILE_TIMESTAMP f_mtime (struct file *file, int search);
#define file_mtime_1(f, v) \
((f)->last_mtime == UNKNOWN_MTIME ? f_mtime ((f), v) : (f)->last_mtime)

File diff suppressed because it is too large Load Diff

View File

@@ -1,21 +1,19 @@
/* 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 Free
Software Foundation, Inc.
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2008, 2009, 2010 Free Software Foundation, Inc.
This program 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 2, or (at your option)
any later version.
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.
This program 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.
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; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
/* Compile-time symbols that this file uses:
@@ -704,7 +702,7 @@ getloadavg (double loadavg[], int nelem)
for (i = 0; i < conf.config_maxclass; ++i)
{
struct class_stats stats;
bzero ((char *) &stats, sizeof stats);
memset (&stats, '\0', sizeof stats);
desc.sd_type = CPUTYPE_CLASS;
desc.sd_objid = i;

View File

@@ -4,25 +4,23 @@ NOTE: getopt is now part of the C library, so if you don't know what
before changing it!
Copyright (C) 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
Foundation, Inc.
1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 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.
This program 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 2, or (at your option) any
later version.
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.
This program 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.
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; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
Ditto for AIX 3.2 and <stdlib.h>. */

View File

@@ -1,23 +1,22 @@
/* Declarations for getopt.
Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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.
This program 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 2, or (at your option) any
later version.
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.
This program 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.
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; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef _GETOPT_H
#define _GETOPT_H 1

View File

@@ -1,24 +1,22 @@
/* 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 Free Software
Foundation, Inc.
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
2010 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.
This program 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 2, or (at your option) any
later version.
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.
This program 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.
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; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
#ifdef HAVE_CONFIG_H
#include <config.h>

View File

@@ -1,19 +1,19 @@
/* Convenience header for conditional use of GNU <libintl.h>.
Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005,
2006 Free Software Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef _LIBGETTEXT_H
#define _LIBGETTEXT_H 1

View File

@@ -1,7 +1,18 @@
2008-09-28 Juan Manuel Guerrero <juan.guerrero@gmx.de>
* glob.c (my_realloc) [__DJGPP__]: Don't define, and don't
redefine realloc to call it, since the DJGPP's realloc handles
NULL pointers correctly.
2007-12-22 Juan Manuel Guerrero <juan.guerrero@gmx.de> (tiny change)
* glob.c [__GNU_LIBRARY__ && __DJGPP__]: Add a realloc
declaration that matches the one in the DJGPP libc.
2006-02-24 Eli Zaretskii <eliz@gnu.org>
* glob.c (my_malloc) [WINDOWS32]: Provide a full ISO C prototype,
to avoid compiler warnings.
to avoid compiler warnings.
2005-06-25 Paul D. Smith <psmith@gnu.org>
@@ -153,22 +164,22 @@ Sat Jun 22 10:44:09 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
Fri Jun 21 00:27:51 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* posix/fnmatch.c (fnmatch): Fix \*[*?]+ case to increment name ptr
only for ?s, not for *s. Fix from Chet Ramey.
only for ?s, not for *s. Fix from Chet Ramey.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 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
terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
this program. If not, see <http://www.gnu.org/licenses/>.

View File

@@ -1,19 +1,20 @@
# -*-Makefile-*-, or close enough
# Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# 2003, 2004, 2005, 2006, 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
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2, or (at your option) any later version.
# 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.
# 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
# GNU Make; see the file COPYING. If not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
# this program. If not, see <http://www.gnu.org/licenses/>.
AUTOMAKE_OPTIONS = foreign

View File

@@ -1,19 +1,20 @@
# Makefile for standalone libglob.a (fnmatch, glob). -*-Makefile-*-
# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006 Free Software Foundation, Inc.
# 2005, 2006, 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
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2, or (at your option) any later version.
# 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.
# 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
# GNU Make; see the file COPYING. If not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
# this program. If not, see <http://www.gnu.org/licenses/>.
# Ultrix 2.2 make doesn't expand the value of VPATH.
VPATH = /glob/

View File

@@ -1,19 +1,20 @@
# Makefile for standalone distribution of libglob.a (fnmatch, glob).
# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006 Free Software Foundation, Inc.
# 2005, 2006, 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
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2, or (at your option) any later version.
# 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.
# 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
# GNU Make; see the file COPYING. If not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
# this program. If not, see <http://www.gnu.org/licenses/>.
# Ultrix 2.2 make doesn't expand the value of VPATH.
VPATH = /glob/

View File

@@ -1,21 +1,20 @@
@echo off
rem Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
rem 2004, 2005, 2006 Free Software Foundation, Inc.
rem 2004, 2005, 2006, 2007 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
rem the terms of the GNU General Public License as published by the Free
rem Software Foundation; either version 2, or (at your option) any later
rem version.
rem Software Foundation; either version 3 of the License, or (at your option)
rem any later version.
rem
rem GNU Make is distributed in the hope that it will be useful, but WITHOUT
rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
rem more details.
rem
rem You should have received a copy of the GNU General Public License along
rem with GNU Make; see the file COPYING. If not, write to the Free Software
rem Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
rem with this program. If not, see <http://www.gnu.org/licenses/>.
echo Configuring glob for DJGPP
rem This batch file assumes a unix-type "sed" program

View File

@@ -1,4 +1,5 @@
/* Copyright (C) 1991, 92, 93, 96, 97, 98, 99 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
This library is free software; you can redistribute it and/or

View File

@@ -1,4 +1,5 @@
/* Copyright (C) 1991, 92, 93, 96, 97, 98, 99 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1992, 1993, 1996, 1997, 1998, 1999 Free Software
Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or

View File

@@ -1,4 +1,5 @@
/* Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999 Free
Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
@@ -181,7 +182,7 @@ extern void bcopy ();
# define mempcpy(Dest, Src, Len) __mempcpy (Dest, Src, Len)
#endif
#ifndef __GNU_LIBRARY__
#if !defined __GNU_LIBRARY__ && !defined __DJGPP__
# ifdef __GNUC__
__inline
# endif
@@ -194,7 +195,7 @@ static char *
my_realloc (p, n)
char *p;
unsigned int n;
# endif
# endif
{
/* These casts are the for sake of the broken Ultrix compiler,
which warns of illegal pointer combinations otherwise. */
@@ -204,7 +205,7 @@ my_realloc (p, n)
}
# define realloc my_realloc
# endif /* __SASC */
#endif /* __GNU_LIBRARY__ */
#endif /* __GNU_LIBRARY__ || __DJGPP__ */
#if !defined __alloca && !defined __GNU_LIBRARY__

View File

@@ -1,4 +1,5 @@
/* Copyright (C) 1991, 92, 95, 96, 97, 98 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1992, 1995, 1996, 1997, 1998 Free Software Foundation,
Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as

28
hash.c
View File

@@ -1,20 +1,18 @@
/* hash.c -- hash table maintenance
Copyright (C) 1995, 1999, 2002 Free Software Foundation, Inc.
Written by Greg McGary <gkm@gnu.org> <greg@mcgary.org>
Copyright (C) 1995, 1999, 2002, 2010 Free Software Foundation, Inc.
Written by Greg McGary <gkm@gnu.org> <greg@mcgary.org>
This program 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 2, or (at your option)
any later version.
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.
This program 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.
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; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
#include "make.h"
#include "hash.h"
@@ -48,8 +46,8 @@ hash_init (struct hash_table *ht, unsigned long size,
ht->ht_vec = (void**) CALLOC (struct token *, ht->ht_size);
if (ht->ht_vec == 0)
{
fprintf (stderr, _("can't allocate %ld bytes for hash table: memory exhausted"),
ht->ht_size * sizeof(struct token *));
fprintf (stderr, _("can't allocate %lu bytes for hash table: memory exhausted"),
ht->ht_size * (unsigned long) sizeof (struct token *));
exit (1);
}
@@ -128,7 +126,7 @@ void *
hash_insert (struct hash_table *ht, const void *item)
{
void **slot = hash_find_slot (ht, item);
const void *old_item = slot ? *slot : 0;
const void *old_item = *slot;
hash_insert_at (ht, item, slot);
return (void *)((HASH_VACANT (old_item)) ? 0 : old_item);
}

35
hash.h
View File

@@ -1,20 +1,18 @@
/* hash.h -- decls for hash table
Copyright (C) 1995, 1999, 2002 Free Software Foundation, Inc.
Copyright (C) 1995, 1999, 2002, 2010 Free Software Foundation, Inc.
Written by Greg McGary <gkm@gnu.org> <greg@mcgary.org>
This program 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 2, or (at your option)
any later version.
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.
This program 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.
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; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef _hash_h_
#define _hash_h_
@@ -81,6 +79,9 @@ extern void *hash_deleted_item;
/* hash and comparison macros for case-sensitive string keys. */
/* Due to the strcache, it's not uncommon for the string pointers to
be identical. Take advantage of that to short-circuit string compares. */
#define STRING_HASH_1(KEY, RESULT) do { \
unsigned char const *_key_ = (unsigned char const *) (KEY) - 1; \
while (*++_key_) \
@@ -104,10 +105,10 @@ extern void *hash_deleted_item;
} while (0)
#define STRING_COMPARE(X, Y, RESULT) do { \
RESULT = strcmp ((X), (Y)); \
RESULT = (X) == (Y) ? 0 : strcmp ((X), (Y)); \
} while (0)
#define return_STRING_COMPARE(X, Y) do { \
return strcmp ((X), (Y)); \
return (X) == (Y) ? 0 : strcmp ((X), (Y)); \
} while (0)
@@ -140,10 +141,10 @@ extern void *hash_deleted_item;
} while (0)
#define STRING_N_COMPARE(X, Y, N, RESULT) do { \
RESULT = strncmp ((X), (Y), (N)); \
RESULT = (X) == (Y) ? 0 : strncmp ((X), (Y), (N)); \
} while (0)
#define return_STRING_N_COMPARE(X, Y, N) do { \
return strncmp ((X), (Y), (N)); \
return (X) == (Y) ? 0 : strncmp ((X), (Y), (N)); \
} while (0)
#ifdef HAVE_CASE_INSENSITIVE_FS
@@ -173,10 +174,10 @@ extern void *hash_deleted_item;
} while (0)
#define ISTRING_COMPARE(X, Y, RESULT) do { \
RESULT = strcmpi ((X), (Y)); \
RESULT = (X) == (Y) ? 0 : strcasecmp ((X), (Y)); \
} while (0)
#define return_ISTRING_COMPARE(X, Y) do { \
return strcmpi ((X), (Y)); \
return (X) == (Y) ? 0 : strcasecmp ((X), (Y)); \
} while (0)
#else

1189
implicit.c

File diff suppressed because it is too large Load Diff

502
job.c

File diff suppressed because it is too large Load Diff

36
job.h
View File

@@ -1,19 +1,20 @@
/* Definitions for managing subprocesses in GNU Make.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef SEEN_JOB_H
#define SEEN_JOB_H
@@ -53,6 +54,7 @@ struct child
#ifdef VMS
int efn; /* Completion event flag number */
int cstatus; /* Completion status */
char *comname; /* Temporary command file name */
#endif
char *sh_batch_file; /* Script file for shell commands */
unsigned int remote:1; /* Nonzero if executing remotely. */
@@ -66,31 +68,33 @@ struct child
extern struct child *children;
extern void new_job PARAMS ((struct file *file));
extern void reap_children PARAMS ((int block, int err));
extern void start_waiting_jobs PARAMS ((void));
int is_bourne_compatible_shell(const char *path);
void new_job (struct file *file);
void reap_children (int block, int err);
void start_waiting_jobs (void);
extern char **construct_command_argv PARAMS ((char *line, char **restp, struct file *file, char** batch_file));
char **construct_command_argv (char *line, char **restp, struct file *file,
int cmd_flags, char** batch_file);
#ifdef VMS
extern int child_execute_job PARAMS ((char *argv, struct child *child));
int child_execute_job (char *argv, struct child *child);
#elif defined(__EMX__)
extern int child_execute_job PARAMS ((int stdin_fd, int stdout_fd, char **argv, char **envp));
int child_execute_job (int stdin_fd, int stdout_fd, char **argv, char **envp);
#else
extern void child_execute_job PARAMS ((int stdin_fd, int stdout_fd, char **argv, char **envp));
void child_execute_job (int stdin_fd, int stdout_fd, char **argv, char **envp);
#endif
#ifdef _AMIGA
extern void exec_command PARAMS ((char **argv));
void exec_command (char **argv);
#elif defined(__EMX__)
extern int exec_command PARAMS ((char **argv, char **envp));
int exec_command (char **argv, char **envp);
#else
extern void exec_command PARAMS ((char **argv, char **envp));
void exec_command (char **argv, char **envp);
#endif
extern unsigned int job_slots_used;
extern void block_sigs PARAMS ((void));
void block_sigs (void);
#ifdef POSIX
extern void unblock_sigs PARAMS ((void));
void unblock_sigs (void);
#else
#ifdef HAVE_SIGSETMASK
extern int fatal_signal_mask;

1124
main.c

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,10 @@
# tree, not a dist copy.
# We like mondo-warnings!
AM_CFLAGS += -Wall -W
AM_CFLAGS += -Wall -Wextra -Wdeclaration-after-statement -Wshadow -Wpointer-arith -Wbad-function-cast
# I want this one but I have to wait for the const cleanup!
# -Wwrite-strings
# Find the glob source files... this might be dangerous, but we're maintainers!
globsrc := $(wildcard glob/*.c)
@@ -88,11 +91,12 @@ CVS-CLEAN-FILES += $(maintFILES) $(TEMPLATES) $(MTEMPLATES) NMakefile \
# This rule tries to clean the tree right down to how it looks when you do a
# virgin CVS checkout.
# This 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. Stil...
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";'
# 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
@@ -131,7 +135,7 @@ move_if_change = if test -r $(target) && cmp -s $(target).t $(target); then \
# http://translation.sf.net/maint/
# ftp://tiger.informatik.hu-berlin.de/pub/po/maint/
po_repo = http://www.iro.umontreal.ca/translation/maint/$(PACKAGE)
po_repo = http://translationproject.org/latest/$(PACKAGE)
.PHONY: do-po-update po-update
do-po-update:
tmppo="/tmp/po-$(PACKAGE)-$(VERSION).$$$$" \
@@ -139,14 +143,12 @@ do-po-update:
&& mkdir "$$tmppo" \
&& (cd "$$tmppo" \
&& $(WGET) -r -l1 -nd --no-parent -A '*.po' $(po_repo)) \
&& cp "$$tmppo"/*.po po && rm -rf "$$tmppo"
&& cp "$$tmppo"/*.po $(top_srcdir)/po && rm -rf "$$tmppo"
cd po && $(MAKE) update-po
$(MAKE) po-check
po-update:
if test -d "po"; then \
$(MAKE) do-po-update; \
fi
[ -d "po" ] && $(MAKE) do-po-update
# -------------------------- #
# Updating GNU build files. #
@@ -156,29 +158,30 @@ po-update:
# with each of the files that belongs to some other package and is
# regularly updated from the specified URL.
savannah-url = http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~
cvs-url = http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~
git-url = http://git.savannah.gnu.org/cgit
target = $(patsubst get-%,%,$@)
config-url = $(savannah-url)/config/config/$(patsubst get-config/%,%,$@)
config-url = $(git-url)/config.git/plain/$(patsubst get-config/%,%,$@)
get-config/config.guess get-config/config.sub:
@echo $(WGET) $(config-url) -O $(target) \
&& $(WGET) $(config-url) -O $(target).t \
&& $(move_if_change)
gnulib-url = $(savannah-url)/gnulib/gnulib/build-aux/$(patsubst get-config/%,%,$@)
gnulib-url = $(git-url)/gnulib.git/plain/build-aux/$(patsubst get-config/%,%,$@)
get-config/texinfo.tex:
@echo $(WGET) $(gnulib-url) -O $(target) \
&& $(WGET) $(gnulib-url) -O $(target).t \
&& $(move_if_change)
gnustandards-url = $(savannah-url)/gnustandards/gnustandards/$(patsubst get-doc/%,%,$@)
gnustandards-url = $(cvs-url)/gnustandards/gnustandards/$(patsubst get-doc/%,%,$@)
get-doc/make-stds.texi get-doc/fdl.texi:
@echo $(WGET) $(gnustandards-url) -O $(target) \
&& $(WGET) $(gnustandards-url) -O $(target).t \
&& $(move_if_change)
.PHONY: cvs-update
cvs-update: get-config/texinfo.tex get-config/config.guess get-config/config.sub get-doc/make-stds.texi get-doc/fdl.texi
.PHONY: scm-update
scm-update: get-config/texinfo.tex get-config/config.guess get-config/config.sub get-doc/make-stds.texi get-doc/fdl.texi
# --------------------- #
@@ -186,7 +189,7 @@ cvs-update: get-config/texinfo.tex get-config/config.guess get-config/config.sub
# --------------------- #
.PHONY: update
update: po-update cvs-update
update: po-update scm-update
## --------------- ##
@@ -200,7 +203,7 @@ local-check: po-check changelog-check
# copyright-check writable-files
changelog-check:
if head ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
if head $(top_srcdir)/ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
:; \
else \
echo "$(VERSION) not in ChangeLog" 1>&2; \
@@ -211,8 +214,8 @@ changelog-check:
# Ignore make.h; it defines _().
po-check:
if test -f po/POTFILES.in; then \
grep -E -v '^(#|$$)' po/POTFILES.in | sort > $@-1; \
grep -E -l '\b_\(' *.c *.h | grep -v make.h | sort > $@-2; \
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; \
diff -u $@-1 $@-2 || exit 1; \
rm -f $@-1 $@-2; \
fi
@@ -222,7 +225,8 @@ po-check:
## ------------------------- ##
# This target creates the upload artifacts.
# Sign it with my key.
# Sign it with my key. If you don't have my key/passphrase then sorry,
# you're SOL! :)
GPG = gpg
GPGFLAGS = -u 6338B6D4
@@ -230,45 +234,51 @@ GPGFLAGS = -u 6338B6D4
DIST_ARCHIVES_SIG = $(addsuffix .sig,$(DIST_ARCHIVES))
DIST_ARCHIVES_DIRECTIVE = $(addsuffix .directive.asc,$(DIST_ARCHIVES))
# A simple rule to test signing, etc.
.PHONY: distsign
distsign: $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
$(DIST_ARCHIVES_DIRECTIVE): .directive.asc
cp $< $@
%.sig : %
@echo "Signing file '$<':"
$(GPG) $(GPGFLAGS) -o $@ -b $<
$(GPG) $(GPGFLAGS) -o "$@" -b "$<"
.directive.asc:
%.directive.asc: %
@echo "Creating directive file '$@':"
@echo 'directory: make' > .directive
$(GPG) $(GPGFLAGS) -o $@ --clearsign .directive
@rm -f .directive
@( \
echo 'version: 1.1'; \
echo 'directory: make'; \
echo 'filename: $*'; \
echo 'comment: Official upload of GNU make version $(VERSION)'; \
) > "$*.directive"
$(GPG) $(GPGFLAGS) -o "$@" --clearsign "$*.directive"
@rm -f "$*.directive"
# Upload the artifacts
FTPPUT = ncftpput
gnu-url = ftp-upload.gnu.org /incoming
gnu-upload-host = ftp-upload.gnu.org
gnu-upload-dir = /incoming
UPLOADS = upload-alpha upload-ftp
.PHONY: $(UPLOADS)
$(UPLOADS): $(DIST_ARCHIVES) $(DIST_ARCHIVES_SIG) $(DIST_ARCHIVES_DIRECTIVE)
$(FTPPUT) $(gnu-url)/$(@:upload-%=%) $^
$(FTPPUT) "$(gnu-upload-host)" "$(gnu-upload-dir)/$(@:upload-%=%)" $^
# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc.
# Copyright (C) 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 2, or (at your option) any later version.
# 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.
# 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
# GNU Make; see the file COPYING. If not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
# this program. If not, see <http://www.gnu.org/licenses/>.

32
make.1
View File

@@ -164,7 +164,7 @@ for debugging while remaking makefiles.
Give variables taken from the environment precedence
over variables from makefiles.
.TP 0.5i
+\fB\-f\fR \fIfile\fR, \fB\-\-file\fR=\fIfile\fR, \fB\-\-makefile\fR=\fIFILE\fR
\fB\-f\fR \fIfile\fR, \fB\-\-file\fR=\fIfile\fR, \fB\-\-makefile\fR=\fIFILE\fR
Use
.I file
as a makefile.
@@ -223,7 +223,8 @@ With no argument, removes a previous load limit.
Use the latest mtime between symlinks and target.
.TP 0.5i
.BR \-n , " \-\-just\-print" , " \-\-dry\-run" , " \-\-recon"
Print the commands that would be executed, but do not execute them.
Print the commands that would be executed, but do not execute them (except in
certain circumstances).
.TP 0.5i
\fB\-o\fR \fIfile\fR, \fB\-\-old\-file\fR=\fIfile\fR, \fB\-\-assume\-old\fR=\fIfile\fR
Do not remake the file
@@ -340,26 +341,19 @@ This manual page contributed by Dennis Morse of Stanford University.
It has been reworked by Roland McGrath. Further updates contributed by
Mike Frysinger.
.SH "COPYRIGHT"
Copyright (C) 1992, 1993, 1996, 1999 Free Software Foundation, Inc.
Copyright (C) 1992, 1993, 1996, 1999, 2007 Free Software Foundation, Inc.
This file is part of GNU
.IR make .
.LP
GNU
.I 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 2, or (at your option) any later
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.
.LP
GNU
.I 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.
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.
.LP
You should have received a copy of the GNU General Public License
along with GNU
.IR make ;
see the file COPYING. If not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
You should have received a copy of the GNU General Public License along with
this program. If not, see
.IR http://www.gnu.org/licenses/ .

328
make.h
View File

@@ -1,20 +1,20 @@
/* 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 Free Software
Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
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
@@ -23,14 +23,19 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
#undef HAVE_CONFIG_H
#define HAVE_CONFIG_H 1
/* Specify we want GNU source code. This must be defined before any
system headers are included. */
#define _GNU_SOURCE 1
/* AIX requires this to be the first thing in the file. */
#ifndef __GNUC__
# if HAVE_ALLOCA_H
# include <alloca.h>
# else
# ifdef _AIX
#if HAVE_ALLOCA_H
# include <alloca.h>
#else
# ifdef _AIX
#pragma alloca
# else
# else
# if !defined(__GNUC__) && !defined(WINDOWS32)
# ifndef alloca /* predefined by HP cc +Olibcalls */
char *alloca ();
# endif
@@ -39,21 +44,6 @@ char *alloca ();
#endif
/* Use prototypes if available. */
#if defined (__cplusplus) || defined (__STDC__)
# undef PARAMS
# define PARAMS(protos) protos
#else /* Not C++ or ANSI C. */
# undef PARAMS
# define PARAMS(protos) ()
#endif /* C++ or ANSI C. */
/* Specify we want GNU source code. This must be defined before any
system headers are included. */
#define _GNU_SOURCE 1
#ifdef CRAY
/* This must happen before #include <signal.h> so
that the declaration therein is changed. */
@@ -150,8 +140,8 @@ extern int errno;
#else
# define NEED_GET_PATH_MAX 1
# define GET_PATH_MAX (get_path_max ())
# define PATH_VAR(var) char *var = (char *) alloca (GET_PATH_MAX)
extern unsigned int get_path_max PARAMS ((void));
# define PATH_VAR(var) char *var = alloca (GET_PATH_MAX)
unsigned int get_path_max (void);
#endif
#ifndef CHAR_BIT
@@ -227,12 +217,12 @@ extern unsigned int get_path_max PARAMS ((void));
# ifdef HAVE_STDLIB_H
# include <stdlib.h>
# else
extern char *malloc PARAMS ((int));
extern char *realloc PARAMS ((char *, int));
extern void free PARAMS ((char *));
void *malloc (int);
void *realloc (void *, int);
void free (void *);
extern void abort PARAMS ((void)) __attribute__ ((noreturn));
extern void exit PARAMS ((int)) __attribute__ ((noreturn));
void abort (void) __attribute__ ((noreturn));
void exit (int) __attribute__ ((noreturn));
# endif /* HAVE_STDLIB_H. */
#endif /* Standard headers. */
@@ -242,42 +232,15 @@ extern void exit PARAMS ((int)) __attribute__ ((noreturn));
# define EXIT_SUCCESS 0
#endif
#ifndef EXIT_FAILURE
# define EXIT_FAILURE 0
# define EXIT_FAILURE 1
#endif
#ifdef ANSI_STRING
# ifndef bcmp
# define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
# endif
# ifndef bzero
# define bzero(s, n) memset ((s), 0, (n))
# endif
# if defined(HAVE_MEMMOVE) && !defined(bcopy)
# define bcopy(s, d, n) memmove ((d), (s), (n))
# endif
#else /* Not ANSI_STRING. */
# ifndef HAVE_STRCHR
# define strchr(s, c) index((s), (c))
# define strrchr(s, c) rindex((s), (c))
# endif
# ifndef bcmp
extern int bcmp PARAMS ((const char *, const char *, int));
# endif
# ifndef bzero
extern void bzero PARAMS ((char *, int));
#endif
# ifndef bcopy
extern void bcopy PARAMS ((const char *b1, char *b2, int));
# endif
#ifndef ANSI_STRING
/* SCO Xenix has a buggy macro definition in <string.h>. */
#undef strerror
#if !defined(__DECC)
extern char *strerror PARAMS ((int errnum));
char *strerror (int errnum);
#endif
#endif /* !ANSI_STRING. */
@@ -289,7 +252,7 @@ extern char *strerror PARAMS ((int errnum));
#define FILE_TIMESTAMP uintmax_t
#if !defined(HAVE_STRSIGNAL)
extern char *strsignal PARAMS ((int signum));
char *strsignal (int signum);
#endif
/* ISDIGIT offers the following features:
@@ -303,28 +266,24 @@ extern char *strsignal PARAMS ((int signum));
host does not conform to POSIX. */
#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
#ifndef iAPX286
# define streq(a, b) \
/* Test if two strings are equal. Is this worthwhile? Should be profiled. */
#define streq(a, b) \
((a) == (b) || \
(*(a) == *(b) && (*(a) == '\0' || !strcmp ((a) + 1, (b) + 1))))
# ifdef HAVE_CASE_INSENSITIVE_FS
/* This is only used on Windows/DOS platforms, so we assume strcmpi(). */
# define strieq(a, b) \
/* Test if two strings are equal, but match case-insensitively on systems
which have case-insensitive filesystems. Should only be used for
filenames! */
#ifdef HAVE_CASE_INSENSITIVE_FS
# define patheq(a, b) \
((a) == (b) \
|| (tolower((unsigned char)*(a)) == tolower((unsigned char)*(b)) \
&& (*(a) == '\0' || !strcmpi ((a) + 1, (b) + 1))))
# else
# define strieq(a, b) streq(a, b)
# endif
&& (*(a) == '\0' || !strcasecmp ((a) + 1, (b) + 1))))
#else
/* Buggy compiler can't handle this. */
# define streq(a, b) (strcmp ((a), (b)) == 0)
# define strieq(a, b) (strcmp ((a), (b)) == 0)
# define patheq(a, b) streq(a, b)
#endif
#define strneq(a, b, l) (strncmp ((a), (b), (l)) == 0)
#ifdef VMS
extern int strcmpi (const char *,const char *);
#endif
#if defined(__GNUC__) || defined(ENUM_BITFIELDS)
# define ENUM_BITFIELD(bits) :bits
@@ -347,29 +306,31 @@ extern int strcmpi (const char *,const char *);
#define S_(msg1,msg2,num) ngettext (msg1,msg2,num)
/* Handle other OSs. */
#if defined(HAVE_DOS_PATHS)
# define PATH_SEPARATOR_CHAR ';'
#elif defined(VMS)
# define PATH_SEPARATOR_CHAR ','
#else
# define PATH_SEPARATOR_CHAR ':'
#ifndef PATH_SEPARATOR_CHAR
# if defined(HAVE_DOS_PATHS)
# define PATH_SEPARATOR_CHAR ';'
# elif defined(VMS)
# define PATH_SEPARATOR_CHAR ','
# else
# define PATH_SEPARATOR_CHAR ':'
# endif
#endif
/* This is needed for getcwd() and chdir(). */
#if defined(_MSC_VER) || defined(__BORLANDC__)
/* This is needed for getcwd() and chdir(), on some W32 systems. */
#if defined(HAVE_DIRECT_H)
# include <direct.h>
#endif
#ifdef WINDOWS32
# include <fcntl.h>
# include <malloc.h>
# define pipe(p) _pipe(p, 512, O_BINARY)
# define kill(pid,sig) w32_kill(pid,sig)
# define pipe(_p) _pipe((_p), 512, O_BINARY)
# define kill(_pid,_sig) w32_kill((_pid),(_sig))
extern void sync_Path_environment(void);
extern int kill(int pid, int sig);
extern char *end_of_token_w32(char *s, char stopchar);
extern int find_and_set_default_shell(char *token);
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 */
extern int no_default_sh_exe;
@@ -378,6 +339,14 @@ extern int no_default_sh_exe;
extern int unixy_shell;
#endif /* WINDOWS32 */
#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;
#endif
struct floc
{
const char *filenm;
@@ -398,78 +367,93 @@ struct floc
#endif
#if HAVE_ANSI_COMPILER && USE_VARIADIC && HAVE_STDARG_H
extern void message (int prefix, const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
extern void error (const struct floc *flocp, const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
extern void fatal (const struct floc *flocp, const char *fmt, ...)
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, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
void fatal (const struct floc *flocp, const char *fmt, ...)
__attribute__ ((noreturn, __format__ (__printf__, 2, 3)));
#else
extern void message ();
extern void error ();
extern void fatal ();
const char *concat ();
void message ();
void error ();
void fatal ();
#endif
extern void die PARAMS ((int)) __attribute__ ((noreturn));
extern void log_working_directory PARAMS ((int));
extern void pfatal_with_name PARAMS ((const char *)) __attribute__ ((noreturn));
extern void perror_with_name PARAMS ((const char *, const char *));
extern char *savestring PARAMS ((const char *, unsigned int));
extern char *concat PARAMS ((const char *, const char *, const char *));
extern char *xmalloc PARAMS ((unsigned int));
extern char *xrealloc PARAMS ((char *, unsigned int));
extern char *xstrdup PARAMS ((const char *));
extern char *find_next_token PARAMS ((char **, unsigned int *));
extern char *next_token PARAMS ((const char *));
extern char *end_of_token PARAMS ((const char *));
extern void collapse_continuations PARAMS ((char *));
extern char *lindex PARAMS ((const char *, const char *, int));
extern int alpha_compare PARAMS ((const void *, const void *));
extern void print_spaces PARAMS ((unsigned int));
extern char *find_percent PARAMS ((char *));
extern FILE *open_tmpfile PARAMS ((char **, const char *));
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 *);
void *xmalloc (unsigned int);
void *xcalloc (unsigned int);
void *xrealloc (void *, unsigned int);
char *xstrdup (const char *);
char *xstrndup (const char *, unsigned int);
char *find_next_token (const char **, unsigned int *);
char *next_token (const char *);
char *end_of_token (const char *);
void collapse_continuations (char *);
char *lindex (const char *, const char *, int);
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
extern int ar_name PARAMS ((char *));
extern void ar_parse_name PARAMS ((char *, char **, char **));
extern int ar_touch PARAMS ((char *));
extern time_t ar_member_date PARAMS ((char *));
int ar_name (const char *);
void ar_parse_name (const char *, char **, char **);
int ar_touch (const char *);
time_t ar_member_date (const char *);
typedef long int (*ar_member_func_t) (int desc, const char *mem, int truncated,
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);
#ifndef VMS
int ar_member_touch (const char *arname, const char *memname);
#endif
#endif
extern int dir_file_exists_p PARAMS ((char *, char *));
extern int file_exists_p PARAMS ((char *));
extern int file_impossible_p PARAMS ((char *));
extern void file_impossible PARAMS ((char *));
extern char *dir_name PARAMS ((char *));
extern void hash_init_directories PARAMS ((void));
int dir_file_exists_p (const char *, const char *);
int file_exists_p (const char *);
int file_impossible_p (const char *);
void file_impossible (const char *);
const char *dir_name (const char *);
void hash_init_directories (void);
extern void define_default_variables PARAMS ((void));
extern void set_default_suffixes PARAMS ((void));
extern void install_default_suffix_rules PARAMS ((void));
extern void install_default_implicit_rules PARAMS ((void));
void define_default_variables (void);
void set_default_suffixes (void);
void install_default_suffix_rules (void);
void install_default_implicit_rules (void);
extern void build_vpath_lists PARAMS ((void));
extern void construct_vpath_list PARAMS ((char *pattern, char *dirpath));
extern int vpath_search PARAMS ((char **file, FILE_TIMESTAMP *mtime_ptr));
extern int gpath_search PARAMS ((char *file, unsigned int len));
void build_vpath_lists (void);
void construct_vpath_list (char *pattern, char *dirpath);
const char *vpath_search (const char *file, FILE_TIMESTAMP *mtime_ptr,
unsigned int* vpath_index, unsigned int* path_index);
int gpath_search (const char *file, unsigned int len);
extern void construct_include_path PARAMS ((char **arg_dirs));
void construct_include_path (const char **arg_dirs);
extern void user_access PARAMS ((void));
extern void make_access PARAMS ((void));
extern void child_access PARAMS ((void));
void user_access (void);
void make_access (void);
void child_access (void);
extern void close_stdout PARAMS ((void));
void close_stdout (void);
extern char *strip_whitespace PARAMS ((const char **begpp, const char **endpp));
char *strip_whitespace (const char **begpp, const char **endpp);
/* String caching */
extern void strcache_init PARAMS ((void));
extern void strcache_print_stats PARAMS ((const char *prefix));
extern int strcache_iscached PARAMS ((const char *str));
extern const char *strcache_add PARAMS ((const char *str));
extern const char *strcache_add_len PARAMS ((const char *str, int len));
extern int strcache_setbufsize PARAMS ((int size));
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);
#ifdef HAVE_VFORK_H
# include <vfork.h>
@@ -480,22 +464,44 @@ extern int strcache_setbufsize PARAMS ((int size));
#if !defined (__GNU_LIBRARY__) && !defined (POSIX) && !defined (_POSIX_VERSION) && !defined(WINDOWS32)
extern long int atol ();
long int atol ();
# ifndef VMS
extern long int lseek ();
long int lseek ();
# endif
#endif /* Not GNU C library or POSIX. */
#ifdef HAVE_GETCWD
# if !defined(VMS) && !defined(__DECC)
extern char *getcwd ();
char *getcwd ();
# endif
#else
extern char *getwd ();
char *getwd ();
# define getcwd(buf, len) getwd (buf)
#endif
#if !HAVE_STRCASECMP
# if HAVE_STRICMP
# define strcasecmp stricmp
# elif HAVE_STRCMPI
# define strcasecmp strcmpi
# else
/* Create our own, in misc.c */
int strcasecmp (const char *s1, const char *s2);
# endif
#endif
#if !HAVE_STRNCASECMP
# if HAVE_STRNICMP
# define strncasecmp strnicmp
# elif HAVE_STRNCMPI
# define strncasecmp strncmpi
# else
/* Create our own, in misc.c */
int strncasecmp (const char *s1, const char *s2, int n);
# endif
#endif
extern const struct floc *reading_file;
extern const struct floc **expanding_var;
@@ -507,10 +513,16 @@ 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;
/* can we run commands via 'sh -c xxx' or must we use batch files? */
extern int batch_mode_shell;
/* Resetting the command script introduction prefix character. */
#define RECIPEPREFIX_NAME ".RECIPEPREFIX"
#define RECIPEPREFIX_DEFAULT '\t'
extern char cmd_prefix;
extern unsigned int job_slots;
extern int job_fds[2];
extern int job_rfd;
@@ -562,12 +574,7 @@ extern int handling_fatal_signal;
# endif
#endif
#ifdef __EMX__
# if !HAVE_STRCASECMP
# define strcasecmp stricmp
# endif
# if !defined chdir
# define chdir _chdir2
# endif
@@ -606,6 +613,5 @@ extern int handling_fatal_signal;
NULL at the end of the directory--and _doesn't_ reset errno. So, we have
to do it ourselves here. */
#define ENULLLOOP(_v,_c) do{ errno = 0; \
while (((_v)=_c)==0 && errno==EINTR); }while(0)
#define ENULLLOOP(_v,_c) do { errno = 0; (_v) = _c; } \
while((_v)==0 && errno==EINTR)

View File

@@ -139,17 +139,18 @@ $ endsubroutine : compileit
$!
$!-----------------------------------------------------------------------------
$!Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
$!2006 Free Software Foundation, Inc.
$!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 2, or (at your option) any later version.
$!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.
$!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
$!GNU Make; see the file COPYING. If not, write to the Free Software
$!Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
$!this program. If not, see <http://www.gnu.org/licenses/>.

View File

@@ -1,20 +1,21 @@
# -*-Makefile-*- to build GNU make on VMS
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
# 2006 Free Software Foundation, Inc.
# 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 2, or (at your option) any later version.
# 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.
# 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
# GNU Make; see the file COPYING. If not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
# this program. If not, see <http://www.gnu.org/licenses/>.
# VMS extensions from GNU Make 3.60 imported by
# Klaus Kämpf (kkaempf@rmi.de)

274
misc.c
View File

@@ -1,20 +1,20 @@
/* 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 Free Software
Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
#include "make.h"
#include "dep.h"
@@ -112,11 +112,13 @@ collapse_continuations (char *line)
/* Skip the newline. */
++in;
/* If the newline is quoted, discard following whitespace
and any preceding whitespace; leave just one space. */
/* 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++ = ' ';
@@ -158,28 +160,57 @@ print_spaces (unsigned int n)
}
/* Return a newly-allocated string whose contents
concatenate those of s1, s2, s3. */
/* Return a string whose contents concatenate the NUM strings provided
This string lives in static, re-used memory. */
char *
concat (const char *s1, const char *s2, const char *s3)
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
{
unsigned int len1, len2, len3;
char *result;
static unsigned int rlen = 0;
static char *result = NULL;
int ri = 0;
len1 = *s1 != '\0' ? strlen (s1) : 0;
len2 = *s2 != '\0' ? strlen (s2) : 0;
len3 = *s3 != '\0' ? strlen (s3) : 0;
#if USE_VARIADIC
va_list args;
#endif
result = (char *) xmalloc (len1 + len2 + len3 + 1);
VA_START (args, num);
if (*s1 != '\0')
bcopy (s1, result, len1);
if (*s2 != '\0')
bcopy (s2, result + len1, len2);
if (*s3 != '\0')
bcopy (s3, result + len1 + len2, len3);
*(result + len1 + len2 + len3) = '\0';
while (num-- > 0)
{
const char *s = va_arg (args, const char *);
unsigned int l = s ? strlen (s) : 0;
if (l == 0)
continue;
if (ri + l > rlen)
{
rlen = ((rlen ? rlen : 60) + l) * 2;
result = xrealloc (result, rlen);
}
memcpy (result + ri, s, l);
ri += l;
}
VA_END (args);
/* Get some more memory if we don't have enough space for the
terminating '\0'. */
if (ri == rlen)
{
rlen = (rlen ? rlen : 60) * 2;
result = xrealloc (result, rlen);
}
result[ri] = '\0';
return result;
}
@@ -332,26 +363,38 @@ pfatal_with_name (const char *name)
#ifndef HAVE_DMALLOC_H
#undef xmalloc
#undef xcalloc
#undef xrealloc
#undef xstrdup
char *
void *
xmalloc (unsigned int size)
{
/* Make sure we don't allocate 0, for pre-ANSI libraries. */
char *result = (char *) malloc (size ? size : 1);
/* Make sure we don't allocate 0, for pre-ISO implementations. */
void *result = malloc (size ? size : 1);
if (result == 0)
fatal (NILF, _("virtual memory exhausted"));
return result;
}
char *
xrealloc (char *ptr, unsigned int size)
void *
xcalloc (unsigned int size)
{
char *result;
/* Make sure we don't allocate 0, for pre-ISO implementations. */
void *result = calloc (size ? size : 1, 1);
if (result == 0)
fatal (NILF, _("virtual memory exhausted"));
return result;
}
/* Some older implementations of realloc() don't conform to ANSI. */
void *
xrealloc (void *ptr, unsigned int size)
{
void *result;
/* Some older implementations of realloc() don't conform to ISO. */
if (! size)
size = 1;
result = ptr ? realloc (ptr, size) : malloc (size);
@@ -369,7 +412,7 @@ xstrdup (const char *ptr)
#ifdef HAVE_STRDUP
result = strdup (ptr);
#else
result = (char *) malloc (strlen (ptr) + 1);
result = malloc (strlen (ptr) + 1);
#endif
if (result == 0)
@@ -378,20 +421,29 @@ xstrdup (const char *ptr)
#ifdef HAVE_STRDUP
return result;
#else
return strcpy(result, ptr);
return strcpy (result, ptr);
#endif
}
#endif /* HAVE_DMALLOC_H */
char *
savestring (const char *str, unsigned int length)
xstrndup (const char *str, unsigned int length)
{
register char *out = (char *) xmalloc (length + 1);
char *result;
#ifdef HAVE_STRNDUP
result = strndup (str, length);
if (result == 0)
fatal (NILF, _("virtual memory exhausted"));
#else
result = xmalloc (length + 1);
if (length > 0)
bcopy (str, out, length);
out[length] = '\0';
return out;
strncpy (result, str, length);
result[length] = '\0';
#endif
return result;
}
@@ -426,10 +478,10 @@ end_of_token (const char *s)
* Same as end_of_token, but take into account a stop character
*/
char *
end_of_token_w32 (char *s, char stopchar)
end_of_token_w32 (const char *s, char stopchar)
{
register char *p = s;
register int backslash = 0;
const char *p = s;
int backslash = 0;
while (*p != '\0' && *p != stopchar
&& (backslash || !isblank ((unsigned char)*p)))
@@ -447,7 +499,7 @@ end_of_token_w32 (char *s, char stopchar)
backslash = 0;
}
return p;
return (char *)p;
}
#endif
@@ -461,69 +513,41 @@ next_token (const char *s)
return (char *)s;
}
/* Find the next token in PTR; return the address of it, and store the
length of the token into *LENGTHPTR if LENGTHPTR is not nil. */
/* Find the next token in PTR; return the address of it, and store the length
of the token into *LENGTHPTR if LENGTHPTR is not nil. Set *PTR to the end
of the token, so this function can be called repeatedly in a loop. */
char *
find_next_token (char **ptr, unsigned int *lengthptr)
find_next_token (const char **ptr, unsigned int *lengthptr)
{
char *p = next_token (*ptr);
char *end;
const char *p = next_token (*ptr);
if (*p == '\0')
return 0;
*ptr = end = end_of_token (p);
*ptr = end_of_token (p);
if (lengthptr != 0)
*lengthptr = end - p;
return p;
*lengthptr = *ptr - p;
return (char *)p;
}
/* Allocate a new `struct dep' with all fields initialized to 0. */
struct dep *
alloc_dep ()
{
struct dep *d = (struct dep *) xmalloc (sizeof (struct dep));
bzero ((char *) d, sizeof (struct dep));
return d;
}
/* Free `struct dep' along with `name' and `stem'. */
void
free_dep (struct dep *d)
{
if (d->name != 0)
free (d->name);
if (d->stem != 0)
free (d->stem);
free ((char *)d);
}
/* Copy a chain of `struct dep', making a new chain
with the same contents as the old one. */
/* Copy a chain of `struct dep'. For 2nd expansion deps, dup the name. */
struct dep *
copy_dep_chain (const struct dep *d)
{
register struct dep *c;
struct dep *firstnew = 0;
struct dep *lastnew = 0;
while (d != 0)
{
c = (struct dep *) xmalloc (sizeof (struct dep));
bcopy ((char *) d, (char *) c, sizeof (struct dep));
struct dep *c = xmalloc (sizeof (struct dep));
memcpy (c, d, sizeof (struct dep));
if (c->name != 0)
c->name = xstrdup (c->name);
if (c->stem != 0)
c->stem = xstrdup (c->stem);
if (c->need_2nd_expansion)
c->name = xstrdup (c->name);
c->next = 0;
if (firstnew == 0)
@@ -549,35 +573,73 @@ free_dep_chain (struct dep *d)
free_dep (df);
}
}
/* Free a chain of `struct nameseq'. Each nameseq->name is freed
as well. For `struct dep' chains use free_dep_chain. */
/* Free a chain of struct nameseq.
For struct dep chains use free_dep_chain. */
void
free_ns_chain (struct nameseq *n)
free_ns_chain (struct nameseq *ns)
{
register struct nameseq *tmp;
while (ns != 0)
{
struct nameseq *t = ns;
ns = ns->next;
free (t);
}
}
while (n != 0)
{
if (n->name != 0)
free (n->name);
#if !HAVE_STRCASECMP && !HAVE_STRICMP && !HAVE_STRCMPI
tmp = n;
/* If we don't have strcasecmp() (from POSIX), or anything that can substitute
for it, define our own version. */
n = n->next;
free (tmp);
}
}
#ifdef iAPX286
/* The losing compiler on this machine can't handle this macro. */
char *
dep_name (struct dep *dep)
int
strcasecmp (const char *s1, const char *s2)
{
return dep->name == 0 ? dep->file->name : dep->name;
while (1)
{
int c1 = (int) *(s1++);
int c2 = (int) *(s2++);
if (isalpha (c1))
c1 = tolower (c1);
if (isalpha (c2))
c2 = tolower (c2);
if (c1 != '\0' && c1 == c2)
continue;
return (c1 - c2);
}
}
#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. */
int
strncasecmp (const char *s1, const char *s2, int n)
{
while (n-- > 0)
{
int c1 = (int) *(s1++);
int c2 = (int) *(s2++);
if (isalpha (c1))
c1 = tolower (c1);
if (isalpha (c2))
c2 = tolower (c2);
if (c1 != '\0' && c1 == c2)
continue;
return (c1 - c2);
}
return 0;
}
#endif

View File

@@ -1,3 +1,16 @@
2009-09-16 Paul Smith <psmith@gnu.org>
* LINGUAS: Added new translation for Italian (it).
2008-05-17 Paul Smith <psmith@gnu.org>
* LINGUAS: Added new translation for Lithuanian (lt).
2007-08-15 Paul Smith <psmith@gnu.org>
* LINGUAS: The Kinyarwanda (rw) translation has disappeared from
the translation site, so remove it.
2006-01-28 Paul D. Smith <psmith@gnu.org>
* LINGUAS: Added new translation for Vietnamese (vi).
@@ -52,17 +65,18 @@
* POTFILES.in, LINGUAS, Makevars: Created.
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 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
terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
this program. If not, see <http://www.gnu.org/licenses/>.

View File

@@ -1,5 +1,5 @@
# Set of available languages: 23 languages
# Set of available languages: 24 languages
be da de es fi fr ga gl he hr id ja ko nl pl pt_BR ru rw sv tr uk vi zh_CN
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
# Can't seem to get en@quot and en@boldquot to build properly?

View File

@@ -1,18 +1,20 @@
# This is a -*-Makefile-*-
# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# Copyright (C) 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 2, or (at your option) any later version.
# 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.
# 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
# GNU Make; see the file COPYING. If not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
# this program. If not, see <http://www.gnu.org/licenses/>.
# Makefile variables for PO directory in any package using GNU gettext.

View File

@@ -1,19 +1,20 @@
# List of source files containing translatable strings.
# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
# Foundation, Inc.
# Copyright (C) 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 2, or (at your option) any later version.
# 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.
# 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
# GNU Make; see the file COPYING. If not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
# this program. If not, see <http://www.gnu.org/licenses/>.
ar.c
arscan.c

2092
read.c

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +1,13 @@
This is the VMS version of GNU Make, updated by Hartmut Becker
Changes are based on GNU make 3.80. Latest changes are for OpenVMS/I64
and new VMS CRTLs.
Changes are based on GNU make 3.82.
This version was tested on OpenVMS/I64 V8.2 (field test) with hp C
X7.1-024 OpenVMS/Alpha V7.3-2 with Compaq C V6.5-001 and OpenVMS/VAX 7.1
with Compaq C V6.2-003 There are still some warning and informational
message issued by the compilers.
This version was built and tested on OpenVMS V7.3 (VAX), V7.3-2 (Alpha) and
V8.3-1H1 (I64).
Build instructions
Make a 1st version
$ @makefile.com
$ @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
@@ -20,7 +17,89 @@ Verify your 2nd version
$ mc sys$disk:[]2nd-make clean
$ mc sys$disk:[]2nd-make
Changes:
Changes (3.81.90)
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
adjusted to GMT based time, if the local VMS time was using a daylight saving
algorithm and if daylight saving was switched off.
John Eisenbraun (at HP dot COM) supplied fixes and and an enhancement to append
output redirection in action lines.
Rework of ctrl+c and ctrl+y handling.
Fix a problem with cached strings, which showed on case-insensitive file
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
to a file. GNU make for VMS already implements the redirection of output. If
such a redirection is detected, an ">" on the action line, GNU make creates a
DCL command procedure to execute the action and to redirect its output. Based
on that, now ">>" is also recognized and a similar but different command
procedure is created to implement the append. The main idea here is to create a
temporary file which collects the output and which is appended to the wanted
output file. Then the temporary file is deleted. This is all done in the
command procedure to keep changes in make small and simple. This obviously has
some limitations but it seems good enough compared with the current ">"
implementation. (And in my opinion, redirection is not really what GNU make has
to do.) With this approach, it may happen that the temporary file is not yet
appended and is left in SYS$SCRATCH. The temporary file names look like
"CMDxxxxx.". Any time the created command procedure can not complete, this
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
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.
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)
. In default.c define variable ARCH as IA64 for VMS on Itanium systems.
@@ -297,17 +376,17 @@ 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 Free Software Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
this program. If not, see <http://www.gnu.org/licenses/>.

536
remake.c
View File

@@ -1,20 +1,20 @@
/* Basic dependency engine for GNU Make.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
#include "make.h"
#include "filedef.h"
@@ -39,7 +39,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
#include <io.h>
#endif
extern int try_implicit_rule PARAMS ((struct file *file, unsigned int depth));
extern int try_implicit_rule (struct file *file, unsigned int depth);
/* The test for circular dependencies is based on the 'updating' bit in
@@ -60,13 +60,14 @@ unsigned int commands_started = 0;
/* Current value for pruning the scan of the goal chain (toggle 0/1). */
static unsigned int considered;
static int update_file PARAMS ((struct file *file, unsigned int depth));
static int update_file_1 PARAMS ((struct file *file, unsigned int depth));
static int check_dep PARAMS ((struct file *file, unsigned int depth, FILE_TIMESTAMP this_mtime, int *must_make_ptr));
static int touch_file PARAMS ((struct file *file));
static void remake_file PARAMS ((struct file *file));
static FILE_TIMESTAMP name_mtime PARAMS ((char *name));
static int library_search PARAMS ((char **lib, FILE_TIMESTAMP *mtime_ptr));
static int update_file (struct file *file, unsigned int depth);
static int update_file_1 (struct file *file, unsigned int depth);
static int check_dep (struct file *file, unsigned int depth,
FILE_TIMESTAMP this_mtime, int *must_make_ptr);
static int touch_file (struct file *file);
static void remake_file (struct file *file);
static FILE_TIMESTAMP name_mtime (const char *name);
static const char *library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr);
/* Remake all the goals in the `struct dep' chain GOALS. Return -1 if nothing
@@ -81,7 +82,6 @@ int
update_goal_chain (struct dep *goals)
{
int t = touch_flag, q = question_flag, n = just_print_flag;
unsigned int j = job_slots;
int status = -1;
#define MTIME(file) (rebuilding_makefiles ? file_mtime_no_search (file) \
@@ -133,6 +133,9 @@ update_goal_chain (struct dep *goals)
{
unsigned int ocommands_started;
int x;
file->dontcare = g->dontcare;
check_renamed (file);
if (rebuilding_makefiles)
{
@@ -206,6 +209,8 @@ update_goal_chain (struct dep *goals)
When they are all finished, the goal is finished. */
any_not_updated |= !file->updated;
file->dontcare = 0;
if (stop)
break;
}
@@ -237,7 +242,7 @@ update_goal_chain (struct dep *goals)
lastgoal->next = g->next;
/* Free the storage. */
free ((char *) g);
free (g);
g = lastgoal == 0 ? goals : lastgoal->next;
@@ -262,7 +267,6 @@ update_goal_chain (struct dep *goals)
touch_flag = t;
question_flag = q;
just_print_flag = n;
job_slots = j;
}
return status;
@@ -294,8 +298,14 @@ update_file (struct file *file, unsigned int depth)
change is possible below here until then. */
if (f->considered == considered)
{
DBF (DB_VERBOSE, _("Pruning file `%s'.\n"));
return f->command_state == cs_finished ? f->update_status : 0;
/* Check for the case where a target has been tried and failed but
the diagnostics hasn't been issued. If we need the diagnostics
then we will have to continue. */
if (!(f->updated && f->update_status > 0 && !f->dontcare && f->no_diag))
{
DBF (DB_VERBOSE, _("Pruning file `%s'.\n"));
return f->command_state == cs_finished ? f->update_status : 0;
}
}
/* This loop runs until we start commands for a double colon rule, or until
@@ -312,7 +322,7 @@ update_file (struct file *file, unsigned int depth)
/* If we got an error, don't bother with double_colon etc. */
if (status != 0 && !keep_going_flag)
return status;
return status;
if (f->command_state == cs_running
|| f->command_state == cs_deps_running)
@@ -343,25 +353,48 @@ update_file (struct file *file, unsigned int depth)
/* Show a message stating the target failed to build. */
static void
complain (const struct file *file)
complain (struct file *file)
{
const char *msg_noparent
= _("%sNo rule to make target `%s'%s");
const char *msg_parent
= _("%sNo rule to make target `%s', needed by `%s'%s");
if (!keep_going_flag)
{
if (file->parent == 0)
fatal (NILF, msg_noparent, "", file->name, "");
/* If this file has no_diag set then it means we tried to update it
before in the dontcare mode and failed. The target that actually
failed is not necessarily this file but could be one of its direct
or indirect dependencies. So traverse this file's dependencies and
find the one that actually caused the failure. */
fatal (NILF, msg_parent, "", file->name, file->parent->name, "");
struct dep *d;
for (d = file->deps; d != 0; d = d->next)
{
if (d->file->updated && d->file->update_status > 0 && file->no_diag)
{
complain (d->file);
break;
}
}
if (file->parent == 0)
error (NILF, msg_noparent, "*** ", file->name, ".");
else
error (NILF, msg_parent, "*** ", file->name, file->parent->name, ".");
if (d == 0)
{
/* Didn't find any dependencies to complain about. */
if (!keep_going_flag)
{
if (file->parent == 0)
fatal (NILF, msg_noparent, "", file->name, "");
fatal (NILF, msg_parent, "", file->name, file->parent->name, "");
}
if (file->parent == 0)
error (NILF, msg_noparent, "*** ", file->name, ".");
else
error (NILF, msg_parent, "*** ", file->name, file->parent->name, ".");
file->no_diag = 0;
}
}
/* Consider a single `struct file' and update it as appropriate. */
@@ -369,10 +402,12 @@ complain (const struct file *file)
static int
update_file_1 (struct file *file, unsigned int depth)
{
register FILE_TIMESTAMP this_mtime;
FILE_TIMESTAMP this_mtime;
int noexist, must_make, deps_changed;
int dep_status = 0;
register struct dep *d, *lastd;
struct file *ofile;
struct dep *d, *ad;
struct dep amake;
int running = 0;
DBF (DB_VERBOSE, _("Considering target file `%s'.\n"));
@@ -384,15 +419,12 @@ update_file_1 (struct file *file, unsigned int depth)
DBF (DB_VERBOSE,
_("Recently tried and failed to update file `%s'.\n"));
/* If the file we tried to make is marked dontcare then no message
/* If the file we tried to make is marked no_diag then no message
was printed about it when it failed during the makefile rebuild.
If we're trying to build it again in the normal rebuild, print a
message now. */
if (file->dontcare && !rebuilding_makefiles)
{
file->dontcare = 0;
if (file->no_diag && !file->dontcare)
complain (file);
}
return file->update_status;
}
@@ -416,11 +448,19 @@ update_file_1 (struct file *file, unsigned int depth)
abort ();
}
/* Determine whether the diagnostics will be issued should this update
fail. */
file->no_diag = file->dontcare;
++depth;
/* Notice recursive update of the same file. */
start_updating (file);
/* We might change file if we find a different one via vpath;
remember this one to turn off updating. */
ofile = file;
/* Looking at the file's modtime beforehand allows the possibility
that its name may be changed by a VPATH search, and thus it may
not need an implicit rule. If this were not done, the file
@@ -459,89 +499,98 @@ update_file_1 (struct file *file, unsigned int depth)
if (file->cmds == 0 && !file->is_target
&& default_file != 0 && default_file->cmds != 0)
{
DBF (DB_IMPLICIT, _("Using default commands for `%s'.\n"));
DBF (DB_IMPLICIT, _("Using default recipe for `%s'.\n"));
file->cmds = default_file->cmds;
}
/* Update all non-intermediate files we depend on, if necessary,
and see whether any of them is more recent than this file. */
/* Update all non-intermediate files we depend on, if necessary, and see
whether any of them is more recent than this file. We need to walk our
deps, AND the deps of any also_make targets to ensure everything happens
in the correct order. */
lastd = 0;
d = file->deps;
while (d != 0)
amake.file = file;
amake.next = file->also_make;
ad = &amake;
while (ad)
{
FILE_TIMESTAMP mtime;
int maybe_make;
int dontcare = 0;
struct dep *lastd = 0;
check_renamed (d->file);
/* Find the deps we're scanning */
d = ad->file->deps;
ad = ad->next;
mtime = file_mtime (d->file);
check_renamed (d->file);
if (is_updating (d->file))
{
error (NILF, _("Circular %s <- %s dependency dropped."),
file->name, d->file->name);
/* We cannot free D here because our the caller will still have
a reference to it when we were called recursively via
check_dep below. */
if (lastd == 0)
file->deps = d->next;
else
lastd->next = d->next;
d = d->next;
continue;
}
d->file->parent = file;
maybe_make = must_make;
/* Inherit dontcare flag from our parent. */
if (rebuilding_makefiles)
while (d)
{
dontcare = d->file->dontcare;
d->file->dontcare = file->dontcare;
FILE_TIMESTAMP mtime;
int maybe_make;
int dontcare = 0;
check_renamed (d->file);
mtime = file_mtime (d->file);
check_renamed (d->file);
if (is_updating (d->file))
{
error (NILF, _("Circular %s <- %s dependency dropped."),
file->name, d->file->name);
/* We cannot free D here because our the caller will still have
a reference to it when we were called recursively via
check_dep below. */
if (lastd == 0)
file->deps = d->next;
else
lastd->next = d->next;
d = d->next;
continue;
}
d->file->parent = file;
maybe_make = must_make;
/* Inherit dontcare flag from our parent. */
if (rebuilding_makefiles)
{
dontcare = d->file->dontcare;
d->file->dontcare = file->dontcare;
}
dep_status |= check_dep (d->file, depth, this_mtime, &maybe_make);
/* Restore original dontcare flag. */
if (rebuilding_makefiles)
d->file->dontcare = dontcare;
if (! d->ignore_mtime)
must_make = maybe_make;
check_renamed (d->file);
{
register struct file *f = d->file;
if (f->double_colon)
f = f->double_colon;
do
{
running |= (f->command_state == cs_running
|| f->command_state == cs_deps_running);
f = f->prev;
}
while (f != 0);
}
if (dep_status != 0 && !keep_going_flag)
break;
if (!running)
/* The prereq is considered changed if the timestamp has changed while
it was built, OR it doesn't exist. */
d->changed = ((file_mtime (d->file) != mtime)
|| (mtime == NONEXISTENT_MTIME));
lastd = d;
d = d->next;
}
dep_status |= check_dep (d->file, depth, this_mtime, &maybe_make);
/* Restore original dontcare flag. */
if (rebuilding_makefiles)
d->file->dontcare = dontcare;
if (! d->ignore_mtime)
must_make = maybe_make;
check_renamed (d->file);
{
register struct file *f = d->file;
if (f->double_colon)
f = f->double_colon;
do
{
running |= (f->command_state == cs_running
|| f->command_state == cs_deps_running);
f = f->prev;
}
while (f != 0);
}
if (dep_status != 0 && !keep_going_flag)
break;
if (!running)
/* The prereq is considered changed if the timestamp has changed while
it was built, OR it doesn't exist.
This causes the Linux kernel build to break. We'll defer this
fix until GNU make 3.82 to give them time to update. */
d->changed = ((file_mtime (d->file) != mtime)
/* || (mtime == NONEXISTENT_MTIME) */);
lastd = d;
d = d->next;
}
/* Now we know whether this target needs updating.
@@ -597,6 +646,7 @@ update_file_1 (struct file *file, unsigned int depth)
}
finish_updating (file);
finish_updating (ofile);
DBF (DB_VERBOSE, _("Finished prerequisites of target file `%s'.\n"));
@@ -712,7 +762,7 @@ update_file_1 (struct file *file, unsigned int depth)
{
must_make = 0;
DBF (DB_VERBOSE,
_("No commands for `%s' and no prerequisites actually changed.\n"));
_("No recipe for `%s' and no prerequisites actually changed.\n"));
}
else if (!must_make && file->cmds != 0 && always_make_flag)
{
@@ -762,7 +812,7 @@ update_file_1 (struct file *file, unsigned int depth)
if (file->command_state != cs_finished)
{
DBF (DB_VERBOSE, _("Commands of `%s' are being run.\n"));
DBF (DB_VERBOSE, _("Recipe of `%s' is being run.\n"));
return 0;
}
@@ -804,7 +854,7 @@ notice_finished_file (struct file *file)
if (touch_flag
/* The update status will be:
-1 if this target was not remade;
-1 if this target was not remade;
0 if 0 or more commands (+ or ${MAKE}) were run and won;
1 if some commands were run and lost.
We touch the target if it has commands which either were not run
@@ -855,7 +905,7 @@ notice_finished_file (struct file *file)
really check the target's mtime again. Otherwise, assume the target
would have been updated. */
if (question_flag || just_print_flag || touch_flag)
if ((question_flag || just_print_flag || touch_flag) && file->cmds)
{
for (i = file->cmds->ncommand_lines; i > 0; --i)
if (! (file->cmds->lines_flags[i-1] & COMMANDS_RECURSE))
@@ -914,7 +964,7 @@ notice_finished_file (struct file *file)
We do this instead of just invalidating the cached time
so that a vpath_search can happen. Otherwise, it would
never be done because the target is already updated. */
(void) f_mtime (d->file, 0);
f_mtime (d->file, 0);
}
else if (file->update_status == -1)
/* Nothing was done for FILE, but it needed nothing done.
@@ -922,27 +972,31 @@ notice_finished_file (struct file *file)
file->update_status = 0;
}
/* Check whether another file (whose mtime is THIS_MTIME)
needs updating on account of a dependency which is file FILE.
If it does, store 1 in *MUST_MAKE_PTR.
In the process, update any non-intermediate files
that FILE depends on (including FILE itself).
Return nonzero if any updating failed. */
/* Check whether another file (whose mtime is THIS_MTIME) needs updating on
account of a dependency which is file FILE. If it does, store 1 in
*MUST_MAKE_PTR. In the process, update any non-intermediate files that
FILE depends on (including FILE itself). Return nonzero if any updating
failed. */
static int
check_dep (struct file *file, unsigned int depth,
FILE_TIMESTAMP this_mtime, int *must_make_ptr)
{
struct file *ofile;
struct dep *d;
int dep_status = 0;
++depth;
start_updating (file);
/* We might change file if we find a different one via vpath;
remember this one to turn off updating. */
ofile = file;
if (file->phony || !file->intermediate)
{
/* If this is a non-intermediate file, update it and record
whether it is newer than THIS_MTIME. */
/* If this is a non-intermediate file, update it and record whether it
is newer than THIS_MTIME. */
FILE_TIMESTAMP mtime;
dep_status = update_file (file, depth);
check_renamed (file);
@@ -971,21 +1025,28 @@ check_dep (struct file *file, unsigned int depth,
file->cmds = default_file->cmds;
}
/* If the intermediate file actually exists
and is newer, then we should remake from it. */
check_renamed (file);
mtime = file_mtime (file);
check_renamed (file);
if (mtime != NONEXISTENT_MTIME && mtime > this_mtime)
/* If the intermediate file actually exists and is newer, then we
should remake from it. */
*must_make_ptr = 1;
/* Otherwise, update all non-intermediate files we depend on,
if necessary, and see whether any of them is more
recent than the file on whose behalf we are checking. */
else
{
struct dep *lastd;
/* Otherwise, update all non-intermediate files we depend on, if
necessary, and see whether any of them is more recent than the
file on whose behalf we are checking. */
struct dep *ld;
int deps_running = 0;
lastd = 0;
/* If this target is not running, set it's state so that we check it
fresh. It could be it was checked as part of an order-only
prerequisite and so wasn't rebuilt then, but should be now. */
if (file->command_state != cs_running)
set_command_state (file, cs_not_started);
ld = 0;
d = file->deps;
while (d != 0)
{
@@ -995,7 +1056,7 @@ check_dep (struct file *file, unsigned int depth,
{
error (NILF, _("Circular %s <- %s dependency dropped."),
file->name, d->file->name);
if (lastd == 0)
if (ld == 0)
{
file->deps = d->next;
free_dep (d);
@@ -1003,9 +1064,9 @@ check_dep (struct file *file, unsigned int depth,
}
else
{
lastd->next = d->next;
ld->next = d->next;
free_dep (d);
d = lastd->next;
d = ld->next;
}
continue;
}
@@ -1022,18 +1083,23 @@ check_dep (struct file *file, unsigned int depth,
if (d->file->command_state == cs_running
|| d->file->command_state == cs_deps_running)
/* Record that some of FILE's deps are still being made.
This tells the upper levels to wait on processing it until
the commands are finished. */
set_command_state (file, cs_deps_running);
deps_running = 1;
lastd = d;
ld = d;
d = d->next;
}
if (deps_running)
/* Record that some of FILE's deps are still being made.
This tells the upper levels to wait on processing it until the
commands are finished. */
set_command_state (file, cs_deps_running);
}
}
finish_updating (file);
finish_updating (ofile);
return dep_status;
}
@@ -1060,7 +1126,7 @@ touch_file (struct file *file)
else
{
struct stat statbuf;
char buf;
char buf = 'x';
int e;
EINTRLOOP (e, fstat (fd, &statbuf));
@@ -1154,7 +1220,6 @@ f_mtime (struct file *file, int search)
char *arname, *memname;
struct file *arfile;
int arname_used = 0;
time_t member_date;
/* Find the archive's name. */
@@ -1164,10 +1229,7 @@ f_mtime (struct file *file, int search)
Also allow for its name to be changed via VPATH search. */
arfile = lookup_file (arname);
if (arfile == 0)
{
arfile = enter_file (arname);
arname_used = 1;
}
arfile = enter_file (strcache_add (arname));
mtime = f_mtime (arfile, search);
check_renamed (arfile);
if (search && strcmp (arfile->hname, arname))
@@ -1178,22 +1240,13 @@ f_mtime (struct file *file, int search)
char *name;
unsigned int arlen, memlen;
if (!arname_used)
{
free (arname);
arname_used = 1;
}
arname = arfile->hname;
arlen = strlen (arname);
arlen = strlen (arfile->hname);
memlen = strlen (memname);
/* free (file->name); */
name = (char *) xmalloc (arlen + 1 + memlen + 2);
bcopy (arname, name, arlen);
name = xmalloc (arlen + 1 + memlen + 2);
memcpy (name, arfile->hname, arlen);
name[arlen] = '(';
bcopy (memname, name + arlen + 1, memlen);
memcpy (name + arlen + 1, memname, memlen);
name[arlen + 1 + memlen] = ')';
name[arlen + 1 + memlen + 1] = '\0';
@@ -1206,9 +1259,7 @@ f_mtime (struct file *file, int search)
check_renamed (file);
}
if (!arname_used)
free (arname);
free (memname);
free (arname);
file->low_resolution_time = 1;
@@ -1229,11 +1280,11 @@ f_mtime (struct file *file, int search)
if (mtime == NONEXISTENT_MTIME && search && !file->ignore_vpath)
{
/* If name_mtime failed, search VPATH. */
char *name = file->name;
if (vpath_search (&name, &mtime)
const char *name = vpath_search (file->name, &mtime, NULL, NULL);
if (name
/* Last resort, is it a library (-lxxx)? */
|| (name[0] == '-' && name[1] == 'l'
&& library_search (&name, &mtime)))
|| (file->name[0] == '-' && file->name[1] == 'l'
&& (name = library_search (file->name, &mtime)) != 0))
{
if (mtime != UNKNOWN_MTIME)
/* vpath_search and library_search store UNKNOWN_MTIME
@@ -1310,8 +1361,14 @@ f_mtime (struct file *file, int search)
(FILE_TIMESTAMP_S (mtime) - FILE_TIMESTAMP_S (now)
+ ((FILE_TIMESTAMP_NS (mtime) - FILE_TIMESTAMP_NS (now))
/ 1e9));
error (NILF, _("Warning: File `%s' has modification time %.2g s in the future"),
file->name, from_now);
char from_now_string[100];
if (from_now >= 99 && from_now <= ULONG_MAX)
sprintf (from_now_string, "%lu", (unsigned long) from_now);
else
sprintf (from_now_string, "%.2g", from_now);
error (NILF, _("Warning: File `%s' has modification time %s s in the future"),
file->name, from_now_string);
#endif
clock_skew_detected = 1;
}
@@ -1352,7 +1409,7 @@ f_mtime (struct file *file, int search)
much cleaner. */
static FILE_TIMESTAMP
name_mtime (char *name)
name_mtime (const char *name)
{
FILE_TIMESTAMP mtime;
struct stat st;
@@ -1446,8 +1503,8 @@ name_mtime (char *name)
suitable library file in the system library directories and the VPATH
directories. */
static int
library_search (char **lib, FILE_TIMESTAMP *mtime_ptr)
static const char *
library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr)
{
static char *dirs[] =
{
@@ -1466,29 +1523,31 @@ library_search (char **lib, FILE_TIMESTAMP *mtime_ptr)
0
};
static char *libpatterns = NULL;
char *libname = &(*lib)[2]; /* Name without the `-l'. */
const char *file = 0;
char *libpatterns;
FILE_TIMESTAMP mtime;
/* Loop variables for the libpatterns value. */
char *p, *p2;
char *p;
const char *p2;
unsigned int len;
unsigned int liblen;
char *file, **dp;
/* Information about the earliest (in the vpath sequence) match. */
unsigned int best_vpath, best_path;
unsigned int std_dirs = 0;
/* If we don't have libpatterns, get it. */
if (!libpatterns)
{
int save = warn_undefined_variables_flag;
warn_undefined_variables_flag = 0;
char **dp;
libpatterns = xstrdup (variable_expand ("$(strip $(.LIBPATTERNS))"));
libpatterns = xstrdup (variable_expand ("$(.LIBPATTERNS)"));
warn_undefined_variables_flag = save;
}
/* Skip the '-l'. */
lib += 2;
liblen = strlen (lib);
/* Loop through all the patterns in .LIBPATTERNS, and search on each one. */
/* Loop through all the patterns in .LIBPATTERNS, and search on each one.
To implement the linker-compatible behavior we have to search through
all entries in .LIBPATTERNS and choose the "earliest" one. */
p2 = libpatterns;
while ((p = find_next_token (&p2, &len)) != 0)
{
@@ -1497,7 +1556,7 @@ library_search (char **lib, FILE_TIMESTAMP *mtime_ptr)
static int libdir_maxlen = -1;
char *libbuf = variable_expand ("");
/* Expand the pattern using LIBNAME as a replacement. */
/* Expand the pattern using LIB as a replacement. */
{
char c = p[len];
char *p3, *p4;
@@ -1506,16 +1565,13 @@ library_search (char **lib, FILE_TIMESTAMP *mtime_ptr)
p3 = find_percent (p);
if (!p3)
{
/* Give a warning if there is no pattern, then remove the
pattern so it's ignored next time. */
/* Give a warning if there is no pattern. */
error (NILF, _(".LIBPATTERNS element `%s' is not a pattern"), p);
for (; len; --len, ++p)
*p = ' ';
*p = c;
p[len] = c;
continue;
}
p4 = variable_buffer_output (libbuf, p, p3-p);
p4 = variable_buffer_output (p4, libname, strlen (libname));
p4 = variable_buffer_output (p4, lib, liblen);
p4 = variable_buffer_output (p4, p3+1, len - (p3-p));
p[len] = c;
}
@@ -1524,53 +1580,83 @@ library_search (char **lib, FILE_TIMESTAMP *mtime_ptr)
mtime = name_mtime (libbuf);
if (mtime != NONEXISTENT_MTIME)
{
*lib = xstrdup (libbuf);
if (mtime_ptr != 0)
*mtime_ptr = mtime;
return 1;
file = strcache_add (libbuf);
/* This by definition will have the best index, so stop now. */
break;
}
/* Now try VPATH search on that. */
file = libbuf;
if (vpath_search (&file, mtime_ptr))
{
*lib = file;
return 1;
}
{
unsigned int vpath_index, path_index;
const char* f = vpath_search (libbuf, mtime_ptr ? &mtime : NULL,
&vpath_index, &path_index);
if (f)
{
/* If we have a better match, record it. */
if (file == 0 ||
vpath_index < best_vpath ||
(vpath_index == best_vpath && path_index < best_path))
{
file = f;
best_vpath = vpath_index;
best_path = path_index;
if (mtime_ptr != 0)
*mtime_ptr = mtime;
}
}
}
/* Now try the standard set of directories. */
if (!buflen)
{
for (dp = dirs; *dp != 0; ++dp)
{
int l = strlen (*dp);
if (l > libdir_maxlen)
libdir_maxlen = l;
}
buflen = strlen (libbuf);
buf = xmalloc(libdir_maxlen + buflen + 2);
}
{
for (dp = dirs; *dp != 0; ++dp)
{
int l = strlen (*dp);
if (l > libdir_maxlen)
libdir_maxlen = l;
std_dirs++;
}
buflen = strlen (libbuf);
buf = xmalloc(libdir_maxlen + buflen + 2);
}
else if (buflen < strlen (libbuf))
{
buflen = strlen (libbuf);
buf = xrealloc (buf, libdir_maxlen + buflen + 2);
}
{
buflen = strlen (libbuf);
buf = xrealloc (buf, libdir_maxlen + buflen + 2);
}
{
/* Use the last std_dirs index for standard directories. This
was it will always be greater than the VPATH index. */
unsigned int vpath_index = ~((unsigned int)0) - std_dirs;
for (dp = dirs; *dp != 0; ++dp)
{
sprintf (buf, "%s/%s", *dp, libbuf);
mtime = name_mtime (buf);
if (mtime != NONEXISTENT_MTIME)
{
if (file == 0 || vpath_index < best_vpath)
{
file = strcache_add (buf);
best_vpath = vpath_index;
if (mtime_ptr != 0)
*mtime_ptr = mtime;
}
}
vpath_index++;
}
}
for (dp = dirs; *dp != 0; ++dp)
{
sprintf (buf, "%s/%s", *dp, libbuf);
mtime = name_mtime (buf);
if (mtime != NONEXISTENT_MTIME)
{
*lib = xstrdup (buf);
if (mtime_ptr != 0)
*mtime_ptr = mtime;
return 1;
}
}
}
return 0;
free (libpatterns);
return file;
}

View File

@@ -4,21 +4,21 @@
the Make maintainers.
Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
#include "make.h"
#include "job.h"
@@ -98,7 +98,7 @@ start_remote_job_p (int first_p)
/* Normalize the current directory path name to something
that should work on all machines exported to. */
normalized_cwd = (char *) xmalloc (GET_PATH_MAX);
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

View File

@@ -1,20 +1,20 @@
/* 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 Free Software
Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
#include "make.h"
#include "filedef.h"

315
rule.c
View File

@@ -1,22 +1,25 @@
/* 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 Free Software
Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
#include "make.h"
#include <assert.h>
#include "dep.h"
#include "filedef.h"
#include "job.h"
@@ -24,7 +27,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
#include "variable.h"
#include "rule.h"
static void freerule PARAMS ((struct rule *rule, struct rule *lastrule));
static void freerule (struct rule *rule, struct rule *lastrule);
/* Chain of all pattern rules. */
@@ -69,7 +72,7 @@ count_implicit_rule_limits (void)
{
char *name;
int namelen;
register struct rule *rule, *lastrule;
struct rule *rule, *lastrule;
num_pattern_rules = max_pattern_targets = max_pattern_deps = 0;
max_pattern_dep_length = 0;
@@ -81,34 +84,30 @@ count_implicit_rule_limits (void)
while (rule != 0)
{
unsigned int ndeps = 0;
register struct dep *dep;
struct dep *dep;
struct rule *next = rule->next;
unsigned int ntargets;
++num_pattern_rules;
ntargets = 0;
while (rule->targets[ntargets] != 0)
++ntargets;
if (ntargets > max_pattern_targets)
max_pattern_targets = ntargets;
if (rule->num > max_pattern_targets)
max_pattern_targets = rule->num;
for (dep = rule->deps; dep != 0; dep = dep->next)
{
unsigned int len = strlen (dep->name);
const char *dname = dep_name (dep);
unsigned int len = strlen (dname);
#ifdef VMS
char *p = strrchr (dep->name, ']');
char *p2;
const char *p = strrchr (dname, ']');
const char *p2;
if (p == 0)
p = strrchr (dep->name, ':');
p2 = p != 0 ? strchr (dep->name, '%') : 0;
p = strrchr (dname, ':');
p2 = p != 0 ? strchr (dname, '%') : 0;
#else
char *p = strrchr (dep->name, '/');
char *p2 = p != 0 ? strchr (dep->name, '%') : 0;
const char *p = strrchr (dname, '/');
const char *p2 = p != 0 ? strchr (dname, '%') : 0;
#endif
ndeps++;
ndeps++;
if (len > max_pattern_dep_length)
max_pattern_dep_length = len;
@@ -117,17 +116,15 @@ count_implicit_rule_limits (void)
{
/* There is a slash before the % in the dep name.
Extract the directory name. */
if (p == dep->name)
if (p == dname)
++p;
if (p - dep->name > namelen)
if (p - dname > namelen)
{
if (name != 0)
free (name);
namelen = p - dep->name;
name = (char *) xmalloc (namelen + 1);
namelen = p - dname;
name = xrealloc (name, namelen + 1);
}
bcopy (dep->name, name, p - dep->name);
name[p - dep->name] = '\0';
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
@@ -158,102 +155,107 @@ count_implicit_rule_limits (void)
If SOURCE is nil, it means there should be no deps. */
static void
convert_suffix_rule (char *target, char *source, struct commands *cmds)
convert_suffix_rule (const char *target, const char *source,
struct commands *cmds)
{
char *targname, *targpercent, *depname;
char **names, **percents;
const char **names, **percents;
struct dep *deps;
unsigned int len;
names = xmalloc (sizeof (const char *));
percents = xmalloc (sizeof (const char *));
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
targname = savestring ("(%.obj)", 7);
*names = strcache_add_len ("(%.obj)", 7);
#else
targname = savestring ("(%.o)", 5);
*names = strcache_add_len ("(%.o)", 5);
#endif
targpercent = targname + 1;
*percents = *names + 1;
}
else
{
/* Construct the target name. */
len = strlen (target);
targname = xmalloc (1 + len + 1);
targname[0] = '%';
bcopy (target, targname + 1, len + 1);
targpercent = targname;
unsigned int len = strlen (target);
char *p = alloca (1 + len + 1);
p[0] = '%';
memcpy (p + 1, target, len + 1);
*names = strcache_add_len (p, len + 1);
*percents = *names;
}
names = (char **) xmalloc (2 * sizeof (char *));
percents = (char **) alloca (2 * sizeof (char *));
names[0] = targname;
percents[0] = targpercent;
names[1] = percents[1] = 0;
if (source == 0)
deps = 0;
else
{
/* Construct the dependency name. */
len = strlen (source);
depname = xmalloc (1 + len + 1);
depname[0] = '%';
bcopy (source, depname + 1, len + 1);
unsigned int len = strlen (source);
char *p = alloca (1 + len + 1);
p[0] = '%';
memcpy (p + 1, source, len + 1);
deps = alloc_dep ();
deps->name = depname;
deps->name = strcache_add_len (p, len + 1);
}
create_pattern_rule (names, percents, 0, deps, cmds, 0);
create_pattern_rule (names, percents, 1, 0, deps, cmds, 0);
}
/* Convert old-style suffix rules to pattern rules.
All rules for the suffixes on the .SUFFIXES list
are converted and added to the chain of pattern rules. */
All rules for the suffixes on the .SUFFIXES list are converted and added to
the chain of pattern rules. */
void
convert_to_pattern (void)
{
register struct dep *d, *d2;
register struct file *f;
register char *rulename;
register unsigned int slen, s2len;
struct dep *d, *d2;
char *rulename;
/* Compute maximum length of all the suffixes. */
/* We will compute every potential suffix rule (.x.y) from the list of
suffixes in the .SUFFIXES target's dependencies and see if it exists.
First find the longest of the suffixes. */
maxsuffix = 0;
for (d = suffix_file->deps; d != 0; d = d->next)
{
register unsigned int namelen = strlen (dep_name (d));
if (namelen > maxsuffix)
maxsuffix = namelen;
unsigned int l = strlen (dep_name (d));
if (l > maxsuffix)
maxsuffix = l;
}
rulename = (char *) alloca ((maxsuffix * 2) + 1);
/* Space to construct the suffix rule target name. */
rulename = alloca ((maxsuffix * 2) + 1);
for (d = suffix_file->deps; d != 0; d = d->next)
{
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. */
convert_suffix_rule (dep_name (d), (char *) 0, (struct commands *) 0);
convert_suffix_rule (dep_name (d), 0, 0);
f = d->file;
if (f->cmds != 0)
if (d->file->cmds != 0)
/* Record a pattern for this suffix's null-suffix rule. */
convert_suffix_rule ("", dep_name (d), f->cmds);
convert_suffix_rule ("", dep_name (d), d->file->cmds);
/* Record a pattern for each of this suffix's two-suffix rules. */
/* Add every other suffix to this one and see if it exists as a
two-suffix rule. */
slen = strlen (dep_name (d));
bcopy (dep_name (d), rulename, slen);
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));
/* Can't build something from itself. */
if (slen == s2len && streq (dep_name (d), dep_name (d2)))
continue;
bcopy (dep_name (d2), rulename + slen, s2len + 1);
memcpy (rulename + slen, dep_name (d2), s2len + 1);
f = lookup_file (rulename);
if (f == 0 || f->cmds == 0)
continue;
@@ -261,7 +263,7 @@ convert_to_pattern (void)
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 ((char *) 0, /* Indicates `(%.o)'. */
convert_suffix_rule (NULL, /* Indicates `(%.o)'. */
dep_name (d),
f->cmds);
@@ -273,19 +275,18 @@ convert_to_pattern (void)
}
/* Install the pattern rule RULE (whose fields have been filled in)
at the end of the list (so that any rules previously defined
will take precedence). If this rule duplicates a previous one
(identical target and dependencies), the old one is replaced
if OVERRIDE is nonzero, otherwise this new one is thrown out.
When an old rule is replaced, the new one is put at the end of the
list. Return nonzero if RULE is used; zero if not. */
/* Install the pattern rule RULE (whose fields have been filled in) at the end
of the list (so that any rules previously defined will take precedence).
If this rule duplicates a previous one (identical target and dependencies),
the old one is replaced if OVERRIDE is nonzero, otherwise this new one is
thrown out. When an old rule is replaced, the new one is put at the end of
the list. Return nonzero if RULE is used; zero if not. */
int
static int
new_pattern_rule (struct rule *rule, int override)
{
register struct rule *r, *lastrule;
register unsigned int i, j;
struct rule *r, *lastrule;
unsigned int i, j;
rule->in_use = 0;
rule->terminal = 0;
@@ -295,15 +296,15 @@ new_pattern_rule (struct rule *rule, int override)
/* Search for an identical rule. */
lastrule = 0;
for (r = pattern_rules; r != 0; lastrule = r, r = r->next)
for (i = 0; rule->targets[i] != 0; ++i)
for (i = 0; i < rule->num; ++i)
{
for (j = 0; r->targets[j] != 0; ++j)
for (j = 0; j < r->num; ++j)
if (!streq (rule->targets[i], r->targets[j]))
break;
if (r->targets[j] == 0)
/* All the targets matched. */
/* If all the targets matched... */
if (j == r->num)
{
register struct dep *d, *d2;
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)))
@@ -359,39 +360,29 @@ new_pattern_rule (struct rule *rule, int override)
void
install_pattern_rule (struct pspec *p, int terminal)
{
register struct rule *r;
struct rule *r;
char *ptr;
r = (struct rule *) xmalloc (sizeof (struct rule));
r = xmalloc (sizeof (struct rule));
r->targets = (char **) xmalloc (2 * sizeof (char *));
r->suffixes = (char **) xmalloc (2 * sizeof (char *));
r->lens = (unsigned int *) xmalloc (2 * sizeof (unsigned int));
r->targets[1] = 0;
r->suffixes[1] = 0;
r->lens[1] = 0;
r->num = 1;
r->targets = xmalloc (sizeof (const char *));
r->suffixes = xmalloc (sizeof (const char *));
r->lens = xmalloc (sizeof (unsigned int));
r->lens[0] = strlen (p->target);
/* These will all be string literals, but we malloc space for
them anyway because somebody might want to free them later on. */
r->targets[0] = savestring (p->target, r->lens[0]);
r->suffixes[0] = find_percent (r->targets[0]);
if (r->suffixes[0] == 0)
/* Programmer-out-to-lunch error. */
abort ();
else
++r->suffixes[0];
r->targets[0] = p->target;
r->suffixes[0] = find_percent_cached (&r->targets[0]);
assert (r->suffixes[0] != NULL);
++r->suffixes[0];
ptr = p->dep;
r->deps = (struct dep *) multi_glob (parse_file_seq (&ptr, '\0',
sizeof (struct dep), 1),
sizeof (struct dep));
r->deps = PARSE_FILE_SEQ (&ptr, struct dep, '\0', NULL, 0);
if (new_pattern_rule (r, 0))
{
r->terminal = terminal;
r->cmds = (struct commands *) xmalloc (sizeof (struct commands));
r->cmds = xmalloc (sizeof (struct commands));
r->cmds->fileinfo.filenm = 0;
r->cmds->fileinfo.lineno = 0;
/* These will all be string literals, but we malloc space for them
@@ -410,28 +401,13 @@ static void
freerule (struct rule *rule, struct rule *lastrule)
{
struct rule *next = rule->next;
register unsigned int i;
register struct dep *dep;
for (i = 0; rule->targets[i] != 0; ++i)
free (rule->targets[i]);
free_dep_chain (rule->deps);
dep = rule->deps;
while (dep)
{
struct dep *t;
t = dep->next;
/* We might leak dep->name here, but I'm not sure how to fix this: I
think that pointer might be shared (e.g., in the file hash?) */
dep->name = 0; /* Make sure free_dep does not free name. */
free_dep (dep);
dep = t;
}
free ((char *) rule->targets);
free ((char *) rule->suffixes);
free ((char *) rule->lens);
/* MSVC erroneously warns without a cast here. */
free ((void *)rule->targets);
free ((void *)rule->suffixes);
free (rule->lens);
/* We can't free the storage for the commands because there
are ways that they could be in more than one place:
@@ -444,7 +420,7 @@ freerule (struct rule *rule, struct rule *lastrule)
be discarded here, but both would contain the same `struct commands'
pointer from the `struct file' for the suffix rule. */
free ((char *) rule);
free (rule);
if (pattern_rules == rule)
if (lastrule != 0)
@@ -457,55 +433,36 @@ freerule (struct rule *rule, struct rule *lastrule)
last_pattern_rule = lastrule;
}
/* Create a new pattern rule with the targets in the nil-terminated
array TARGETS. If TARGET_PERCENTS is not nil, it is an array of
pointers into the elements of TARGETS, where the `%'s are.
The new rule has dependencies DEPS and commands from COMMANDS.
/* Create a new pattern rule with the targets in the nil-terminated array
TARGETS. TARGET_PERCENTS is an array of pointers to the % in each element
of TARGETS. N is the number of items in the array (not counting the nil
element). The new rule has dependencies DEPS and commands from COMMANDS.
It is a terminal rule if TERMINAL is nonzero. This rule overrides
identical rules with different commands if OVERRIDE is nonzero.
The storage for TARGETS and its elements is used and must not be freed
until the rule is destroyed. The storage for TARGET_PERCENTS is not used;
it may be freed. */
The storage for TARGETS and its elements and TARGET_PERCENTS is used and
must not be freed until the rule is destroyed. */
void
create_pattern_rule (char **targets, char **target_percents,
int terminal, struct dep *deps,
create_pattern_rule (const char **targets, const char **target_percents,
unsigned int n, int terminal, struct dep *deps,
struct commands *commands, int override)
{
unsigned int max_targets, i;
struct rule *r = (struct rule *) xmalloc (sizeof (struct rule));
unsigned int i;
struct rule *r = xmalloc (sizeof (struct rule));
r->num = n;
r->cmds = commands;
r->deps = deps;
r->targets = targets;
r->suffixes = target_percents;
r->lens = xmalloc (n * sizeof (unsigned int));
max_targets = 2;
r->lens = (unsigned int *) xmalloc (2 * sizeof (unsigned int));
r->suffixes = (char **) xmalloc (2 * sizeof (char *));
for (i = 0; targets[i] != 0; ++i)
for (i = 0; i < n; ++i)
{
if (i == max_targets - 1)
{
max_targets += 5;
r->lens = (unsigned int *)
xrealloc ((char *) r->lens, max_targets * sizeof (unsigned int));
r->suffixes = (char **)
xrealloc ((char *) r->suffixes, max_targets * sizeof (char *));
}
r->lens[i] = strlen (targets[i]);
r->suffixes[i] = (target_percents == 0 ? find_percent (targets[i])
: target_percents[i]) + 1;
if (r->suffixes[i] == 0)
abort ();
}
if (i < max_targets - 1)
{
r->lens = (unsigned int *) xrealloc ((char *) r->lens,
(i + 1) * sizeof (unsigned int));
r->suffixes = (char **) xrealloc ((char *) r->suffixes,
(i + 1) * sizeof (char *));
assert (r->suffixes[i] != NULL);
++r->suffixes[i];
}
if (new_pattern_rule (r, override))
@@ -517,23 +474,17 @@ create_pattern_rule (char **targets, char **target_percents,
static void /* Useful to call from gdb. */
print_rule (struct rule *r)
{
register unsigned int i;
register struct dep *d;
unsigned int i;
for (i = 0; r->targets[i] != 0; ++i)
for (i = 0; i < r->num; ++i)
{
fputs (r->targets[i], stdout);
if (r->targets[i + 1] != 0)
putchar (' ');
else
putchar (':');
putchar ((i + 1 == r->num) ? ':' : ' ');
}
if (r->terminal)
putchar (':');
for (d = r->deps; d != 0; d = d->next)
printf (" %s", dep_name (d));
putchar ('\n');
print_prereqs (r->deps);
if (r->cmds != 0)
print_commands (r->cmds);
@@ -542,8 +493,8 @@ print_rule (struct rule *r)
void
print_rule_data_base (void)
{
register unsigned int rules, terminal;
register struct rule *r;
unsigned int rules, terminal;
struct rule *r;
puts (_("\n# Implicit Rules"));
@@ -580,7 +531,7 @@ print_rule_data_base (void)
/* This can happen if a fatal error was detected while reading the
makefiles and thus count_implicit_rule_limits wasn't called yet. */
if (num_pattern_rules != 0)
fatal (NILF, _("BUG: num_pattern_rules wrong! %u != %u"),
fatal (NILF, _("BUG: num_pattern_rules is wrong! %u != %u"),
num_pattern_rules, rules);
}
}

33
rule.h
View File

@@ -1,31 +1,33 @@
/* 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 Free Software
Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
/* Structure used for pattern rules. */
/* Structure used for pattern (implicit) rules. */
struct rule
{
struct rule *next;
char **targets; /* Targets of the rule. */
const char **targets; /* Targets of the rule. */
unsigned int *lens; /* Lengths of each target. */
char **suffixes; /* Suffixes (after `%') of each target. */
const char **suffixes; /* Suffixes (after `%') of each target. */
struct dep *deps; /* Dependencies of the rule. */
struct commands *cmds; /* Commands to execute. */
unsigned short num; /* Number of targets. */
char terminal; /* If terminal (double-colon). */
char in_use; /* If in use by a parent pattern_search. */
};
@@ -49,12 +51,9 @@ extern struct file *suffix_file;
extern unsigned int maxsuffix;
extern void install_pattern_rule PARAMS ((struct pspec *p, int terminal));
extern int new_pattern_rule PARAMS ((struct rule *rule, int override));
extern void count_implicit_rule_limits PARAMS ((void));
extern void convert_to_pattern PARAMS ((void));
extern void create_pattern_rule PARAMS ((char **targets,
char **target_percents, int terminal,
struct dep *deps,
struct commands *commands,
int override));
void count_implicit_rule_limits (void);
void convert_to_pattern (void);
void install_pattern_rule (struct pspec *p, int terminal);
void create_pattern_rule (const char **targets, const char **target_percents,
unsigned int num, int terminal, struct dep *deps,
struct commands *commands, int override);

View File

@@ -1,19 +1,20 @@
/* 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 Free Software Foundation, Inc.
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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
#include "make.h"
@@ -228,7 +229,7 @@ signame_init (void)
char *
strsignal (int signal)
strsignal (int sig)
{
static char buf[] = "Signal 12345678901234567890";
@@ -245,10 +246,10 @@ strsignal (int signal)
# endif
#endif
if (signal > 0 || signal < NSIG)
return (char *) sys_siglist[signal];
if (sig > 0 || sig < NSIG)
return (char *) sys_siglist[sig];
sprintf (buf, "Signal %d", signal);
sprintf (buf, "Signal %d", sig);
return buf;
}

View File

@@ -1,18 +1,18 @@
/* Constant string caching for GNU Make.
Copyright (C) 2006 Free Software Foundation, Inc.
Copyright (C) 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 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
this program. If not, see <http://www.gnu.org/licenses/>. */
#include "make.h"
@@ -20,8 +20,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */
#include "hash.h"
/* The size (in bytes) of each cache buffer. */
#define CACHE_BUFFER_SIZE (4096)
/* 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
@@ -39,11 +40,16 @@ struct strcache {
static int bufsize = CACHE_BUFFER_SIZE;
static struct strcache *strcache = NULL;
/* 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
buffers will be filled in. However, GNU make has so many smaller strings
that this doesn't seem to be much of an issue in practice.
*/
static struct strcache *
new_cache()
{
struct strcache *new;
new = (struct strcache *) xmalloc (sizeof (*new) + bufsize);
new = xmalloc (sizeof (*new) + bufsize);
new->end = new->buffer;
new->count = 0;
new->bytesfree = bufsize;
@@ -61,9 +67,9 @@ add_string(const char *str, int len)
struct strcache *sp;
const char *res;
/* 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 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;
@@ -113,14 +119,18 @@ str_hash_cmp (const void *x, const void *y)
}
static struct hash_table strings;
static unsigned long total_adds = 0;
static const char *
add_hash (const char *str, int len)
{
/* Look up the string in the hash. If it's there, return it. */
char **slot = (char **) hash_find_slot (&strings, str);
char *const *slot = (char *const *) hash_find_slot (&strings, str);
const char *key = *slot;
/* Count the total number of adds we performed. */
++total_adds;
if (!HASH_VACANT (key))
return key;
@@ -155,11 +165,17 @@ strcache_add (const char *str)
const char *
strcache_add_len (const char *str, int len)
{
char *key = alloca (len + 1);
memcpy (key, str, len);
key[len] = '\0';
/* If we're not given a nul-terminated string we have to create one, because
the hashing functions expect it. */
if (str[len] != '\0')
{
char *key = alloca (len + 1);
memcpy (key, str, len);
key[len] = '\0';
str = key;
}
return add_hash (key, len);
return add_hash (str, len);
}
int
@@ -173,7 +189,7 @@ strcache_setbufsize(int size)
void
strcache_init (void)
{
hash_init (&strings, 1000, str_hash_1, str_hash_2, str_hash_cmp);
hash_init (&strings, 8000, str_hash_1, str_hash_2, str_hash_cmp);
}
@@ -185,32 +201,46 @@ 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;
const struct strcache *sp;
int lastused = 0, lastfree = 0;
for (sp = strcache; sp != NULL; sp = sp->next)
if (strcache)
{
int bf = sp->bytesfree;
int sz = (sp->end - sp->buffer) + bf;
const struct strcache *sp;
++numbuffs;
numstrs += sp->count;
/* Count the first buffer separately since it's not full. */
lastused = strcache->end - strcache->buffer;
lastfree = strcache->bytesfree;
totsize += sz;
maxsize = (sz > maxsize ? sz : maxsize);
minsize = (sz < minsize ? sz : minsize);
for (sp = strcache->next; sp != NULL; sp = sp->next)
{
int bf = sp->bytesfree;
int sz = sp->end - sp->buffer;
totfree += bf;
maxfree = (bf > maxfree ? bf : maxfree);
minfree = (bf < minfree ? bf : minfree);
++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);
}
}
avgsize = numbuffs ? (int)(totsize / numbuffs) : 0;
avgfree = numbuffs ? (int)(totfree / numbuffs) : 0;
printf (_("\n%s # of strings in strcache: %d\n"), prefix, numstrs);
printf (_("%s # of strcache buffers: %d\n"), prefix, numbuffs);
printf (_("%s strcache size: total = %d / max = %d / min = %d / avg = %d\n"),
prefix, totsize, maxsize, minsize, avgsize);
printf (_("%s strcache free: total = %d / max = %d / min = %d / avg = %d\n"),
prefix, totfree, maxfree, minfree, avgfree);
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);
fputs (_("\n# strcache hash-table stats:\n# "), stdout);
hash_print_stats (&strings, stdout);
}

View File

@@ -1,21 +1,20 @@
@echo off
rem Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
rem 2005, 2006 Free Software Foundation, Inc.
rem 2005, 2006, 2007, 2008, 2009, 2010 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
rem the terms of the GNU General Public License as published by the Free
rem Software Foundation; either version 2, or (at your option) any later
rem version.
rem Software Foundation; either version 3 of the License, or (at your option)
rem any later version.
rem
rem GNU Make is distributed in the hope that it will be useful, but WITHOUT
rem ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
rem FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for.
rem more details.
rem
rem You should have received a copy of the GNU General Public License along
rem with GNU Make; see the file COPYING. If not, write to the Free Software
rem Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
rem with this program. If not, see <http://www.gnu.org/licenses/>.
cd w32\subproc
set MAKE=%2

View File

@@ -1,285 +1,626 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
TERMS AND CONDITIONS
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
0. Definitions.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
"This License" refers to version 3 of the GNU General Public License.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
A "covered work" means either the unmodified Program or a work based
on the Program.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
1. Source Code.
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
The Corresponding Source for a work in source code form is that
same work.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
13. Use with the GNU Affero General Public License.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
14. Revised Versions of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
NO WARRANTY
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
15. Disclaimer of Warranty.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@@ -287,15 +628,15 @@ free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
This program 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 2 of the License, or
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -304,36 +645,30 @@ the "copyright" line and a pointer to where the full notice is found.
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, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@@ -1,3 +1,244 @@
2010-07-28 Paul Smith <psmith@gnu.org>
* scripts/targets/POSIX: Compatibility issues with Solaris (and
Tru64?); "false" returns different exit codes, and set -x shows
output with extra whitespace. Run the commands by hand first to
find out what the real shell would do, then compare what make does.
* scripts/variables/SHELL: Ditto.
2010-07-12 Paul Smith <psmith@gnu.org>
* test_driver.pl: Add a new $perl_name containing the path to Perl.
* run_make_tests.pl (run_make_test): Replace the special string
#PERL# in a makefile etc. with the path the Perl executable so
makefiles can use it.
* scripts/targets/ONESHELL: Add a new set of regression tests for
the .ONESHELL feature.
2010-07-06 Paul Smith <psmith@gnu.org>
* scripts/variables/SHELL: Test the new .SHELLFLAGS variable.
* scripts/targets/POSIX: New file. Test the .POSIX special target.
Verify that enabling .POSIX changes the shell flags to set -e.
2010-07-01 Paul Smith <psmith@gnu.org>
* scripts/features/recursion: Add a space to separate command-line
args. Fixes Savannah bug #29968.
2009-11-12 Boris Kolpackov <boris@codesynthesis.com>
* scripts/features/vpath3: Test for the new library search
behavior.
2009-10-06 Boris Kolpackov <boris@codesynthesis.com>
* scripts/features/se_explicit: Enable the test for now fixed
Savannah bug 25780.
2009-10-06 Boris Kolpackov <boris@codesynthesis.com>
* scripts/variables/undefine: Tests for the new undefine feature.
2009-10-03 Paul Smith <psmith@gnu.org>
* scripts/features/parallelism: Test for open Savannah bug #26846.
* scripts/variables/MAKE: Rewrite for new run_make_test() format.
* scripts/variables/MAKEFLAGS: Created.
Add test for Savannah bug #2216 (still open).
* scripts/features/include: Test for Savannah bug #102 (still open).
2009-09-30 Boris Kolpackov <boris@codesynthesis.com>
* scripts/features/include: Add diagnostics issuing tests for
cases where targets have been updated and failed with the
dontcare flag. Savannah bugs #15110, #25493, #12686, #17740.
2009-09-28 Paul Smith <psmith@gnu.org>
* scripts/functions/shell: Add regression test for Savannah bug
#20513 (still open).
* scripts/features/se_explicit: Add regression tests for Savannah
bug #25780 (still open).
* run_make_tests.pl (valid_option): Add a new flag, -all([-_]?tests)?
that runs tests we know will fail. This allows us to add
regression tests to the test suite for bugs that haven't been
fixed yet.
2009-09-28 Boris Kolpackov <boris@codesynthesis.com>
* scripts/features/patspecific_vars: Add a test for the shortest
stem first order.
* scripts/features/patternrules: Add a test for the shortest stem
first order.
2009-09-24 Paul Smith <psmith@gnu.org>
* scripts/features/se_implicit: Add a test for order-only
secondary expansion prerequisites.
2009-09-23 Paul Smith <psmith@gnu.org>
* scripts/features/patternrules: Test that we can remove pattern
rules, both single and multiple prerequisites. Savannah bug #18622.
* scripts/features/echoing: Rework for run_make_test().
2009-06-14 Paul Smith <psmith@gnu.org>
* scripts/features/vpath: Verify we don't get bogus circular
dependency warnings if we choose a different file via vpath during
update. Savannah bug #13529.
2009-06-13 Paul Smith <psmith@gnu.org>
* scripts/variables/MAKEFILES: Verify that MAKEFILES included
files (and files included by them) don't set the default goal.
Savannah bug #13401.
* scripts/functions/wildcard: Test that wildcards with
non-existent glob matchers return empty.
2009-06-09 Paul Smith <psmith@gnu.org>
* scripts/options/dash-B: Test the $? works correctly with -B.
Savannah bug #17825.
* scripts/features/patternrules: Test that dependencies of
"also_make" targets are created properly. Savannah bug #19108.
* test_driver.pl (compare_output): Create a "run" file for failed
tests containing the command that was run.
(get_runfile): New function.
* run_make_tests.pl (valid_option): Enhanced support for valgrind:
allow memcheck and massif tools.
* scripts/features/patternrules: Have to comment out a line in the
first test due to backing out a change that broke the implicit
rule search algorithm. Savannah bug #17752.
* scripts/misc/general4: Remove a test that is redundant with
patternrules.
* scripts/features/parallelism: Add a test for re-exec with
jobserver master override. Savannah bug #18124.
2009-06-08 Paul Smith <psmith@gnu.org>
* scripts/features/targetvars: Add a test for continued target
vars after a semicolon. Savannah bug #17521.
2009-06-07 Paul Smith <psmith@gnu.org>
* scripts/features/se_explicit: Make sure we catch defining
prereqs during snap_deps(). Savannah bug #24622.
* scripts/variables/automatic: Check prereq ordering when the
target with the recipe has no prereqs. Savannah bug #21198.
* scripts/variables/LIBPATTERNS: Add a new set of test for
$(.LIBPATTERNS) (previously untested!)
2009-06-04 Paul Smith <psmith@gnu.org>
* scripts/variables/SHELL: The export target-specific SHELL test
has an incorrect known-good-value.
* scripts/misc/general4: Check for whitespace (ffeed, vtab, etc.)
* scripts/features/se_explicit: Add tests for Savannah bug #24588.
2009-05-31 Paul Smith <psmith@gnu.org>
* scripts/variables/DEFAULT_GOAL: Add tests for Savannah bug #25697.
* scripts/features/targetvars: Add tests of overrides for Savannah
bug #26207.
* scripts/features/patspecific_vars: Ditto.
* scripts/features/patternrules: Add a test for Savannah bug #26593.
2009-05-30 Paul Smith <psmith@gnu.org>
* scripts/variables/flavors: Update with new variable flavor tests.
* scripts/variables/define: Create a new set of tests for
define/endef and move those aspects of the flavors suite here.
2009-05-25 Paul Smith <psmith@gnu.org>
* scripts/features/targetvars: Ditto.
* scripts/features/export: Test new variable parsing abilities.
2009-02-23 Ramon Garcia <ramon.garcia.f@gmail.com>
* scripts/variables/private: Create a new suite of tests for 'private'.
2007-11-04 Paul Smith <psmith@gnu.org>
* scripts/functions/eval: Update error message for command -> recipe.
* test_driver.pl (compare_output): Allow the answer to be a regex,
if surrounded by '/'.
* scripts/misc/close_stdout: Use a regex for the answer, since
sometimes the error will have a description and sometimes it won't.
2007-09-10 Paul Smith <psmith@gnu.org>
* scripts/variables/special: Add tests for .RECIPEPREFIX variable.
2007-08-15 Paul Smith <psmith@gnu.org>
These test cases were contributed by
Icarus Sparry <savannah@icarus.freeuk.com> and J. David Bryan for
Savannah bugs #3330 and #15919.
* scripts/targets/SECONDARY: Add tests for Savannah bugs 3330 and
15919.
* scripts/features/parallelism: Add tests for wrong answer/hang
combining INTERMEDIATE, order-only prereqs, and parallelism.
See Savannah bugs 3330 and 15919.
2007-07-13 Paul Smith <psmith@gnu.org>
Install a timeout so tests can never loop infinitely.
Original idea and patch for a single-test version provided by
Icarus Sparry <savannah@icarus.freeuk.com>
* test_driver.pl (_run_command): New function: this is called by
other functions to actually run a command. Before we run it,
install a SIGALRM handler and set up a timer to go off in the
future (default is 5s; this can be overridden by individual tests).
(run_command): Call it.
(run_command_with_output): Call it.
* run_make_tests.pl (run_make_with_options): Override the default
timeout if the caller requests it.
(run_make_test): Pass any timeout override to run_make_with_options.
* scripts/features/parallelism: Increase the timeout for long tests.
* scripts/options/dash-l: Ditto.
2006-10-01 Paul Smith <psmith@paulandlesley.org>
* run_make_tests.pl (set_more_defaults): Remove setting of LANG in
ENV here. This doesn't always work.
* test_driver.pl (toplevel): Set LC_ALL to 'C' in the make
environment. Fixes Savannah bug #16698.
2006-09-30 Paul Smith <psmith@paulandlesley.org>
* scripts/variables/automatic: Add back the test for bug #8154.
2006-04-01 Paul D. Smith <psmith@gnu.org>
* scripts/functions/realpath: Don't run tests with multiple
@@ -822,17 +1063,17 @@
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
2002, 2003, 2004, 2005, 2006, 2007, 2008, 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
terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
this program. If not, see <http://www.gnu.org/licenses/>.

View File

@@ -163,17 +163,17 @@ Changes from 0.1 to 0.2 (5-4-92):
-------------------------------------------------------------------------------
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
2002, 2003, 2004, 2005, 2006, 2007, 2008, 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
terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
this program. If not, see <http://www.gnu.org/licenses/>.

View File

@@ -8,20 +8,20 @@ distributed under the following terms:
-----------------------------------------------------------------------------
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
2002, 2003, 2004, 2005, 2006, 2007, 2008, 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
terms of the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version.
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
GNU Make; see the file COPYING. If not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
this program. If not, see <http://www.gnu.org/licenses/>.
-----------------------------------------------------------------------------
The test suite requires Perl. These days, you should have at least Perl

View File

@@ -4,20 +4,22 @@
# Typically you'd put the shadow in /tmp or another local disk
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# 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 2, or (at your option) any later version.
# 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.
# 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
# GNU Make; see the file COPYING. If not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
# this program. If not, see <http://www.gnu.org/licenses/>.
case "$1" in
"") echo 'Usage: mkshadow <destdir>'; exit 1 ;;

View File

@@ -12,25 +12,34 @@
# (and others)
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# 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 2, or (at your option) any later version.
# 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.
# 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
# GNU Make; see the file COPYING. If not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
# this program. If not, see <http://www.gnu.org/licenses/>.
$valgrind = 0; # invoke make with valgrind
$valgrind_args = '--num-callers=15 --tool=memcheck --leak-check=full';
$valgrind_args = '';
$memcheck_args = '--num-callers=15 --tool=memcheck --leak-check=full';
$massif_args = '--num-callers=15 --tool=massif --alloc-fn=xmalloc --alloc-fn=xcalloc --alloc-fn=xrealloc --alloc-fn=xstrdup --alloc-fn=xstrndup';
$pure_log = undef;
$command_string = '';
$all_tests = 0;
require "test_driver.pl";
# Some target systems might not have the POSIX module...
@@ -42,20 +51,30 @@ sub valid_option
{
local($option) = @_;
if ($option =~ /^-make([-_]?path)?$/)
{
$make_path = shift @argv;
if (!-f $make_path)
{
print "$option $make_path: Not found.\n";
exit 0;
}
return 1;
if ($option =~ /^-make([-_]?path)?$/i) {
$make_path = shift @argv;
if (!-f $make_path) {
print "$option $make_path: Not found.\n";
exit 0;
}
return 1;
}
if ($option =~ /^-valgrind$/i) {
$valgrind = 1;
return 1;
if ($option =~ /^-all([-_]?tests)?$/i) {
$all_tests = 1;
return 1;
}
if ($option =~ /^-(valgrind|memcheck)$/i) {
$valgrind = 1;
$valgrind_args = $memcheck_args;
return 1;
}
if ($option =~ /^-massif$/i) {
$valgrind = 1;
$valgrind_args = $massif_args;
return 1;
}
# This doesn't work--it _should_! Someone badly needs to fix this.
@@ -81,7 +100,7 @@ $old_makefile = undef;
sub run_make_test
{
local ($makestring, $options, $answer, $err_code) = @_;
local ($makestring, $options, $answer, $err_code, $timeout) = @_;
# If the user specified a makefile string, create a new makefile to contain
# it. If the first value is not defined, use the last one (if there is
@@ -104,6 +123,7 @@ sub run_make_test
$makestring =~ s/#MAKEFILE#/$makefile/g;
$makestring =~ s/#MAKEPATH#/$mkpath/g;
$makestring =~ s/#MAKE#/$make_name/g;
$makestring =~ s/#PERL#/$perl_name/g;
$makestring =~ s/#PWD#/$pwd/g;
# Populate the makefile!
@@ -118,9 +138,11 @@ sub run_make_test
$answer =~ s/#MAKEFILE#/$makefile/g;
$answer =~ s/#MAKEPATH#/$mkpath/g;
$answer =~ s/#MAKE#/$make_name/g;
$answer =~ s/#PERL#/$perl_name/g;
$answer =~ s/#PWD#/$pwd/g;
&run_make_with_options($makefile, $options, &get_logfile(0), $err_code);
run_make_with_options($makefile, $options, &get_logfile(0),
$err_code, $timeout);
&compare_output($answer, &get_logfile(1));
$old_makefile = $makefile;
@@ -129,7 +151,7 @@ sub run_make_test
# The old-fashioned way...
sub run_make_with_options {
local ($filename,$options,$logname,$expected_code) = @_;
local ($filename,$options,$logname,$expected_code,$timeout) = @_;
local($code);
local($command) = $make_path;
@@ -146,11 +168,24 @@ sub run_make_with_options {
$command .= " $options";
}
$command_string = "$command\n";
if ($valgrind) {
print VALGRIND "\n\nExecuting: $command\n";
}
$code = &run_command_with_output($logname,$command);
{
my $old_timeout = $test_timeout;
$timeout and $test_timeout = $timeout;
# If valgrind is enabled, turn off the timeout check
$valgrind and $test_timeout = 0;
$code = &run_command_with_output($logname,$command);
$test_timeout = $old_timeout;
}
# Check to see if we have Purify errors. If so, keep the logfile.
# For this to work you need to build with the Purify flag -exit-status=yes
@@ -173,10 +208,12 @@ sub run_make_with_options {
if ($code != $expected_code) {
print "Error running $make_path (expected $expected_code; got $code): $command\n";
$test_passed = 0;
$runf = &get_runfile;
&create_file (&get_runfile, $command_string);
# If it's a SIGINT, stop here
if ($code & 127) {
print STDERR "\nCaught signal ".($code & 127)."!\n";
exit($code);
($code & 127) == 2 and exit($code);
}
return 0;
}
@@ -185,18 +222,28 @@ sub run_make_with_options {
system "add_profile $make_path";
}
1;
return 1;
}
sub print_usage
{
&print_standard_usage ("run_make_tests", "[-make_path make_pathname]");
&print_standard_usage ("run_make_tests",
"[-make_path make_pathname] [-memcheck] [-massif]",);
}
sub print_help
{
&print_standard_help ("-make_path",
"\tYou may specify the pathname of the copy of make to run.");
&print_standard_help (
"-make_path",
"\tYou may specify the pathname of the copy of make to run.",
"-valgrind",
"-memcheck",
"\tRun the test suite under valgrind's memcheck tool.",
"\tChange the default valgrind args with the VALGRIND_ARGS env var.",
"-massif",
"\tRun the test suite under valgrind's massif toool.",
"\tChange the default valgrind args with the VALGRIND_ARGS env var."
);
}
sub get_this_pwd {
@@ -228,11 +275,6 @@ sub set_more_defaults
local($string);
local($index);
# Make sure we're in the C locale for those systems that support it,
# so sorting, etc. is predictable.
#
$ENV{LANG} = 'C';
# find the type of the port. We do this up front to have a single
# point of change if it needs to be tweaked.
#
@@ -328,11 +370,12 @@ sub set_more_defaults
# Set up for valgrind, if requested.
if ($valgrind) {
my $args = $valgrind_args;
open(VALGRIND, "> valgrind.out")
|| die "Cannot open valgrind.out: $!\n";
# -q --leak-check=yes
exists $ENV{VALGRIND_ARGS} and $valgrind_args = $ENV{VALGRIND_ARGS};
$make_path = "valgrind --log-fd=".fileno(VALGRIND)." $valgrind_args $make_path";
exists $ENV{VALGRIND_ARGS} and $args = $ENV{VALGRIND_ARGS};
$make_path = "valgrind --log-fd=".fileno(VALGRIND)." $args $make_path";
# F_SETFD is 2
fcntl(VALGRIND, 2, 0) or die "fcntl(setfd) failed: $!\n";
system("echo Starting on `date` 1>&".fileno(VALGRIND));

View File

@@ -1,87 +1,64 @@
$description = "The following test creates a makefile to test command \n"
."echoing. It tests that when a command line starts with \n"
."a '\@', the echoing of that line is suppressed. It also \n"
."tests the -n option which tells make to ONLY echo the \n"
."commands and no execution happens. In this case, even \n"
."the commands with '\@' are printed. Lastly, it tests the \n"
."-s flag which tells make to prevent all echoing, as if \n"
."all commands started with a '\@'.";
# -*-perl-*-
$description = "The following test creates a makefile to test command
echoing. It tests that when a command line starts with
a '\@', the echoing of that line is suppressed. It also
tests the -n option which tells make to ONLY echo the
commands and no execution happens. In this case, even
the commands with '\@' are printed. Lastly, it tests the
-s flag which tells make to prevent all echoing, as if
all commands started with a '\@'.";
$details = "This test is similar to the 'clean' test except that a '\@' has\n"
."been placed in front of the delete command line. Four tests \n"
."are run here. First, make is run normally and the first echo\n"
."command should be executed. In this case there is no '\@' so \n"
."we should expect make to display the command AND display the \n"
."echoed message. Secondly, make is run with the clean target, \n"
."but since there is a '\@' at the beginning of the command, we\n"
."expect no output; just the deletion of a file which we check \n"
."for. Third, we give the clean target again except this time\n"
."we give make the -n option. We now expect the command to be \n"
."displayed but not to be executed. In this case we need only \n"
."to check the output since an error message would be displayed\n"
."if it actually tried to run the delete command again and the \n"
."file didn't exist. Lastly, we run the first test again with \n"
."the -s option and check that make did not echo the echo \n"
."command before printing the message.";
$details = "This test is similar to the 'clean' test except that a '\@' has
been placed in front of the delete command line. Four tests
are run here. First, make is run normally and the first echo
command should be executed. In this case there is no '\@' so
we should expect make to display the command AND display the
echoed message. Secondly, make is run with the clean target,
but since there is a '\@' at the beginning of the command, we
expect no output; just the deletion of a file which we check
for. Third, we give the clean target again except this time
we give make the -n option. We now expect the command to be
displayed but not to be executed. In this case we need only
to check the output since an error message would be displayed
if it actually tried to run the delete command again and the
file didn't exist. Lastly, we run the first test again with
the -s option and check that make did not echo the echo
command before printing the message.\n";
$example = "EXAMPLE_FILE";
open(MAKEFILE,"> $makefile");
# The Contents of the MAKEFILE ...
print MAKEFILE "all: \n";
print MAKEFILE "\techo This makefile did not clean the dir... good\n";
print MAKEFILE "clean: \n";
print MAKEFILE "\t\@$delete_command $example\n";
# END of Contents of MAKEFILE
close(MAKEFILE);
&touch($example);
touch($example);
# TEST #1
# -------
&run_make_with_options($makefile,"",&get_logfile,0);
$answer = "echo This makefile did not clean the dir... good\n"
."This makefile did not clean the dir... good\n";
&compare_output($answer,&get_logfile(1));
run_make_test("
all:
\techo This makefile did not clean the dir... good
clean:
\t\@$delete_command $example\n",
'', 'echo This makefile did not clean the dir... good
This makefile did not clean the dir... good');
# TEST #2
# -------
&run_make_with_options($makefile,"clean",&get_logfile,0);
run_make_test(undef, 'clean', '');
if (-f $example) {
$test_passed = 0;
unlink($example);
}
&compare_output('',&get_logfile(1));
# TEST #3
# -------
&run_make_with_options($makefile,"-n clean",&get_logfile,0);
$answer = "$delete_command $example\n";
&compare_output($answer,&get_logfile(1));
run_make_test(undef, '-n clean', "$delete_command $example\n");
# TEST #4
# -------
&run_make_with_options($makefile,"-s",&get_logfile,0);
$answer = "This makefile did not clean the dir... good\n";
&compare_output($answer,&get_logfile(1));
run_make_test(undef, '-s', "This makefile did not clean the dir... good\n");
1;

View File

@@ -6,12 +6,7 @@ $details = "";
# The test driver cleans out our environment for us so we don't have to worry
# about that here.
open(MAKEFILE,"> $makefile");
# The Contents of the MAKEFILE ...
print MAKEFILE <<'EOMAKE';
&run_make_test('
FOO = foo
BAR = bar
BOZ = boz
@@ -40,76 +35,44 @@ endif
all:
@echo "FOO=$(FOO) BAR=$(BAR) BAZ=$(BAZ) BOZ=$(BOZ) BITZ=$(BITZ) BOTZ=$(BOTZ)"
@echo "FOO=$$FOO BAR=$$BAR BAZ=$$BAZ BOZ=$$BOZ BITZ=$$BITZ BOTZ=$$BOTZ"
EOMAKE
close(MAKEFILE);
# TEST 0: basics
&run_make_with_options($makefile,"",&get_logfile,0);
$answer = "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
FOO= BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n";
&compare_output($answer,&get_logfile(1));
',
'', "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
FOO= BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n");
# TEST 1: make sure vars inherited from the parent are exported
$extraENV{FOO} = 1;
&run_make_with_options($makefile,"",&get_logfile,0);
$answer = "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
FOO=foo BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n";
&compare_output($answer,&get_logfile(1));
&run_make_test(undef, '', "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
FOO=foo BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n");
# TEST 2: global export. Explicit unexport takes precedence.
&run_make_with_options($makefile,"EXPORT_ALL=1",&get_logfile,0);
$answer = "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n";
&compare_output($answer,&get_logfile(1));
run_make_test(undef, "EXPORT_ALL=1" ,
"FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n");
# TEST 3: global unexport. Explicit export takes precedence.
&run_make_with_options($makefile,"UNEXPORT_ALL=1",&get_logfile,0);
$answer = "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
FOO= BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n";
&compare_output($answer,&get_logfile(1));
&run_make_test(undef, "UNEXPORT_ALL=1",
"FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
FOO= BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n");
# TEST 4: both: in the above makefile the unexport comes last so that rules.
&run_make_with_options($makefile,"EXPORT_ALL=1 UNEXPORT_ALL=1",&get_logfile,0);
$answer = "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
FOO= BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n";
&compare_output($answer,&get_logfile(1));
&run_make_test(undef, "EXPORT_ALL=1 UNEXPORT_ALL=1",
"FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
FOO= BAR= BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n");
# TEST 5: test the pseudo target.
&run_make_with_options($makefile,"EXPORT_ALL_PSEUDO=1",&get_logfile,0);
$answer = "FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n";
&compare_output($answer,&get_logfile(1));
&run_make_test(undef, "EXPORT_ALL_PSEUDO=1",
"FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=botz
FOO=foo BAR=bar BAZ=baz BOZ=boz BITZ=bitz BOTZ=\n");
# TEST 6: Test the expansion of variables inside export
$makefile2 = &get_tmpfile;
open(MAKEFILE, "> $makefile2");
print MAKEFILE <<'EOF';
&run_make_test('
foo = f-ok
bar = b-ok
@@ -125,24 +88,12 @@ export $(B)ar
all:
@echo foo=$(foo) bar=$(bar)
@echo foo=$$foo bar=$$bar
EOF
close(MAKEFILE);
&run_make_with_options($makefile2,"",&get_logfile,0);
$answer = "foo=f-ok bar=b-ok\nfoo=f-ok bar=b-ok\n";
&compare_output($answer,&get_logfile(1));
',
"", "foo=f-ok bar=b-ok\nfoo=f-ok bar=b-ok\n");
# TEST 7: Test the expansion of variables inside unexport
$makefile3 = &get_tmpfile;
open(MAKEFILE, "> $makefile3");
print MAKEFILE <<'EOF';
&run_make_test('
foo = f-ok
bar = b-ok
@@ -160,24 +111,12 @@ unexport $(B)ar
all:
@echo foo=$(foo) bar=$(bar)
@echo foo=$$foo bar=$$bar
EOF
close(MAKEFILE);
&run_make_with_options($makefile3,"",&get_logfile,0);
$answer = "foo=f-ok bar=b-ok\nfoo= bar=\n";
&compare_output($answer,&get_logfile(1));
',
'', "foo=f-ok bar=b-ok\nfoo= bar=\n");
# TEST 7: Test exporting multiple variables on the same line
$makefile4 = &get_tmpfile;
open(MAKEFILE, "> $makefile4");
print MAKEFILE <<'EOF';
&run_make_test('
A = a
B = b
C = c
@@ -196,23 +135,14 @@ export F G H I J
export D E $(SOME)
all: ; @echo A=$$A B=$$B C=$$C D=$$D E=$$E F=$$F G=$$G H=$$H I=$$I J=$$J
EOF
close(MAKEFILE);
&run_make_with_options($makefile4,"",&get_logfile,0);
$answer = "A=a B=b C=c D=d E=e F=f G=g H=h I=i J=j\n";
&compare_output($answer,&get_logfile(1));
',
'', "A=a B=b C=c D=d E=e F=f G=g H=h I=i J=j\n");
# TEST 8: Test unexporting multiple variables on the same line
$makefile5 = &get_tmpfile;
open(MAKEFILE, "> $makefile5");
print MAKEFILE <<'EOF';
@extraENV{qw(A B C D E F G H I J)} = qw(1 2 3 4 5 6 7 8 9 10);
&run_make_test('
A = a
B = b
C = c
@@ -231,16 +161,26 @@ unexport F G H I J
unexport D E $(SOME)
all: ; @echo A=$$A B=$$B C=$$C D=$$D E=$$E F=$$F G=$$G H=$$H I=$$I J=$$J
EOF
',
'', "A= B= C= D= E= F= G= H= I= J=\n");
close(MAKEFILE);
# TEST 9: Check setting a variable named "export"
@extraENV{qw(A B C D E F G H I J)} = qw(1 2 3 4 5 6 7 8 9 10);
&run_make_test('
export = 123
export export
export export = 456
a: ; @echo "\$$(export)=$(export) / \$$export=$$export"
',
'', "\$(export)=456 / \$export=456\n");
&run_make_with_options($makefile5,"",&get_logfile,0);
$answer = "A= B= C= D= E= F= G= H= I= J=\n";
&compare_output($answer,&get_logfile(1));
# TEST 9: Check "export" as a target
&run_make_test('
a: export
export: ; @echo "$@"
',
'', "export\n");
# This tells the test driver that the perl test script executed properly.
1;

View File

@@ -90,8 +90,6 @@ all: ; @:
foo: bar; @:
', '', '');
1;
# Make sure that we don't die when the command fails but we dontcare.
# (Savannah bug #13216).
@@ -117,4 +115,65 @@ include
-include
sinclude', '', '');
# Test that the diagnostics is issued even if the target has been
# tried before with the dontcare flag (direct dependency case).
#
run_make_test('
-include foo
all: bar
foo: baz
bar: baz
',
'',
"#MAKE#: *** No rule to make target `baz', needed by `bar'. Stop.\n",
512);
# Test that the diagnostics is issued even if the target has been
# tried before with the dontcare flag (indirect dependency case).
#
run_make_test('
-include foo
all: bar
foo: baz
bar: baz
baz: end
',
'',
"#MAKE#: *** No rule to make target `end', needed by `baz'. Stop.\n",
512);
# Test that the diagnostics is issued even if the target has been
# tried before with the dontcare flag (include/-include case).
#
run_make_test('
include bar
-include foo
all:
foo: baz
bar: baz
baz: end
',
'',
"#MAKEFILE#:2: bar: No such file or directory
#MAKE#: *** No rule to make target `end', needed by `baz'. Stop.\n",
512);
if ($all_tests) {
# Test that include of a rebuild-able file doesn't show a warning
# Savannah bug #102
run_make_test(q!
include foo
foo: ; @echo foo = bar > $@
!,
'', "#MAKE#: `foo' is up to date.\n");
rmfiles('foo');
}
1;

View File

@@ -1,34 +1,45 @@
$description = "The following test creates a makefile to ...";
# -*-perl-*-
$description = "Test the override directive on variable assignments.";
$details = "";
open(MAKEFILE,"> $makefile");
# TEST 0: Basic override
# The Contents of the MAKEFILE ...
run_make_test('
X = start
override recur = $(X)
override simple := $(X)
X = end
all: ; @echo "$(recur) $(simple)"
',
'recur=I simple=J', "end start\n");
print MAKEFILE "override define foo\n"
."\@echo First comes the definition.\n"
."\@echo Then comes the override.\n"
."endef\n"
."all: \n"
."\t\$(foo)\n";
# TEST 1: Override with append
# END of Contents of MAKEFILE
run_make_test('
X += X1
override X += X2
override Y += Y1
Y += Y2
all: ; @echo "$(X) $(Y)"
',
'', "X1 X2 Y1\n");
close(MAKEFILE);
# TEST 2: Override with append to the command line
&run_make_with_options($makefile,"foo=Hello",&get_logfile);
run_make_test(undef, 'X=C Y=C', "C X2 C Y1\n");
# Create the answer to what should be produced by this Makefile
$answer = "First comes the definition.\n"
."Then comes the override.\n";
# Test override of define/endef
run_make_test('
override define foo
@echo First comes the definition.
@echo Then comes the override.
endef
all: ; $(foo)
',
'foo=Hello', "First comes the definition.\nThen comes the override.\n");
&compare_output($answer,&get_logfile(1));
1;

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