############################################################# # Copyright (C) 2012 by SPiDCOM technologies # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Library General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 # USA # # Macro functions # FLAGS:=FLAGS -D$(2) ifneq ($(1),) # FLAGS:=$(call conditional_define,$(1),$(2)) # $(1) can be a concatenation of several variables # example : # FLAGS:=$(call conditional_define,$(BR2_TARGET_SPIDCOM_SPK300)$(BR2_TARGET_SPIDCOM_SPK300G),CONFIG_EXTRA_LED) # $(1) will be true if either one of the 2 variable is set conditional_define=$(FLAGS) $(if $(1), -D$(2),) # FLAGS := FLAGS -D$(2)=$(3) ifneq ($(1),) # FLAGS:=$(call conditional_value,$(1),$(2),$(3)) # $(1) can be a concatenation of several variables # example : # FLAGS:=$(call conditional_value,$(BR2_TARGET_SPIDCOM_SPK300)$(BR2_TARGET_SPIDCOM_SPK300G),CONFIG_LED1_GPIO_NUM,13) # $(1) will be true if either one of the 2 variable is set conditional_value=$(FLAGS) $(if $(1), -D$(2)=$(3),) OUTPUT_DIR:=$(BASE_DIR)/.. FILE_NAME:=extra_flags # If some flags are needed for all boards... FLAGS:= # MSE500 specific ifeq ($(BR2_TARGET_SPIDCOM_ARCH_MSE500),y) FLAGS:=$(FLAGS) -DCONFIG_CHIP_FEATURE_EXTRA_NVRAM_FIELDS FLAGS:=$(call conditional_define,$(BR2_TARGET_SPIDCOM_MPR520)$(BR2_TARGET_SPIDCOM_MPR520E),CONFIG_HAVE_POWER_LED) FLAGS:=$(call conditional_value,$(BR2_TARGET_SPIDCOM_MPR520)$(BR2_TARGET_SPIDCOM_MPR520E),LED_ATTACHMENT_GPIO_NUM,4) endif # SPC300 specific ifeq ($(BR2_TARGET_SPIDCOM_ARCH_SPC300),y) FLAGS:=$(call conditional_define,$(BR2_TARGET_SPIDCOM_SPK300)$(BR2_TARGET_SPIDCOM_SPK300G),CONFIG_EXTRA_LED) FLAGS:=$(call conditional_value,$(BR2_TARGET_SPIDCOM_SPK300)$(BR2_TARGET_SPIDCOM_SPK300G),CONFIG_LED1_GPIO_NUM,13) FLAGS:=$(call conditional_value,$(BR2_TARGET_SPIDCOM_SPK300)$(BR2_TARGET_SPIDCOM_SPK300G),CONFIG_LED2_GPIO_NUM,12) endif response_file: @echo $(FLAGS) > $(OUTPUT_DIR)/$(FILE_NAME) @touch $(OUTPUT_DIR)/$(FILE_NAME) .PHONY: response_file