ar71xx: image: add a few helper functions
authorGabor Juhos <juhosg@openwrt.org>
Thu, 23 Aug 2012 11:52:18 +0000 (11:52 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Thu, 23 Aug 2012 11:52:18 +0000 (11:52 +0000)
These functions will be used to simplify the Makefile.

SVN-Revision: 33237

target/linux/ar71xx/image/Makefile

index d885acb168fe3935a79f1856a0bd28e201319577..1f00ba063dd2d97ec5543b2c12b8da47be3c0d5c 100644 (file)
@@ -23,6 +23,26 @@ define factoryname
 $(call imgname,$(1),$(2))-factory.bin
 endef
 
+COMMA:=,
+
+define mkcmdline
+$(if $(1),board=$(1) )$(if $(2),console=$(2)$(COMMA)$(3))
+endef
+
+define SingleProfile
+  define Image/Build/Profile/$(3)
+       $$(call Image/Build/Template/$(2)/$$(1),$(1),$(4),$$(call mkcmdline,$(5),$(6),$(7)),$(8),$(9),$(10),$(11),$(12))
+  endef
+endef
+
+define MultiProfile
+  define Image/Build/Profile/$(1)
+       $(foreach p,$(2),
+               $$(call Image/Build/Profile/$p,$$(1))
+       )
+  endef
+endef
+
 LOADER_MAKE := $(NO_TRACE_MAKE) -C lzma-loader KDIR=$(KDIR)
 
 KDIR_TMP:=$(KDIR)/tmp