summaryrefslogtreecommitdiff
path: root/rule.c
AgeCommit message (Collapse)AuthorFilesLines
2013-11-23[SV 40361] Don't use vsnprintf(), which is an ISO C99 function.Paul Smith1-2/+2
* output.c (error, fatal, message): Take an extra argument specifying how many bytes are used by the formatted arguments. (get_buffer): New function that allocates the requested buffer size. Remove msc_vsnprintf(), vfmtconcat(), and fmtconcat() as unneeded. * makeint.h: Declare various helper macros for generating output. * *.c: Change all error(), fatal(), message() calls to use the macros, or pass the extra length argument directly.
2013-09-22Add VMS port updates from Hartmut Becker.Paul Smith1-1/+1
2013-07-22[Bug #39310] Parse simple pattern prereqs for globbing.Paul Smith1-1/+1
We tried to get some efficiency by avoiding a parse_file_seq() for simple pattern prerequisites, but this also means no wildcard expansion was happening, so add it back. Add regression tests for wildcards in target and prerequisite lists.
2013-06-22Create a character map to use for locating stop-points in strings.Paul Smith1-1/+1
In various places we were passing flags and characters to compare, then using complex conditionals to see where to stop in string searches. Performance numbers reveal that we were spending as much as 23% of our processing time in these functions, most of it in the comparison lines. Instead create a character map and use a single bitwise comparison to determine if this is any one of the stop characters.
2013-05-17Update source file format: remove TABs, use GNU coding styles.Paul Smith1-98/+98
2013-05-17Update copyright for changes in 2013.Paul Smith1-1/+1
2013-04-16Cleanup some source and fix autoconf warnings.Paul Smith1-3/+1
2013-01-20Rename the make.h file to makeint.h for internal use only.Paul Smith1-1/+1
2012-03-05Simplify copyrights using ranges of years.Paul Smith1-3/+1
The new GNU Maintainer's Manual allows the use of year ranges in certain situations; take advantage of this simplification.
2012-03-04Convert all "`'" quotes to "''" per new GNU Coding Standard guidelines.Paul Smith1-13/+13
Fixes Savannah bug #34530.
2012-01-16Update copyright notices.Paul Smith1-3/+3
2010-11-06Improve backslash/newline handling to adhere to POSIX requirements.Paul Smith1-0/+1
2010-07-19- Many fixup patches from Savannah.Paul Smith1-2/+3
- Fix the test suite on Solaris (from Boris) - Update the manual for .ONESHELL
2010-07-13Update copyrights for 2010.Paul Smith1-2/+2
2009-10-25Update copyright years.Paul Smith1-2/+2
2009-09-27- Add static pattern targets to the string cache.Paul Smith1-8/+1
- Use specific free_*() calls where appropriate.
2009-09-24- Rework secondary expansion so we only defer it if there's a possibilityPaul Smith1-18/+15
it might be needed: for most situations we parse prereqs immediately as we used to. Reduces memory usage. - Fixes Savannah bug #18622.
2009-09-16- Add xcalloc() and call itPaul Smith1-3/+2
- 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-06-13- Fix Savannah bug 17825Paul Smith1-1/+1
- Fix Savannah bug 21231
2009-06-09- Fix Savannah bug #18124Paul Smith1-1/+1
- Fix Savannah bug #17521 - Fix Savannah bug #16401 - Fix Savannah bug #16469 - Fix Savannah bug #16473
2007-07-04* Update to GPLv3Paul Smith1-4/+4
* Update copyright to 2007 * Fix download URL for translation files (thanks to Thiemo Seufer)
2007-03-20This is a major update, which switches virtually every allocated-but-not-freedPaul Smith1-138/+103
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.
2006-04-09Another round of cleanups:Paul Smith1-31/+27
- 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-07Code cleanup: Remove all references to PARAMS() & ansi2knr.Paul Smith1-1/+1
2006-03-17Fixed Savannah bug #16053.Boris Kolpackov1-6/+3
2006-02-11Last of the copyright updates.Paul Smith1-1/+2
2006-02-11Update copyright and license notices on all files.Paul Smith1-13/+11
Added new file strcache.c to various non-UNIX makefiles and build scripts.
2005-10-24Make second expansion optional (partial implementation).Paul Smith1-2/+3
I decided this feature was too impacting to make the permanent default behavior. This set of changes makes the default behavior of make the old behavior (no second expansion). If you want second expansion, you must define the .SECONDEXPANSION: special target before the first target that needs it. This set of changes ONLY fixes explicit and static pattern rules to work like this. Implicit rules still have second expansion enabled all the time: I'll work on that next. Note that there is still a backward-incompatibility: now to get the old SysV behavior using $$@ etc. in the prerequisites list you need to set .SECONDEXPANSION: as well.
2005-04-13Fix performance degradation introduced by the second expansion feature.Paul Smith1-0/+1
I did this by adding intelligence into the algorithm such that the second expansion was only actually performed when the prerequisite list contained at least one "$", so we knew it is actually needed. Without this we were using up a LOT more memory, since every single target (even ones never used by make) had their file variables initialized. This also used a lot more CPU, since we needed to create and populate a new variable hash table for every target. There is one issue remaining with this feature: it leaks memory. In pattern_search() we now initialize the file variables for every pattern target, which allocates a hash table, etc. However, sometimes we recursively invoke pattern_search() (for intermediate files) with an automatic variable (alloca() I believe) as the file. When that function returns, obviously, the file variable hash memory is lost.
2004-03-22Numerous updates and bug fixes.Paul Smith1-15/+0
A number of W32 cleanups from J.Grant. A number of OS/2 cleanups from Andreas Buening. Various random bug fixes.
2004-02-24Many compiler warning cleanups.Paul Smith1-1/+1
Small fixes for W32 (from Jonathan Grant <jg-make@jguk.org>) Maintainer enhancements to clean up the tree.
2003-05-02- Fix bug #1405: allow multiple pattern-specific variables to match a target.Paul Smith1-100/+0
- Fix some uncleanliness about the implementation of patterns-specific vars. - Some enhancements to the OS/2 port.
2002-10-14Convert the source code to use ANSI C style function definitions andPaul Smith1-27/+13
enable the automake ansi2knr capability. Right now this doesn't quite build using a K&R compiler because of a problem with the loadavg test program, but the rest of the code works. I'm asking the automake list about this problem.
2002-07-08Various cleanups reported by people using the alpha release.Paul Smith1-0/+1
Incorporate "order-only" prerequisites patch. Wrote a test for it. The test shows what might be a bug in the code; I need to look at it more closely (anyway it doesn't behave as I expected). Also I haven't done the docs yet.
2001-08-19Installed the da.po (Danish) translation file.Paul Smith1-1/+1
Fixed some translation string issues.
2000-02-05* Fix PR/1407.Paul Smith1-2/+2
* Keep filename/lineno information for variables, for debugging.
2000-01-22* Merge VMS patches by Hartmut Becker.Paul Smith1-2/+6
1999-10-15* Fix PR/1394.Paul Smith1-3/+3
* Apply changes from Paul Eggert. * Many other cleanups (index/rindex --> strchr/strrchr, etc.)
1999-07-28* Add gettext macros to start i18n support.Paul Smith1-7/+7
1999-07-21* Add configure option to enable dmalloc library.Paul Smith1-2/+2
* Various code cleanups.
1999-07-20* Fix memory leaks, fd leaks, and some long-standing bugs recognizing whenPaul Smith1-0/+13
targets need to have their modtimes rechecked (-n, etc.)
1999-06-14* Various bug fixes.Paul Smith1-21/+23
1999-03-05* Define and use xstrdup() instead of strdup().Paul Smith1-1/+1
1998-10-13Ignore non-empty lines which become empty after variable expansion.Paul Smith1-4/+10
Don't choke on invalid pattern rules if we fail during makefile parsing. Don't dump core if a non-empty command becomes empty after expansion.
1998-10-03Checkpoint changes. Bug fixes, mostly.Paul Smith1-3/+3
1998-07-30GNU make release 3.77.Paul Smith1-3/+105
1996-05-09Thu May 9 13:54:49 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>Roland McGrath1-0/+5
* GNUmakefile (globfiles): Add AmigaDOS support files. (distfiles): Add $(amigafiles). (amigafiles): New variable. Thu Nov 7 10:18:16 1995 Aaron Digulla <digulla@fh-konstanz.de> * Added Amiga support in commands.c, dir.c, function.c, job.c, main.c, make.h, read.c, remake.c * commands.c: Amiga has neither SIGHUP nor SIGQUIT * dir.c: Amiga has filenames with Upper- and Lowercase, but "FileName" is the same as "filename". Added strieq() which is use to compare filenames. This is like streq() on all other systems. Also there is no such thing as "." under AmigaDOS. * function.c: On Amiga, the environment is not passed as envp, there are no pipes and Amiga can't fork. Use my own function to create a new child. * job.c: default_shell is "" (The system automatically chooses a shell for me). Have to use the same workaround as MSDOS for running batch commands. Added HAVE_SYS_PARAM_H. NOFILE isn't known on Amiga. Cloned code to run children from MSDOS. Own version of sh_chars[] and sh_cmds[]. No dup2() or dup() on Amiga. * main.c: Force stack to 20000 bytes. Read environment from ENV: device. On Amiga, exec_command() does return, so I exit() afterwards. * make.h: Added strieq() to compare filenames. * read.c: Amiga needs special extension to have passwd. Only one include-dir. "Makefile" and "makefile" are the same. Added "SMakefile". Added special code to handle device names (xxx:) and "./" in rules. * remake.c: Only one lib-dir. Amiga link-libs are named "%s.lib" instead of "lib%s.a". * main.c, rule.c, variable.c: Avoid floats at all costs. * vpath.c: Get rid of as many alloca()s as possible.
1996-03-20Tue Mar 19 20:21:34 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>Roland McGrath1-4/+17
Merged VMS port from Klaus Kaempf <kkaempf@didymus.rmi.de>. * make.h (PARAMS): New macro. * config.h-vms: New file. * makefile.com: New file. * makefile.vms: New file. * readme.vms: New file. * vmsdir.h: New file. * vmsfunctions.c: New file. * vmsify.c: New file. * file.h: Renamed to filedef.h to avoid conflict with VMS system hdr. * ar.c: Added prototypes and changes for VMS. * commands.c: Likewise. * commands.h: Likewise. * default.c: Likewise. * dep.h: Likewise. * dir.c: Likewise. * expand.c: Likewise. * file.c: Likewise. * function.c: Likewise. * implicit.c: Likewise. * job.c: Likewise. * job.h: Likewise. * main.c: Likewise. * make.h: Likewise. * misc.c: Likewise. * read.c: Likewise. * remake.c: Likewise. * remote-stub.c: Likewise. * rule.c: Likewise. * rule.h: Likewise. * variable.c: Likewise. * variable.h: Likewise. * vpath.c: Likewise. * compatMakefile (srcs): Rename file.h to filedef.h.
1993-10-21entered into RCSRoland McGrath1-3/+8
1993-10-18Formerly rule.c.~16~Roland McGrath1-21/+29