]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - Makefile
km/common: simplify debug environment
[karo-tx-uboot.git] / Makefile
index 6bb54948d0a86cc9849bd603cc9f018df1bcecc8..10a9973f241d6edb444f4fc5a4cc72172ea1e764 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2010
+# (C) Copyright 2000-2011
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
@@ -24,7 +24,7 @@
 VERSION = 2011
 PATCHLEVEL = 06
 SUBLEVEL =
-EXTRAVERSION = -rc3
+EXTRAVERSION =
 ifneq "$(SUBLEVEL)" ""
 U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 else
@@ -104,10 +104,11 @@ $(if $(BUILD_DIR),,$(error output directory "$(saved-output)" does not exist))
 endif # ifneq ($(BUILD_DIR),)
 
 OBJTREE                := $(if $(BUILD_DIR),$(BUILD_DIR),$(CURDIR))
+SPLTREE                := $(OBJTREE)/spl
 SRCTREE                := $(CURDIR)
 TOPDIR         := $(SRCTREE)
 LNDIR          := $(OBJTREE)
-export TOPDIR SRCTREE OBJTREE
+export TOPDIR SRCTREE OBJTREE SPLTREE
 
 MKCONFIG       := $(SRCTREE)/mkconfig
 export MKCONFIG
@@ -266,7 +267,7 @@ endif
 LIBS += drivers/rtc/librtc.o
 LIBS += drivers/serial/libserial.o
 LIBS += drivers/twserial/libtws.o
-LIBS += drivers/usb/eth/libusb_eth.a
+LIBS += drivers/usb/eth/libusb_eth.o
 LIBS += drivers/usb/gadget/libusb_gadget.o
 LIBS += drivers/usb/host/libusb_host.o
 LIBS += drivers/usb/musb/libusb_musb.o
@@ -341,22 +342,15 @@ BOARD_SIZE_CHECK =
 endif
 
 # Always append ALL so that arch config.mk's can add custom ones
-ALL += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
+ALL-y += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
 
-ifeq ($(CONFIG_NAND_U_BOOT),y)
-ALL += $(obj)u-boot-nand.bin
-endif
-
-ifeq ($(CONFIG_ONENAND_U_BOOT),y)
-ALL += $(obj)u-boot-onenand.bin
+ALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin
+ALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin
 ONENAND_BIN ?= $(obj)onenand_ipl/onenand-ipl-2k.bin
-endif
-
-ifeq ($(CONFIG_MMC_U_BOOT),y)
-ALL += $(obj)mmc_spl/u-boot-mmc-spl.bin
-endif
+ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin
+ALL-$(CONFIG_SPL) += $(obj)spl/u-boot-spl.bin
 
-all:           $(ALL)
+all:           $(ALL-y)
 
 $(obj)u-boot.hex:      $(obj)u-boot
                $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
@@ -452,6 +446,9 @@ mmc_spl:    $(TIMESTAMP_FILE) $(VERSION_FILE) depend
 
 $(obj)mmc_spl/u-boot-mmc-spl.bin:      mmc_spl
 
+$(obj)spl/u-boot-spl.bin:              depend
+               $(MAKE) -C spl all
+
 $(TIMESTAMP_FILE):
                @LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > $@
                @LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> $@
@@ -536,6 +533,7 @@ tools: $(VERSION_FILE)
 endif  # config.mk
 
 $(VERSION_FILE):
+               @mkdir -p $(dir $(VERSION_FILE))
                @( localvers='$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ; \
                   printf '#define PLAIN_VERSION "%s%s"\n' \
                        "$(U_BOOT_VERSION)" "$${localvers}" ; \
@@ -1047,20 +1045,6 @@ smdk6400_config  :       unconfig
        @$(MKCONFIG) smdk6400 arm arm1176 smdk6400 samsung s3c64xx
        @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
 
-#========================================================================
-# Nios
-#========================================================================
-
-#########################################################################
-## Nios-II
-#########################################################################
-
-# nios2 generic boards
-NIOS2_GENERIC = nios2-generic
-
-$(NIOS2_GENERIC:%=%_config) : unconfig
-       @$(MKCONFIG) $@ nios2 nios2 nios2-generic altera
-
 #########################################################################
 #########################################################################
 
@@ -1092,11 +1076,12 @@ clean:
               $(obj)arch/blackfin/cpu/bootrom-asm-offsets.[chs]
        @rm -f $(obj)include/bmp_logo.h
        @rm -f $(obj)lib/asm-offsets.s
-       @rm -f $(obj)nand_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,System.map}
+       @rm -f $(obj)nand_spl/{u-boot.lds,u-boot-nand_spl.lds,u-boot-spl,u-boot-spl.map,System.map}
        @rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl.map}
        @rm -f $(obj)mmc_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}
        @rm -f $(ONENAND_BIN)
        @rm -f $(obj)onenand_ipl/u-boot.lds
+       @rm -f $(obj)spl/{u-boot-spl,u-boot-spl.bin,u-boot-spl.lds,u-boot-spl.map}
        @rm -f $(TIMESTAMP_FILE) $(VERSION_FILE)
        @find $(OBJTREE) -type f \
                \( -name 'core' -o -name '*.bak' -o -name '*~' \
@@ -1110,7 +1095,7 @@ clobber:  clean
                | xargs -0 rm -f
        @rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \
                $(obj)cscope.* $(obj)*.*~
-       @rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL)
+       @rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL-y)
        @rm -f $(obj)u-boot.kwb
        @rm -f $(obj)u-boot.imx
        @rm -f $(obj)tools/{env/crc32.c,inca-swap-bytes}
@@ -1121,12 +1106,9 @@ clobber: clean
        @[ ! -d $(obj)onenand_ipl ] || find $(obj)onenand_ipl -name "*" -type l -print | xargs rm -f
        @[ ! -d $(obj)mmc_spl ] || find $(obj)mmc_spl -name "*" -type l -print | xargs rm -f
 
-ifeq ($(OBJTREE),$(SRCTREE))
-mrproper \
-distclean:     clobber unconfig
-else
 mrproper \
 distclean:     clobber unconfig
+ifneq ($(OBJTREE),$(SRCTREE))
        rm -rf $(obj)*
 endif