ifeq ($(TARGET_PRODUCT),pixi445_gophone)
$(call remove-file)
endif
ifeq ($(TARGET_PRODUCT),pixi445_voltegophone)
$(call remove-file)
endif可使用以下代码代替:
ifneq (,$(filter $(TARGET_PRODUCT),pixi445_gophone pixi445_voltegophone))
$(call remove-file)
endif
ifeq ($(strip $(TARGET_PRODUCT)),$(filter $(TARGET_PRODUCT),pixi445_gophone pixi445_voltegophone))
$(call remove-file)
endif
本文介绍了一种简化针对特定产品配置的Makefile代码的方法,通过使用ifneq和filter函数组合来替代原有的多个ifeq条件判断,减少代码重复并提高可读性和可维护性。


被折叠的 条评论
为什么被折叠?



