On Sat, Oct 29, 2005 at 10:32:26AM +0300, Angel Tsankov wrote:
> Consider the following makefile:
> 
> ###############################################################################
> 
> build_target    := ''
> target_folder    = Builds/$(build_target)
> 
> all: set_vars build
> @echo $(target_folder)
> 
> set_vars:
> $(eval build_target := $(patsubst %,debug,''))
> 
> build: $(target_folder)/a.out
> 
> $(target_folder)/a.out:
> @echo $@
> 
> ###############################################################################
> 
> make produces the following output when I execute make all (or just
> make):
> Builds//a.out
> Builds/debug
> 
> Is it possible to produce
> Builds/debug/a.out
> Builds/debug
> 
> If so, how?

You may want to consider setting the value of build_target using
conditionals (if you need it conditionally set) outside of any rule so
it gets set during the parsing phase.  It will have a value and will not
be the empty string as it must be in your example.

  Ken


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

Reply via email to