Closed typeless closed 1 year ago
The Tupfiles for tup itself do this (for one file at least). In Tuprules.tup: https://github.com/gittup/tup/blob/8739d02408b4e215bb419ae6dfbe17a76b5d0518/Tuprules.tup#L85
Which gets used for lua.c in this Tupfile: https://github.com/gittup/tup/blob/8739d02408b4e215bb419ae6dfbe17a76b5d0518/src/lua/Tupfile#L41
The %-flags are expanded before the variable substitutions, so $(CFLAGS_%f)
becomes $(CFLAGS_lua.c)
which is then expanded to -Usig_atomic_t
Does something similar work for your setup?
Cool! I didn't expect $(CFLAGS_%f) would work. I'll try this for my project now and see if it fits well.
It does work. Even better, the %f
in $(CFLAGS_%f)
can contain slashes withou problems.
So, I am cloing this feature request. Thank you.
Currently, we can set the
CFLAGS
variable for a bunch of source files in a Tup rule such asHowever, there is no straightforward way to customize CFLAGS for a specific source file. For instance
That is, when a variable is expanded in the 'foreach' rule, only specific files (
a.c
, in this case) are compiled with the overriden CFLAGS.