Reputation:
For a Makefile like this:
HOSTARCH := $(shell uname -u | sed -e s/i.86/i386/)
HOSTOS := $(shell uname -s | tr '[:upper:]''[:lower:]')
export HOSTARCH HOSTOS
unconfig:
@rm -f $(obj)include/config.h
versatilepb_config: unconfig
@board/versatile/split_by_variant.sh $@
when I tape " make versatilepb_config", where would it begin to execute? from the beginning or from "versatilepb_config"? we get the value of HOSTARCH,HOSTOS right now or not? Then how could I print the value of HOSTOS/HOSTARCH in the console?
Upvotes: 0
Views: 387
Reputation: 64203
The make build system is not executing sequentially (1st line, 2nd line, etc).
When you do make versatilepb_config
, it will execute in this order:
HOSTARCH
and HOSTOS
in your case)versatilepb_config
unconfig
@rm -f $(obj)include/config.h
@board/versatile/split_by_variant.sh $@
If anything fails, it will stop at that step.
So, if you want to print values from the unconfig
step, just add it there:
unconfig:
@rm -f $(obj)include/config.h
echo $HOSTARCH
echo $HOSTOS
Upvotes: 1