File:  [NetBSD Developer Wiki] / wikisrc / projects / project / bsdmake-enhancements.mdwn
Revision 1.2: download - view: text, annotated - select for diffs
Thu Feb 27 08:37:50 2014 UTC (21 months ago) by dholland
Branches: MAIN
CVS tags: HEAD
Update title: this is about gmake pattern rules.

Mark project "medium", not "easy", as nothing in make is "easy".
Expand project scope a bit to avoid generating code for yet another
special case hack.

Also mention rules written in terms of $(.TARGET), which already work
and are more general than gmake pattern rules.

[[!template id=project

title="Suffix 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