[OpenWrt-Devel] [PATCH] [mpc83xx] add menuconfig-option for rb333 and rb600

Claudio Thomas ct at xmodus-systems.de
Mon Jul 21 11:46:01 EDT 2014


Add new target-profile for both boards in menuconfig.
Replaced unconditional Makefile directives with such that depends on menuconfig settings.
The default behaviour remains to be as it was: to compile for both.

Signed-off-by: Claudio Thomas <ct at xmodus-systems.de>
---
 target/linux/mpc83xx/Makefile               | 12 +++++++++++-
 target/linux/mpc83xx/image/Makefile         | 10 ++++++++--
 target/linux/mpc83xx/profiles/00-default.mk | 16 ++++++++++++++++
 target/linux/mpc83xx/profiles/mikrotik.mk   | 24 ++++++++++++++++++++++++
 4 files changed, 59 insertions(+), 3 deletions(-)
 create mode 100644 target/linux/mpc83xx/profiles/00-default.mk
 create mode 100644 target/linux/mpc83xx/profiles/mikrotik.mk

diff --git a/target/linux/mpc83xx/Makefile b/target/linux/mpc83xx/Makefile
index 915faec..6a49c53 100644
--- a/target/linux/mpc83xx/Makefile
+++ b/target/linux/mpc83xx/Makefile
@@ -23,6 +23,16 @@ define Target/Description
 	Build firmware images for Freescale MPC83xx based boards (eg. RouterBoard 600).
 endef
 
-KERNELNAME:="uImage dtbImage.rb600 dtbImage.rb333"
+KERNELNAME:="uImage"
+ifeq ($(CONFIG_TARGET_mpc83xx_Default),y)
+	KERNELNAME+="dtbImage.rb600 dtbImage.rb333"
+else
+	ifeq ($(CONFIG_TARGET_mpc83xx_rb333),y)
+		KERNELNAME+="dtbImage.rb333"
+	endif
+	ifeq ($(CONFIG_TARGET_mpc83xx_rb600),y)
+		KERNELNAME+="dtbImage.rb600"
+	endif
+endif
 
 $(eval $(call BuildTarget))
diff --git a/target/linux/mpc83xx/image/Makefile b/target/linux/mpc83xx/image/Makefile
index c7458f1..3921426 100644
--- a/target/linux/mpc83xx/image/Makefile
+++ b/target/linux/mpc83xx/image/Makefile
@@ -13,8 +13,14 @@ define Image/Prepare
 endef
 
 define Image/BuildKernel
-	cp $(LINUX_DIR)/arch/powerpc/boot/dtbImage.rb600.elf $(BIN_DIR)/openwrt-$(BOARD)-rb600.elf
-	cp $(LINUX_DIR)/arch/powerpc/boot/dtbImage.rb333.elf $(BIN_DIR)/openwrt-$(BOARD)-rb333.elf
+	$(if $(filter $(CONFIG_TARGET_mpc83xx_Default),y), \
+		cp $(LINUX_DIR)/arch/powerpc/boot/dtbImage.rb333.elf $(BIN_DIR)/openwrt-$(BOARD)-rb333.elf; \
+		cp $(LINUX_DIR)/arch/powerpc/boot/dtbImage.rb600.elf $(BIN_DIR)/openwrt-$(BOARD)-rb600.elf; \
+		)
+	$(if $(filter $(CONFIG_TARGET_mpc83xx_rb333),y), \
+		cp $(LINUX_DIR)/arch/powerpc/boot/dtbImage.rb333.elf $(BIN_DIR)/openwrt-$(BOARD)-rb333.elf ) 
+	$(if $(filter $(CONFIG_TARGET_mpc83xx_rb600),y), \
+		cp $(LINUX_DIR)/arch/powerpc/boot/dtbImage.rb600.elf $(BIN_DIR)/openwrt-$(BOARD)-rb600.elf )
 	cp $(KDIR)/uImage $(BIN_DIR)/openwrt-$(BOARD)-uImage
 endef
 
diff --git a/target/linux/mpc83xx/profiles/00-default.mk b/target/linux/mpc83xx/profiles/00-default.mk
new file mode 100644
index 0000000..b30c4b6
--- /dev/null
+++ b/target/linux/mpc83xx/profiles/00-default.mk
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2014 Xmodus Systems GmbH, Claudio Thomas <ct at xmodus-systems.de>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/Default
+  NAME:=Default (all)
+endef
+
+define Profile/Default/Description
+	Default package set compatible with most boards (compile all).
+endef
+$(eval $(call Profile,Default))
+
diff --git a/target/linux/mpc83xx/profiles/mikrotik.mk b/target/linux/mpc83xx/profiles/mikrotik.mk
new file mode 100644
index 0000000..389ff12
--- /dev/null
+++ b/target/linux/mpc83xx/profiles/mikrotik.mk
@@ -0,0 +1,24 @@
+#
+# Copyright (C) 2014 Xmodus Systems GmbH, Claudio Thomas <ct at xmodus-systems.de>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/rb333
+  NAME:=Mikrotik RouterBOARD 333
+endef
+
+define Profile/rb333/Description
+	Mikrotik RouterBOARD 333.
+endef
+$(eval $(call Profile,rb333))
+
+define Profile/rb600
+  NAME:=Mikrotik RouterBOARD 600
+endef
+
+define Profile/rb600/Description
+	Mikrotik RouterBOARD 600.
+endef
+$(eval $(call Profile,rb600))
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list