Makefile中的ifeq 多条件使用 ***

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 16:08   1741   0

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))

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP