Hi Ignacio, I think you are trying to assign to a make variable from a command in a recipe. You can't do that, sorry. Consider that each line in a recipe runs in a separate shell: it cannot change variables in it's parent make process or even set shell variables for other lines in the same recipe.
To understand how to achieve your goal I think we need to know what you intend to do with CHECK. Is it really a counter or just a boolean? Do you just want to fail the build if it fails or do something else? Cheers, Duane. On Thu, Jun 1, 2017 at 1:28 AM, icvallejo <ignacio.carbajo.vall...@nfrance.com> wrote: > Hello all, I'm rookie with gnu make and I have a question; I'm doing a > Makefile like this: > > #!/bin/bash > # Makefile > > IMPORT_PATH := github.com/... > CHECK := 0 > > .PHONY: install > install: > $Q printf "\\nLet's install..." > # $Q export CHECK=0 > $Q if grep -q \!string "$(DIR)" ; then CHECK = $($CHECK + 1) ; fi > $Q printf "done!" > > > > I want that if the condition is good, update the value of CHECK from 0 to 1, > but I don't know how can I do this :S > > Can you help me please ? Thank you! > > > > -- > View this message in context: > http://gnu-make.2324884.n4.nabble.com/Uupdate-value-of-variable-tp17777.html > Sent from the Gnu - Make - Help mailing list archive at Nabble.com. > > _______________________________________________ > Help-make mailing list > Help-make@gnu.org > https://lists.gnu.org/mailman/listinfo/help-make -- "I never could learn to drink that blood and call it wine" - Bob Dylan _______________________________________________ Help-make mailing list Help-make@gnu.org https://lists.gnu.org/mailman/listinfo/help-make