ts' content='index, nofollow'/>
summaryrefslogtreecommitdiff
path: root/usr.bin/make/lst.lib
AgeCommit message (Collapse)Author
2020-07-26make(1): condense the list library into a single filerillig
The list library is only used in make(1). Having it spread out over 28 files made it look more complex than it really is. In fact, it's just a versatile generic data type like in hash.c. Having all the list functions in a single file reduces the code size, both by omitting the many RCS Ids and by inlining commonly used code.
2020-07-03make(1): remove redundant parentheses around return valuerillig
2014-09-07Revert all make changes except the unit tests to the state of threejoerg
weeks ago. Individual changes can be reapplied after review.
2014-08-23PR/46096: Jarmo Jaakkola: fix many problems with dependencies (PR 49086)christos
Quite extensive rewrite of the Suff module. Some ripple effects into Parse and Targ modules too. Dependency searches in general were made to honor explicit rules so implicit and explicit sources are no longer applied on targets that do not invoke a transformation rule. Archive member dependency search was rewritten. Explicit rules now work properly and $(.TARGET) is set correctly. POSIX semantics for lib(member.o) and .s1.a rules are supported. .SUFFIXES list maintenance was rewritten so that scanning of existing rules works when suffixes are added and that clearing the suffix list removes single suffix rules too. Transformation rule nodes are now mixed with regular nodes so they are available as regular targets too if needed (especially after the known suffixes are cleared). The .NULL target was documented in the manual page, especially to warn against using it when a single suffix rule would work. A deprecation warning was also added to the manual and make also warns the user if it encounters .NULL. Search for suffix rules no longer allows the explicit dependencies to override the selected transformation rule. A check is made in the search that the transformation that would be tried does not already exist in the chain. This prevents getting stuck in an infinite loop under specific circumstances. Local variables are now set before node's children are expanded so dynamic sources work in multi-stage transformations. Make_HandleUse() no longer expands the added children for transformation nodes, preventing triple expansion and allowing the Suff module to properly postpone their expansion until proper values are set for the local variables. Directory prefix is no longer removed from $(.PREFIX) if the target is found via directory search. The last rule defined is now used instead of the first one (POSIX requirement) in case a rule is defined multiple times. Everything defined in the first instance is undone, but things added "globally" are honored. To implement this, each node tracks attribute bits which have been set by special targets (global) instead of special sources (local). They also track dependencies that were added by a rule with commands (local) instead of rule with no commands (global). New attribute, OP_FROM_SYS_MK is introduced. It is set on all targets found in system makefiles so that they are not eligible to become the main target. We cannot just set OP_NOTMAIN because it is one of the attributes inherited from transformation and .USE rules and would make any eligible target that uses a built-in inference rule ineligible. The $(.IMPSRC) local variable now works like in gmake: it is set to the first prerequisite for explicit rules. For implicit rules it is still the implied source. The manual page is improved regarding the fixed features. Test cases for the fixed problems are added. Other improvements in the Suff module include: - better debug messages for transformation rule search (length of the chain is now visualized by indentation) - Suff structures are created, destroyed and moved around by a set of maintenance functions so their reference counts are easier to track (this also gets rid of a lot of code duplication) - some unreasonably long functions were split into smaller ones - many local variables had their names changed to describe their purpose instead of their type
2013-11-14Don't SEGV when passed NULL for list.sjg
2009-01-24Fixes to includes of make_malloc.h to that it actually builds whendsl
USE_EMALLOC is undefined. Fixes earlier fixes :-)
2009-01-24Move the bmake_malloc() functions into their own .c and .h files.dsl
Include instead of make.h in a few places.
2009-01-23Sprinkle some const.dsl
In particular for Lst_Find() and Lst_FindFrom(). Remove some unneeded casts and some now-undeeded UNCONST().
2009-01-23Change 'ClientData' to 'void *' so that relevant parameters candsl
be made 'const void *'.
2008-12-13Use NULL instead of -1 cast to the relavant type (usually via NIL).dsl
This was a suggestion from christos - so blame him if there is a deep reason for using -1 :-)
2008-10-06Don't use emalloc and friends directly, but call them consistentlyjoerg
bmake_malloc and friends. Implement them via macros for the native case and provide fallback implementations otherwise. Avoid polluting the namespace by not defining enomem globally. Don't bother to provide strdup and strndup, they were only used for the estrdup and estrndup comapt code. This addresses the presence of emalloc in system libraries on A/UX and resulted strange issues as reported by Timothy E. Larson.
2008-02-15back all changes out until I fix it properly.christos
2008-02-14- use pid_t/size_t as appropriate instead of int.christos
- use %ld to print pids. - fix a bit of lint. - WARNS=4
2008-02-05Be pedantic and use unsigned int here as uwe@ suggested.joerg
2008-02-05Merge from pkgsrc's bmake: don't use signed short for bitfields.joerg
This makes IBM xlc happy.
2006-11-11Return the non-zero value that caused the Lst_ForEach[From] call todsl
terminate early to the caller.
2006-10-27Rename 'struct Lst' to 'struct List' and 'struct LstNode' to 'struct 'ListNode'dsl
in lst.d remove a small barrowload of casts from the lst.lib bloatset.
2006-10-25Rename Lst_Append() to Lst_InsertAfter() and Lst_Insert() to Lst_InsertBefore()dsl
to better explain their actions.
2006-10-25Fix previous - need to add a lstPrev()dsl
2006-10-25Replace 'a == b ? FALSE : TRUE' with 'a != b'dsl
Add missing () in expansion.
2005-08-09Add typedefs for DuplicateProc and FreeProc from Max Okumoto.christos
2005-08-08From Max Okumoto:christos
- Remove casts to NULL. - Remove space between cast and object.
2005-08-05More KNF cleanups from Max Okumotochristos
2005-02-16PR/29203, PR/29204: Max Okumoto: KNF changes to make [no functional changes]christos
2004-05-07Simplify build, no functional changes.ross
Instead of adding MAKE_BOOTSTRAP for hosted environments, i.e., when you want things simple, instead add MAKE_NATIVE to get those hugely important features like __RCSID(). It's now possible to build make on some hosts with: cc *.c */*.c
2004-05-06Instead of including from the wrong directory and then fixing it (-I)ross
in the Makefile, how about just doing the right include?
2003-08-07Move UCB-licensed code from 4-clause to 3-clause licence.agc
Patches provided by Joel Baker in PR 22365, verified by myself.
2003-01-28success, not sucess. Noted by mjl.wiz
2002-06-15Remove !__STDC__ stuff, de-__P(), ANSIfy, and de-register.wiz