MAKEFILE多分支写法:
Android中的NDK程序android.mk判断当前是哪种CPU架构:
ifeq ($(TARGET_ARCH), arm) LOCAL_SRC_FILES := ... else ifeq ($(TARGET_ARCH), x86) LOCAL_SRC_FILES := ... else ifeq ($(TARGET_ARCH), mips) LOCAL_SRC_FILES := ... else LOCAL_SRC_FILES := ... endif
MAKEFILE多条件“或”:
ifneq ($(CONFIG_SUPPORT_BOOTLOADER_OTA_UPGRADE)_$(CONFIG_SUPPORT_REMOVE_LDO)_$(CONFIG_SUPPORT_TUNER_FORM_BOOT),0_0_0) source_dir_ota += $(ROOT)/ota/mid/common source_dir_ota += $(ROOT)/ota/driver/Tuner_demod source_dir_ota += $(ROOT)/ota/driver/Tuner_demod/Tuner/ source_dir_ota += $(ROOT)/ota/driver/Tuner_demod/Tuner_demod_api CONFIG_TUNERTYPE:=$(subst ",,$(CONFIG_TUNERTYPE))
MAKEFILE多条件“与”:
ifeq ($(CONFIG_SUPPORT_BOOTLOADER_OTA_UPGRADE)_$(CONFIG_SUPPORT_REMOVE_LDO)_$(CONFIG_SUPPORT_TUNER_FORM_BOOT),y_y_y) source_dir_ota += $(ROOT)/ota/mid/common source_dir_ota += $(ROOT)/ota/driver/Tuner_demod source_dir_ota += $(ROOT)/ota/driver/Tuner_demod/Tuner/ source_dir_ota += $(ROOT)/ota/driver/Tuner_demod/Tuner_demod_api CONFIG_TUNERTYPE:=$(subst ",,$(CONFIG_TUNERTYPE))