we can pass the arguments to makefile like below,
make -f Makefile HOST_OS="Linux"
in Makefile,we can use HOST_OS macro as usual.
example:
in main_folder make file,
HOST_OS = "SunOS"
all:
cd Sub_folder && make -f Makefile HOST_OS=$(HOST_OS)
in Sub_folder make file,
all:
ifeq ($(HOST_OS),Linux)
[ tab] g++ main.cpp
else
[tab] cc main.cpp
endif
Tuesday, March 9, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment