Hello.

I want to define and use environemtn variables in the command part of a
rule in a makefile. The variables will capture the output of some
commands.

For instance, I would like to have something like the following:

%.a : %.txt
        p=$$(cat $< | wc -l)
        q=$$((p+10))
        echo $$q > $@

That is, I want to:
* set $p to the number of lines in the prerequisite file $<, s
* set $q to that value plus 10
* create the target file using $q

How to correctly writhe this rule?

Romildo

_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to