File:  [NetBSD Developer Wiki] / wikisrc / projects / project / bsdmake-enhancements.mdwn
Revision 1.3: download - view: text, annotated - select for diffs
Thu Feb 27 08:38:07 2014 UTC (12 months ago) by dholland
Branches: MAIN
CVS tags: HEAD
thinko in previous

[[!template id=project

title="Suffix and pattern rules in BSD make"


duration="1 month"


BSD make (aka bmake) uses traditional suffix rules (.c.o: ...) instead
of pattern rules like gmake's (%.c:%.o: ...) which are more general
and flexible.

The suffix module should be re-written to work from a general
match-and-transform function on targets, which is sufficient to
implement not only traditional suffix rules and gmake pattern rules,
but also whatever other more general transformation rule syntax comes
down the pike next. Then the suffix rule syntax and pattern rule
syntax can both be fed into this code.

Note that it is already possible to write rules where the source is
computed explicitly based on the target, simply by using $(.TARGET) in
the right hand side of the rule. Investigate whether this logic should
be rewritten using the match-and-transform code, or if the
match-and-transform code should use the logic that makes these rules
possible instead.

Implementing pattern rules is widely desired in order to be able to
read more makefiles written for gmake, even though gmake's pattern
rules aren't well designed or particularly principled.


CVSweb for NetBSD wikisrc <> software: FreeBSD-CVSweb