Commit graph

126 commits

Author SHA1 Message Date
Paul Smith
49cc211819 Create a new internal interface for defining new make functions.
This allows us to create new functions without changing function.c.
You still have to modify the GNU make code (for now) though: this is
simply a preliminary step to possibly allowing make to load modules.

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

On all non-configure-enabled systems, currently, the default is for
Guile support to be disabled.
2012-01-15 22:41:53 +00:00
Paul Smith
9fcd90e36c Changes to resolve warnings.
Fixes Savannah bug #34608.
2011-11-14 02:26:00 +00:00
Paul Smith
6979e7e43b Use the same algorithm for counting the number of words to sort as we
use to break up the list of words, so we're sure to get the same number.
Fixes Savannah bug #33125
2011-05-02 12:35:01 +00:00
Paul Smith
b34438bee8 Add new feature: != shell assignment for portability with BSD make.
Feature submitted by David Wheeler.
2011-04-18 01:25:20 +00:00
Eli Zaretskii
b6b6875986 function.c (func_shell) [WINDOWS32]: Reset just_print_flag
around the call to construct_command_argv, so that a temporary
 batch file _is_ created when needed for $(shell).  Fixes Savannah
 bug #16362.
2010-08-07 08:46:06 +00:00
Paul Smith
9903cda2a7 Update copyrights for 2010. 2010-07-13 01:20: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
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
5f188b39a4 Update copyright years. 2009-10-25 18:56:44 +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
Paul Smith
44ac2cdb4d Fix some memory leaks, found with valgrind. 2009-09-26 23:01:55 +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
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
70c726c875 * function.c (windows32_openpipe): Update envp after calling
sync_Path_environment.
2009-08-31 17:54:11 +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
bf9822658f - Fix Savannah bug 17825
- Fix Savannah bug 21231
2009-06-13 21:21:48 +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
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
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
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
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
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
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
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
Paul Smith
a8f101d0bc Release GNU make 3.81.
Update NEWS docs.
Enhance the manual to use automake version.texi, and use the canonical
FSF copyright features and statement.
Some $(realpath ...) tests won't work on Windows; leave them out
The jobserver filedescriptor test might fail if some FDs are reserved,
so for now comment out that check.
2006-04-01 06:36:40 +00:00
Paul Smith
0806a403d6 Fix Savannah bug #106: keep separate track of which variable we are
expanding, and use that info when generating error messages instead of
the file info, where appropriate.
2006-02-15 23:54:42 +00:00
Paul Smith
a6bdc58385 Last of the copyright updates. 2006-02-11 22:16:04 +00:00
Paul Smith
586daef9bc Update copyright and license notices on all files.
Added new file strcache.c to various non-UNIX makefiles and build scripts.
2006-02-11 19:02:21 +00:00
Paul Smith
5a7a42cfce - New code capability: a read-only string cache. Start of solution for
Savannah bug #15182, but not much uses it yet.  Coming shortly.
- Added short-circuiting $(and ..) and $(or ...) functions.
2006-02-10 05:29:00 +00:00
Boris Kolpackov
1fd3f9d79c Implemented the flavor function which returns the flavor of
a variable ('simple', 'recursive', or 'undefined').
2005-11-17 07:27:28 +00:00
Paul Smith
f7598efb67 Fix make.h preprocessor directive to work better with Windows compilers.
Fix some regression tests to (hopefully) work better on Windows.
2005-08-29 14:11:00 +00:00
Paul Smith
b237dff775 - Fixed a bug reported by Michael Matz regarding handling of parallel
jobs after a failed job.
- Enhancements to WINDOWS32 code from Eli Zaretskii.
- Add Microsoft Project files from J. Grant.
2005-08-08 05:08:00 +00:00
Paul Smith
da1b137e38 Fix strerror() handling for systems which set ANSI_STRING.
Don't print errors if "include" is specified with no arguments.
New test suite for the $(shell ...) function.
2005-06-27 01:01:07 +00:00
Paul Smith
28078b517a - Missing docs for $|
- Update NEWS and AUTHORS files.
- Fix support request #103195.
- Apply patch #3679
- Fix handling of sys_siglist in autoconf/etc.
2005-03-04 12:52:32 +00:00
Paul Smith
a2232470c2 - Fix bug #7144 (infinite loop sometimes with -q and double-colon rules)
- Resolve support request #103195 (rationalize wordlist fn arguments)
2005-02-28 09:41:25 +00:00
Paul Smith
d2516343bc * New feature: -L option
* New function: $(info ...)
* Disallow $(eval ...) to create prereq relationships inside command scripts
  (caused core dumps)
* Try to allow more tests to succeed in Windows/DOS by sanitizing CRLF and \
* Various bug fixes and code cleanups (see the ChangeLog entry)
2005-02-28 07:48:22 +00:00
Boris Kolpackov
659fc6b55e Implementation of the second expansion in explicit
rules, static pattern rules and implicit rules.
2005-02-27 21:40:23 +00:00
Boris Kolpackov
49ca261bd5 Implemented realpath' and abspath' built-in functions. 2004-11-30 19:51:24 +00:00
Boris Kolpackov
547abfa13e New $(lastword ) built-in function: implementation, documentation and tests. 2004-10-21 17:42:24 +00:00
Paul Smith
704c60cec0 Remove sindex() and replace with strstr().
Windows: allow users to set SHELL to cmd.exe and have it behave as if no
UNIX shell were found.
2004-09-21 12:07:12 +00:00
Paul Smith
0799ce730d Fix some bugs in variable pattern substitution (e.g. $(VAR:A=B)),
reported by Markus Mauhart <qwe123@chello.at>.  One was a simple typo; to
fix the other we call patsubst_expand() for all instances of variable
substitution, even when there is no '%'.  We used to call subst_expand()
with a special flag set in the latter case, but it didn't work properly
in all situations.  Easier to just use patsubst_expand() since that's
what it is.
2004-09-21 04:00:31 +00:00
Paul Smith
f29b86c314 Many compiler warning cleanups.
Small fixes for W32 (from Jonathan Grant  <jg-make@jguk.org>)
Maintainer enhancements to clean up the tree.
2004-02-24 13:50:19 +00:00
Paul Smith
ee3d37a591 Fix bugs 5798 and 6195. 2003-11-04 07:40:29 +00:00
Paul Smith
1a5beef51f - Fix bug #1405: allow multiple pattern-specific variables to match a target.
- Fix some uncleanliness about the implementation of patterns-specific vars.
- Some enhancements to the OS/2 port.
2003-05-02 01:44:59 +00:00