[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

environment variables in command part of rule

From: José Romildo Malaquias
Subject: environment variables in command part of rule
Date: Sat, 22 Oct 2011 06:50:59 -0200
User-agent: Mutt/1.5.21 (2010-09-15)


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

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

%.a : %.txt
        p=$$(cat $< | wc -l)
        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?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]