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
Unknown Object (File)
Thu, Oct 17, 8:11 AM
Unknown Object (File)
Oct 7 2024, 3:29 AM
Unknown Object (File)
Oct 3 2024, 2:21 PM
Unknown Object (File)
Oct 3 2024, 12:02 AM
Unknown Object (File)
Oct 2 2024, 3:07 PM
Unknown Object (File)
Oct 2 2024, 2:23 AM
Unknown Object (File)
Oct 1 2024, 2:57 PM
Unknown Object (File)
Sep 30 2024, 1:27 AM
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.