I want to use the same complex block of recipes for an implicit and a normal rule.
Also, I want make to echo the next command AFTER thre previous command executed.
Make does not allow mixing implicit and normal rules.
Desired output:
$ make foo bar.abc
echo a
a
echo b
b
echo a
a
echo b
b
This won’t work:
%.abc foo:
echo a
echo b
This will work:
CMD = echo a && echo b
foo:
$(CMD)
%.abc:
$(CMD)
but the output is not what I want:
$ make foo bar.abc
echo a && echo b
a
b
echo a && echo b
a
b
You can use
defineto assign multi-line values to variables: