File:  [NetBSD Developer Wiki] / wikisrc / projects / project / bsdmake-enhancements.mdwn
Revision 1.4: download - view: text, annotated - select for diffs
Mon Feb 16 07:15:45 2015 UTC (7 years, 9 months ago) by dholland
Branches: MAIN
CVS tags: HEAD
duration 1 month -> 2 months
(I might be able to do this in one month but I've worked on make before)

[[!template id=project

title="Suffix and pattern rules in BSD make"


duration="2 months"


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