My understanding is that % is a stem pattern matching operation, meaning it
requires at least one character for the pattern match (which makes sense if
there is no suffix). However, I wanted to know if there is a way to pattern
match with empty string given that there is a suffix.
An example is the following situation.
In my filesystem, I have the following files at let's say the same level in
my filesystem for now.
where dependencies.config is a common configuration.
Let's say I write the following Makefile target as an example.
# Recipe would be here to create the target from the config...
I believe the above would capture 'linux_dependencies.config' and
'windows_dependencies.config' but not 'dependencies.config' since that
would lead to an empty stem. I believe to capture both, a separate rule can
be written for 'dependencies.config'. Not sure if there is a better way to
handle this situation from the Makefile perspective.
It would be interesting if there was some pattern match operator like %%
that can do empty string captures for pattern matching given there is a
On 2019-09-26 07:50, Rahul Rameshbabu wrote:
> Let's say I write the following Makefile target as an example.
> %dependencies.out: %dependencies.config
> # Recipe would be here to create the target from the config...
In this case, I think we could work around it like this:
Thus the "d" is just part of the variant prefix of the instances;
it just so happens that all such prefixes end in a "d".
Hey, this is no worse than calling a GNU library "iberty" so that
it can be linked with -liberty on the compiler command line. :)