On Thu, 2010-11-04 at 18:04 +0100, Erik Rull wrote:
You should always use the variable $(MAKE), never the value 'make', when
invoking sub-makes.
in Makefile.install:
.PHONY: all
all:
$(call assert_target_dir,/etc)
[...]
What happens when I call make install:
mkdir -p /home/user/target/sbin
make -f Makefile.install
mkdir -p /home/user/target
^^ here is /etc missing!
so basically the funtion gets "exported" but it seems to be not possible to
give a parameter with the $(call ...)
Variable values are expanded before being placed into the environment
due to "export". That's why you see the behavior you do.
What's wrong here? Am I doing something wrong? or is it not possible to
define and export functions in such way?
export is not a good way to communicate between parent and child makes,
except for simple settings of static strings. What gets expanded when
it tricky to control. The best way to do this is by having a standard
makefile that sets these values, then including it in all your other
makefiles.