summaryrefslogtreecommitdiff
path: root/file.c
AgeCommit message (Collapse)AuthorFilesLines
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-2/+3
We tried to get some efficiency by avoiding a parse_file_seq() for simple pattern prerequisites, but this also means no wildcard expansion was happening, so add it back. Add regression tests for wildcards in target and prerequisite lists.
2013-07-14Modify the update_status field in struct file to be an enum.Paul Smith1-11/+6
Makes the code a little clearer/cleaner, and solves a problem on systems where a char is unsigned by default.
2013-06-22Create a character map to use for locating stop-points in strings.Paul Smith1-2/+2
In various places we were passing flags and characters to compare, then using complex conditionals to see where to stop in string searches. Performance numbers reveal that we were spending as much as 23% of our processing time in these functions, most of it in the comparison lines. Instead create a character map and use a single bitwise comparison to determine if this is any one of the stop characters.
2013-06-21Disable database verification unless debug enabled.Paul Smith1-1/+1
The database verification can take a long time. Only enable it if debug mode is enabled. If MAKE_MAINTAINER_MODE is set, it's also enabled by default.
2013-05-26[SV #38442] Add library names to the string cache.Paul Smith1-1/+1
2013-05-17Update source file format: remove TABs, use GNU coding styles.Paul Smith1-100/+100
2013-05-17Update copyright for changes in 2013.Paul Smith1-1/+1
2013-05-17Remove the dlopen() pointer from struct filedef.Paul Smith1-0/+1
This pointer is almost never needed, and it increases the size of the filedef struct for all files (of which there are a huge number for large builds). Instead keep a bit field marking whether the file is a loaded object and if so call a new function to unload it. In load.c we keep a simple linked list of loaded objects (of which there will be very few typically) and their dlopen() pointers.
2013-05-13[Savannah #20501] Handle adding -r/-R to MAKEFLAGS in the makefile.Paul Smith1-1/+15
If -R is set in the makefile and not the command line, then go through all the default variables and undefine them. If -r is set in the makefile and not in the command line, then remove all .SUFFIX prefixes (unless the user set it) and SUFFIX variable setting. In -p mode don't print builtins.
2013-01-20Rename the make.h file to makeint.h for internal use only.Paul Smith1-1/+1
2012-09-09Save the variable buffer content, not a potentially old pointer to it.Paul Smith1-3/+2
Fixes Savannah bug #36925.
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-15/+15
Fixes Savannah bug #34530.
2012-01-16Update copyright notices.Paul Smith1-3/+3
2011-11-14Changes to resolve warnings.Paul Smith1-1/+2
Fixes Savannah bug #34608.
2010-11-06Improve backslash/newline handling to adhere to POSIX requirements.Paul Smith1-0/+13
2010-07-13Update copyrights for 2010.Paul Smith1-2/+2
2010-07-01- Rename strieq() to patheq() for clarity.Paul Smith1-2/+1
- Convert xmalloc/memset pairs to xcalloc.
2009-12-11(lookup_file) [HAVE_DOS_PATHS]: Treat '\\' like we do with '/'.Eli Zaretskii1-2/+12
2009-10-25Update copyright years.Paul Smith1-2/+2
2009-10-25Various simple code cleanups.Paul Smith1-1/+1
2009-09-24- Rework secondary expansion so we only defer it if there's a possibilityPaul Smith1-176/+205
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-4/+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-2/+2
- Fix Savannah bug 21231
2009-06-07- Fix Savannah bug #24622Paul Smith1-4/+4
2009-06-04- Modify access of config and gnulib Savannah modules to use GITPaul Smith1-1/+2
- 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.
2007-11-04New special variable: .RECIPEPREFIXPaul Smith1-7/+7
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-07-14Fix Savannah bug #20452.Paul Smith1-1/+3
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-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-194/+216
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-11-18Fix from Eli for incorrect value of $(MAKE) on Cygwin.Paul Smith1-1/+1
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-04-09Another round of cleanups:Paul Smith1-9/+9
- 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-03-17Fixed Savannah bug #16053.Boris Kolpackov1-6/+18
2006-02-20- Memory cleanups, found with valgrind.Paul Smith1-25/+29
- Fix handling of special targets like .SUFFIX for VMS insensitive targets. - Don't make temporary batch files for -n. Make sure batch files are created in text mode.
2006-02-11Last of the copyright updates.Paul Smith1-1/+2
2006-02-11Update copyright and license notices on all files.Paul Smith1-14/+11
Added new file strcache.c to various non-UNIX makefiles and build scripts.
2006-02-06Fix Savannah bugs # 15341, 15534, and 15533.Paul Smith1-8/+14
Rewrite large chunks of the "Commands" section of the manual to better describe then backslash-newline handling, the SHELL variable, etc.
2005-10-24Make second expansion optional (partial implementation).Paul Smith1-76/+152
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-20/+35
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.
2005-03-15Fixed Savannah bug #12320.Boris Kolpackov1-93/+107
2005-02-28* New feature: -L optionPaul Smith1-0/+12
* 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-27Implementation of the .DEFAULT_TARGET special variable.Boris Kolpackov1-1/+1
2005-02-27Implementation of the second expansion in explicitBoris Kolpackov1-12/+97
rules, static pattern rules and implicit rules.
2004-09-21Fixed bug in implicit rule prerequisite evaluation code. Added test.Boris Kolpackov1-1/+2
2004-05-16Various enhancementsPaul Smith1-1/+5
- OS/2 Patches - OpenVMS updates - Sanitize the handling of -include/sinclude with and without -k - Fix the setting of $< for order-only rules.
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.
2004-01-21Many bug fixes etc.Paul Smith1-0/+3
- Apply a fix for the "thundering herd" problem when using "-j -l". This also fixes bug #4693. - Fix bug #7257: allow functions as ifdef arguments - Fix bug #4518: make sure we print all double-colon rules with -p. - Upgrade to autconf 2.58/automake 1.8/gettext 0.13.1 - Various doc cleanups, etc.
2003-03-28Fix bug #2515: the .SECONDARY target with no prerequisites wasn'tPaul Smith1-1/+13
behaving properly (if you listed prerequisites it worked properly).
2003-03-25Fix bug #2892.Paul Smith1-1/+1
More OS/2 updates from Andreas Buening. Upgrade build system to autoconf 2.57 and automake 1.7.3.