summaryrefslogtreecommitdiff
path: root/cleopatre
diff options
context:
space:
mode:
Diffstat (limited to 'cleopatre')
-rw-r--r--cleopatre/buildroot/Makefile4
-rw-r--r--cleopatre/buildroot/package/managerd/managerd.mk8
-rw-r--r--cleopatre/buildroot/target/device/Spidcom/response_file.mk59
3 files changed, 63 insertions, 8 deletions
diff --git a/cleopatre/buildroot/Makefile b/cleopatre/buildroot/Makefile
index 866515147b..3418fe2e98 100644
--- a/cleopatre/buildroot/Makefile
+++ b/cleopatre/buildroot/Makefile
@@ -469,11 +469,15 @@ distclean: clean
endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
+-include target/device/Spidcom/response_file.mk
+
%_defconfig: $(CONFIG)/conf
cp $(shell find ./target/ -name $@) .config
# If CCache tool exists, replace the BR2_TOOLCHAIN_EXTERNAL_PATH to use it.
if [ -e /opt/spidcom/spc300/ccache ]; then sed -i '/BR2_TOOLCHAIN_EXTERNAL_PATH=/s:spc300/usr:spc300/ccache:' .config; fi;
-@$(MAKE) oldconfig
+ # Generate response file
+ -@$(MAKE) response_file
update:
cp .config $(BOARD_PATH)/../$(BOARD_NAME)_defconfig
diff --git a/cleopatre/buildroot/package/managerd/managerd.mk b/cleopatre/buildroot/package/managerd/managerd.mk
index 6929d9f0e4..dd38451393 100644
--- a/cleopatre/buildroot/package/managerd/managerd.mk
+++ b/cleopatre/buildroot/package/managerd/managerd.mk
@@ -36,14 +36,6 @@ $(MANAGERD_DIR)/.unpacked:
touch $(MANAGERD_DIR)/.unpacked
$(MANAGERD_DIR)/.configured: $(MANAGERD_DIR)/.unpacked $(BUILDROOT_CONFIG_FILE)
-ifeq (y,$(findstring y,$(BR2_TARGET_SPIDCOM_SPK300)$(BR2_TARGET_SPIDCOM_SPK300G)))
- (echo "CONFIG_EXTRA_LEDS=y" ; \
- echo "CONFIG_LED1_GPIO_NUM=13" ; \
- echo "CONFIG_LED2_GPIO_NUM=12" ; \
- ) > $(MANAGERD_DIR)/.config
-else
- echo "# CONFIG_EXTRA_LEDS is not set" > $(MANAGERD_DIR)/.config
-endif
touch $(MANAGERD_DIR)/.configured
$(MANAGERD_DIR)/managerd: $(MANAGERD_DIR)/.configured
diff --git a/cleopatre/buildroot/target/device/Spidcom/response_file.mk b/cleopatre/buildroot/target/device/Spidcom/response_file.mk
new file mode 100644
index 0000000000..8690b0d175
--- /dev/null
+++ b/cleopatre/buildroot/target/device/Spidcom/response_file.mk
@@ -0,0 +1,59 @@
+#############################################################
+# 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
+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