define Build/sysupgrade-tar
sh $(TOPDIR)/scripts/sysupgrade-tar.sh \
--board $(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)) \
- --kernel $(word 1,$^) \
- --rootfs $(word 2,$^) \
+ --kernel $(call param_get_default,kernel,$(1),$(word 1,$^)) \
+ --rootfs $(call param_get_default,rootfs,$(1),$(word 2,$^)) \
$@
endef
target_params = $(subst +,$(space),$*)
param_get = $(patsubst $(1)=%,%,$(filter $(1)=%,$(2)))
+param_get_default = $(firstword $(call param_get,$(1),$(2)) $(3))
param_mangle = $(subst $(space),_,$(strip $(1)))
param_unmangle = $(subst _,$(space),$(1))