summaryrefslogtreecommitdiff
path: root/file.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix VMS implicit rules and UNIX paths.John Malmberg2014-10-201-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes VMS implicit rules and UNIX style pathname handling. It also fixes some of the VMS style pathname handling, more work there will be needed later. TODO: There are other case insensitive platforms besides VMS. We need to find out why there is extra VMS code for this. This indicates either the extra VMS code is not needed, or the case insensitive support may not be complete on the other case insensitive platforms. * default.c: Add missing definitions to default_suffix_rules[] and default_variables[]. TODO: As it is important that VMS DCL mode definitions must always be a superset of UNIX definitions, a better way of maintaining the VMS DCL mode definitions should be devised. * dir.c (downcase_inplace): Add a reentrant downcase() routine. Add future support for VMS 8.2+ _USE_STD_STAT macro which will disable a lot of VMS specific code from compiling. (dir_file_exists_p): vmsify filename only if directory name has VMS directory delimiters. (file_exists_p): Handle both VMS and UNIX directories. (file_impossible): Handle both VMS and Unix directories. Track whether a VMS format path is needed for the return value. * file.c (lookup_file): Check if vmsify is needed; handle UNIX paths. * implicit.c (pattern_search): Enable UNIX paths. * read.c (parse_file_seq): Enable UNIX paths. * remake.c (f_mtime): Fix gpath_search call for VMS paths. * rule.c (count_implicit_rule): Enable UNIX paths, Fix VMS paths. * vpath.c (selective_vpath_search): Enable UNIX paths.
* Update Copyright statements for 2014.Paul Smith2014-09-301-1/+1
|
* [SV 40361] Don't use vsnprintf(), which is an ISO C99 function.Paul Smith2013-11-231-13/+20
| | | | | | | | | | * 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.
* Add VMS port updates from Hartmut Becker.Paul Smith2013-09-221-1/+1
|
* [Bug #39310] Parse simple pattern prereqs for globbing.Paul Smith2013-07-221-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.
* Modify the update_status field in struct file to be an enum.Paul Smith2013-07-141-11/+6
| | | | | Makes the code a little clearer/cleaner, and solves a problem on systems where a char is unsigned by default.
* Create a character map to use for locating stop-points in strings.Paul Smith2013-06-221-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.
* Disable database verification unless debug enabled.Paul Smith2013-06-211-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.
* [SV #38442] Add library names to the string cache.Paul Smith2013-05-261-1/+1
|
* Update source file format: remove TABs, use GNU coding styles.Paul Smith2013-05-171-100/+100
|
* Update copyright for changes in 2013.Paul Smith2013-05-171-1/+1
|
* Remove the dlopen() pointer from struct filedef.Paul Smith2013-05-171-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.
* [Savannah #20501] Handle adding -r/-R to MAKEFLAGS in the makefile.Paul Smith2013-05-131-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.
* Rename the make.h file to makeint.h for internal use only.Paul Smith2013-01-201-1/+1
|
* Save the variable buffer content, not a potentially old pointer to it.Paul Smith2012-09-091-3/+2
| | | | Fixes Savannah bug #36925.
* Simplify copyrights using ranges of years.Paul Smith2012-03-051-3/+1
| | | | | The new GNU Maintainer's Manual allows the use of year ranges in certain situations; take advantage of this simplification.
* Convert all "`'" quotes to "''" per new GNU Coding Standard guidelines.Paul Smith2012-03-041-15/+15
| | | | Fixes Savannah bug #34530.
* Update copyright notices.Paul Smith2012-01-161-3/+3
|
* Changes to resolve warnings.Paul Smith2011-11-141-1/+2
| | | | Fixes Savannah bug #34608.
* Improve backslash/newline handling to adhere to POSIX requirements.Paul Smith2010-11-061-0/+13
|
* Update copyrights for 2010.Paul Smith2010-07-131-2/+2
|
* - Rename strieq() to patheq() for clarity.Paul Smith2010-07-011-2/+1
| | | | - Convert xmalloc/memset pairs to xcalloc.
* (lookup_file) [HAVE_DOS_PATHS]: Treat '\\' like we do with '/'.Eli Zaretskii2009-12-111-2/+12
|
* Update copyright years.Paul Smith2009-10-251-2/+2
|
* Various simple code cleanups.Paul Smith2009-10-251-1/+1
|
* - Rework secondary expansion so we only defer it if there's a possibilityPaul Smith2009-09-241-176/+205
| | | | | | it might be needed: for most situations we parse prereqs immediately as we used to. Reduces memory usage. - Fixes Savannah bug #18622.
* - Add xcalloc() and call itPaul Smith2009-09-161-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
* - Fix Savannah bug 17825Paul Smith2009-06-131-2/+2
| | | | - Fix Savannah bug 21231
* - Fix Savannah bug #24622Paul Smith2009-06-071-4/+4
|
* - Modify access of config and gnulib Savannah modules to use GITPaul Smith2009-06-041-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.
* New special variable: .RECIPEPREFIXPaul Smith2007-11-041-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.
* Fix Savannah bug #20452.Paul Smith2007-07-141-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.
* * Update to GPLv3Paul Smith2007-07-041-4/+4
| | | | | * Update copyright to 2007 * Fix download URL for translation files (thanks to Thiemo Seufer)
* This is a major update, which switches virtually every allocated-but-not-freedPaul Smith2007-03-201-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.
* Fix from Eli for incorrect value of $(MAKE) on Cygwin.Paul Smith2006-11-181-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.
* Another round of cleanups:Paul Smith2006-04-091-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.
* Fixed Savannah bug #16053.Boris Kolpackov2006-03-171-6/+18
|
* - Memory cleanups, found with valgrind.Paul Smith2006-02-201-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.
* Last of the copyright updates.Paul Smith2006-02-111-1/+2
|
* Update copyright and license notices on all files.Paul Smith2006-02-111-14/+11
| | | | Added new file strcache.c to various non-UNIX makefiles and build scripts.
* Fix Savannah bugs # 15341, 15534, and 15533.Paul Smith2006-02-061-8/+14
| | | | | Rewrite large chunks of the "Commands" section of the manual to better describe then backslash-newline handling, the SHELL variable, etc.
* Make second expansion optional (partial implementation).Paul Smith2005-10-241-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.
* Fix performance degradation introduced by the second expansion feature.Paul Smith2005-04-131-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.
* Fixed Savannah bug #12320.Boris Kolpackov2005-03-151-93/+107
|
* * New feature: -L optionPaul Smith2005-02-281-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)
* Implementation of the .DEFAULT_TARGET special variable.Boris Kolpackov2005-02-271-1/+1
|
* Implementation of the second expansion in explicitBoris Kolpackov2005-02-271-12/+97
| | | | rules, static pattern rules and implicit rules.
* Fixed bug in implicit rule prerequisite evaluation code. Added test.Boris Kolpackov2004-09-211-1/+2
|
* Various enhancementsPaul Smith2004-05-161-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.
* Many compiler warning cleanups.Paul Smith2004-02-241-1/+1
| | | | | Small fixes for W32 (from Jonathan Grant <jg-make@jguk.org>) Maintainer enhancements to clean up the tree.