U-Boot cleanup
authorUlf Samuelsson <ulf.samuelsson@atmel.com>
Fri, 20 Jul 2007 07:54:21 +0000 (07:54 -0000)
committerUlf Samuelsson <ulf.samuelsson@atmel.com>
Fri, 20 Jul 2007 07:54:21 +0000 (07:54 -0000)
target/device/Atmel/u-boot/u-boot.mk

index 0fa931bf416f153daf5343fb6ab7415973023e6d..c1e428423617dce925de5fdfbbae4b97b6fba4f2 100644 (file)
@@ -45,13 +45,12 @@ $(DL_DIR)/$(UBOOT_PATCH_SOURCE):
 $(UBOOT_DIR)/.unpacked: $(DL_DIR)/$(UBOOT_SOURCE)
        mkdir -p   $(BUILD_DIR)\r
        $(UBOOT_CAT) $(DL_DIR)/$(UBOOT_SOURCE) | tar -C $(BUILD_DIR) -xvf -\r
-       touch $(UBOOT_DIR)/.unpacked
-       ls      $(UBOOT_DIR)/.unpacked\r
+       touch   $@\r
 
 $(UBOOT_PATCHES)/.unpacked: $(DL_DIR)/$(UBOOT_PATCH_SOURCE)
        mkdir -p $(UBOOT_PATCHES)
        bzcat   $(DL_DIR)/$(UBOOT_PATCH_SOURCE) | tar -C $(UBOOT_PATCHES) -xvf -
-       touch $(UBOOT_PATCHES)/.unpacked\r
+       touch   $@\r
 \r
 $(UBOOT_DIR)/.patched.$(UBOOT_PATCH_SOURCE): $(UBOOT_DIR)/.unpacked $(UBOOT_PATCHES)/.unpacked\r
        toolchain/patch-kernel.sh $(UBOOT_DIR) $(UBOOT_PATCHES) *.patch
@@ -105,10 +104,10 @@ uboot-bin:        $(BINARIES_DIR)/$(UBOOT_BIN)    /tftpboot/$(UBOOT_BIN)
 
 $(UBOOT_BUILD_DIR)/.customized:        .config $(UBOOT_BUILD_DIR)/.configured
        echo    "/* Automatically generated file, do not edit */"               >  $(UBOOT_CUSTOM)
-ifneq  ($(HOSTNAME),)
+ifneq  ($(TARGET_HOSTNAME),)
        echo    "#if defined(CONFIG_HOSTNAME)"                                  >> $(UBOOT_CUSTOM)
        echo    "#undef  CONFIG_HOSTNAME"                                       >> $(UBOOT_CUSTOM)
-       echo    "#define CONFIG_HOSTNAME                $(HOSTNAME)"            >> $(UBOOT_CUSTOM)
+       echo    "#define CONFIG_HOSTNAME                $(TARGET_HOSTNAME)"     >> $(UBOOT_CUSTOM)
        echo    "#endif"                                                        >> $(UBOOT_CUSTOM)
 endif
 ifneq  ($(TARGET_UBOOT_IPADDR),)
@@ -144,7 +143,7 @@ endif
        echo setenv linux               $(LINUX26_KERNEL)                       >> $(UBOOT_SCR)
        echo setenv kernel-version      $(LINUX26_VERSION)                      >> $(UBOOT_SCR)
        echo setenv kernel-date         $(DATE)                                 >> $(UBOOT_SCR)
-       echo setenv hostname            $(HOSTNAME)                             >> $(UBOOT_SCR)
+       echo setenv hostname            $(TARGET_HOSTNAME)                      >> $(UBOOT_SCR)
        echo setenv fs-date             $(DATE)                                 >> $(UBOOT_SCR)
        echo setenv rd-1                rootfs.$(BR2_ARCH)-$(DATE).ext2         >> $(UBOOT_SCR)
        echo setenv rd-2                rootfs.$(BR2_ARCH)-$(DATE).jffs2        >> $(UBOOT_SCR)
@@ -159,7 +158,7 @@ endif
        echo setargs                                                            >> $(UBOOT_SCR)
        echo saveenv                                                            >> $(UBOOT_SCR)
 
