【发布时间】:2015-07-03 03:31:57
【问题描述】:
我有一个makefile,我想有条件地在其中包含一个特定的src 文件。 makefile 看起来像:
###############################################
# Load default top-level config
include $(WORKROOT)/build/linux/config.mk
ifndef START_TIME
export START_TIME:="$(shell date +%s)"
endif
#include $(MAK_DIR)/source.inc
include $(WORKROOT)/build/linux/source.inc
在config.mk 中是这样的:
export FLAGS = \
-DFLAGA \
-DFLAGB
在source.inc我想:
#IF FLAGA is defined in FLAGS in config.mk THEN:
my-objs += \
$(WORKROOT)/My_DIR/specific_src.cpp
#ENDIF
我该怎么做?
【问题讨论】: