Page MenuHomeFreeBSD

Allow multiple .l.o, .y.o, or .y.c matches per Makefile.
AbandonedPublic

Authored by brooks on Nov 3 2016, 11:27 PM.
Tags
None
Referenced Files
F94878689: D8438.id21985.diff
Wed, Sep 18, 2:41 PM
F94878671: D8438.id.diff
Wed, Sep 18, 2:40 PM
F94874804: D8438.diff
Wed, Sep 18, 2:27 PM
Unknown Object (File)
Sun, Sep 8, 9:28 AM
Unknown Object (File)
Wed, Sep 4, 11:33 PM
Unknown Object (File)
Wed, Sep 4, 1:52 PM
Unknown Object (File)
May 24 2024, 9:16 PM
Unknown Object (File)
Mar 1 2024, 12:35 PM
Subscribers

Details

Reviewers
cy
bdrewery
Summary

yacc has had a -o option since at least FreeBSD 3.0 so no bootstrapping is
required.

Test Plan

Passes buildworld

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 5835
Build 6124: arc lint + arc unit

Event Timeline

brooks retitled this revision from to Allow multiple .l.o, .y.o, or .y.c matches per Makefile..
brooks updated this object.
brooks edited the test plan for this revision. (Show Details)
brooks added reviewers: cy, bdrewery.

Generally, yacc sources that use a prefix instead of the default "yy" would still require custom rules. pmake doesn't support for example, conf_parse.o: YFLAGS+=-pconf_ like GNU make does so a custom rule would still be required.

share/mk/bsd.suffixes-posix.mk
31

In addition to generating a ${.PREFIX}.y.tab.c, a ${.PREFIX}.y.tab.h is also generated. A corresponding .l may reference the .h file.

Some .y files require a -pNNN prefix which will correspond to a .l file's -PNNN prefix: a custom per target YFLAGS.

36

Is there a way to pass a custom LFLAGS to a target without altering the global LFLAGS for the whole Makefile?

43

Could this be -o ${.TARGET} replacing the mv?

share/mk/bsd.suffixes.mk
73

Same comment as above.

85

For consistency, -o ?

share/mk/bsd.suffixes.mk
70

Missing space between y.tab.c and ${.

Arg. This change only worked because almost nothing actually uses these rules. The bsd.dep.mk rules for yacc are used instead. They have then genuinely bizarre and broken effect of generating a foo.[ch] files, but also keeping the y.tab.[ch] around because most .l files assume the default y.tab.h. Fixing this is probably a good idea but it's a considerably bigger job than I though.

share/mk/bsd.suffixes-posix.mk
43

I tried that, -o ${.TARGET} doesn't write a .c file, that still goes to stdout.