-$(UBOOT_SCR).$(HOSTNAME):      $(UBOOT_SCR)     $(MKIMAGE)
+$(UBOOT_SCR).$(PROJECT):       $(UBOOT_SCR)     $(MKIMAGE)
        $(MKIMAGE)  -A arm \
                                -O linux        \
                                -T script       \
@@ -168,13 +167,13 @@ $(UBOOT_SCR).$(HOSTNAME): $(UBOOT_SCR)     $(MKIMAGE)
                                -e 0            \
                                -n "autoscr config" \
                                -d $(UBOOT_SCR) \
-                               $(UBOOT_SCR).$(HOSTNAME)
-       cp      $(UBOOT_SCR).$(HOSTNAME) /tftpboot
+                               $(UBOOT_SCR).$(PROJECT)
+       cp      $(UBOOT_SCR).$(PROJECT) /tftpboot
 
 $(MKIMAGE):    $(MKIMAGE_BINLOC) \r
        cp -f $(MKIMAGE_BINLOC)  $(MKIMAGE)\r
 \r
-uboot: $(MKIMAGE)      uboot-bin $(UBOOT_SCR).$(HOSTNAME)\r
+uboot: $(MKIMAGE)      uboot-bin $(UBOOT_SCR).$(PROJECT)\r
 
 uboot-source: $(DL_DIR)/$(UBOOT_SOURCE)\r
 \r
@@ -184,7 +183,7 @@ uboot-clean:
        rm -f   $(BINARIES_DIR)/$(UBOOT_BIN)
        rm -fr  $(UBOOT_DIR)
        rm -f   $(UBOOT_SCR)
-       rm -f   $(UBOOT_SCR).$(HOSTNAME)
+       rm -f   $(UBOOT_SCR).$(PROJECT)
 #      -$(MAKE) -C $(UBOOT_DIR)/uboot-tools clean\r
 \r
 uboot-dirclean:        uboot-clean\r
@@ -246,10 +245,30 @@ TARGETS+=uboot
 endif
 
 uboot-test:
+       -@echo  source=$(DL_DIR)/$(UBOOT_SOURCE)
+       -@ls    $(DL_DIR)/$(UBOOT_SOURCE)
+       -@echo  patch=$(DL_DIR)/$(UBOOT_PATCH_SOURCE)
+       -@ls    $(DL_DIR)/$(UBOOT_PATCH_SOURCE)
+       -@echo  unpacked=$(UBOOT_PATCHES)/.unpacked
+       -@ls    $(UBOOT_PATCHES)/.unpacked
+       -@echo  patch-unpacked=$(UBOOT_PATCHES)/.unpacked
+       -@ls    $(UBOOT_PATCHES)/.unpacked
+       -@echo  patched-source=$(UBOOT_DIR)/.patched.$(UBOOT_PATCH_SOURCE)
+       -@ls    $(UBOOT_DIR)/.patched.$(UBOOT_PATCH_SOURCE)
+       -@echo  configured=$(UBOOT_BUILD_DIR)/.configured
+       -@ls    $(UBOOT_BUILD_DIR)/.configured
+       -@echo  mkimage=$(MKIMAGE_BINLOC)
+       -@ls    $(MKIMAGE_BINLOC)
+       -@echo  u-boot.bin=$(UBOOT_BUILD_DIR)/u-boot.bin
+       -@ls    $(UBOOT_BUILD_DIR)/u-boot.bin
+       -@echo  binaries-u-boot.bin=$(BINARIES_DIR)/$(UBOOT_BIN)
+       -@ls    $(BINARIES_DIR)/$(UBOOT_BIN)
+       -@echo  tftpboot=/tftpboot/$(UBOOT_BIN)
+       -@ls    /tftpboot/$(UBOOT_BIN)
        -@echo  "mkimage = $(MKIMAGE)"
        -@ls    $(MKIMAGE)
-       -@echo  "u-boot script=$(UBOOT_SCR).$(HOSTNAME)"\r
-       -@ls    $(UBOOT_SCR).$(HOSTNAME)
+       -@echo  "u-boot script=$(UBOOT_SCR).$(PROJECT)"\r
+       -@ls    $(UBOOT_SCR).$(PROJECT)
        -@echo  "u-boot script (ASCII)=$(UBOOT_SCR)"
        -@ls    $(UBOOT_SCR)
        -@echo "mkimage binary=$(MKIMAGE_BINLOC)"