packages: uboot-mxs: bless UBOOT_IMAGE with a meaning
[openwrt/staging/wigyori.git] / package / boot / uboot-mxs / Makefile
index 1686f60a18932b298dbb94953ab17f827075a573..373b8d8f80ed288103c216e296cb973e811d25c7 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2013 OpenWrt.org
+# Copyright (C) 2013-2015 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -40,7 +40,6 @@ endef
 UBOOTS := \
        mx23_olinuxino \
        duckbill
-       
 
 define Package/uboot/template
 define Package/uboot-mxs-$(1)
@@ -63,7 +62,7 @@ endef
 ifdef BUILD_VARIANT
 $(eval $(call uboot/$(BUILD_VARIANT)))
 UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
-UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
+UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),u-boot.sb)
 endif
 
 define Build/Configure
@@ -73,13 +72,12 @@ endef
 
 define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) \
-               CROSS_COMPILE=$(TARGET_CROSS) u-boot.sb
+               CROSS_COMPILE=$(TARGET_CROSS) $(UBOOT_IMAGE)
 endef
 
-
 define Package/uboot/install/default
        $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
-       dd if=$(PKG_BUILD_DIR)/u-boot.sb of=$(BIN_DIR)/uboot-$(BOARD)-$(1).sb bs=512 seek=4
+       $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(BIN_DIR)/uboot-$(BOARD)-$(1)/uboot-$(BOARD)-$(1).sb
 endef
 
 define Package/uboot/install/template