summaryrefslogtreecommitdiff
path: root/cleopatre/buildroot/target/device/Spidcom/response_file.mk
blob: cf4f55a709102af2a5a76e5d7ca2eda43a51f4fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#############################################################
# 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),CONFIG_HAVE_POWER_LED)
  FLAGS:=$(call conditional_value,$(BR2_TARGET_SPIDCOM_MPR520),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