I am trying to create a pattern rule that allows me to use %
in a macro call and I am not getting the expected results.
Template Rule:
%.o: %.cpp $(%_H) g++ -o $@ $(FLAGS) -c $<
The problem is with $ (% _ H)
For some reason, %
does not apply to what it is defined for.
When I print the list of dependencies ($^)
, only the source file is printed.
I have a very clean way to configure my dependencies that I would like to use:
Another person suggested that I modify these variables into dependency lists.
those. Main_H: = $ (Diminisher_H)
becomes Main.o: $ (Diminisher_H)
This is a good solution, it works. However, the problem still remains that $(%_H)
is somehow invalid.
I would like to know how (if possible) to make this a valid expression.
I tried $( $%_H )
, $( $(%)_H )
, $( $(value %)_H )
and many others. It seems that %
just loses its meaning when calling a macro.
Can't use %
in a macro call?
source share