[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
executing a rule prior to any targets?
From: |
gk |
Subject: |
executing a rule prior to any targets? |
Date: |
Fri, 18 Oct 2002 15:44:57 -0700 |
I am trying to write a Makefile that will automatically execute a rule when
an environmental variable is set, regardless of any goals/targets to be built.
I seem to be having trouble with $(if ) function since the following
makefile generates error.
It appears that $(if ) does not allow semi-colon inside $(shell ) function?
There is no problem with my rule since 'make recurse' works when the $(if )
function is removed.
I would appreciate a better solution or anything that works.
--- From command shell I execute:
$export RECURSE=1
$make
Makefile:3: *** unterminated call to function 'if': missing ')'. Stop.
--- Here is my makefile:
.PHONY: recurse foo
$(if $(RECURSE), $(shell RECURSE=; $(MAKE) recurse ) )
foo : ;
recurse :
@echo recursing...;\
for subdirectory in "1 2 3"; do \
echo $$subdirectory;\
done \
----
Thanks,
Greg Keraunen <address@hidden>
- executing a rule prior to any targets?,
gk <=
- Re: executing a rule prior to any targets?, Paul D. Smith, 2002/10/19
- Re: executing a rule prior to any targets?, gk, 2002/10/19
- Re: executing a rule prior to any targets?, Paul D. Smith, 2002/10/19
- Re: executing a rule prior to any targets?, gk, 2002/10/20
- Re: executing a rule prior to any targets?, Philip Guenther, 2002/10/20
- Recursive Make Considered Harmful (was: Re: executing a rule prior to any targets?), gk, 2002/10/20
- Re: Recursive Make Considered Harmful (was: Re: executing a rule prior to any targets?), Philip Guenther, 2002/10/20
- Re: Recursive Make Considered Harmful (was: Re: executing a rule prior to any targets?), gk, 2002/10/23
- Re: Recursive Make Considered Harmful (was: Re: executing a rule prior to any targets?), Philip Guenther, 2002/10/24
- Re: Recursive Make Considered Harmful (was: Re: executing a rule prior to any targets?), gk, 2002/10/24