X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=Makefile;h=ac757e6df1359b97dc89006533ed9b3156a9a4e2;hb=85f3df1c3a6e8f8f0c7a1daa0cdc3714daf967d7;hp=d14955f3f1403b646928be79735418aff6f39960;hpb=79cfe422615c010a75ece41662a05cd432ada389;p=karo-tx-uboot.git diff --git a/Makefile b/Makefile index d14955f3f1..ac757e6df1 100644 --- 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 @@ -140,7 +141,7 @@ SUBDIRS = tools \ examples/standalone \ examples/api -.PHONY : $(SUBDIRS) +.PHONY : $(SUBDIRS) $(VERSION_FILE) ifeq ($(obj)include/config.mk,$(wildcard $(obj)include/config.mk)) @@ -163,6 +164,36 @@ endif # load other configuration include $(TOPDIR)/config.mk +# If board code explicitly specified LDSCRIPT or CONFIG_SYS_LDSCRIPT, use +# that (or fail if absent). Otherwise, search for a linker script in a +# standard location. + +ifndef LDSCRIPT + #LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug + ifdef CONFIG_SYS_LDSCRIPT + # need to strip off double quotes + LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT)) + endif +endif + +ifndef LDSCRIPT + ifeq ($(CONFIG_NAND_U_BOOT),y) + LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds + ifeq ($(wildcard $(LDSCRIPT)),) + LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds + endif + endif + ifeq ($(wildcard $(LDSCRIPT)),) + LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds + endif + ifeq ($(wildcard $(LDSCRIPT)),) + LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot.lds + endif + ifeq ($(wildcard $(LDSCRIPT)),) +$(error could not find linker script) + endif +endif + ######################################################################### # U-Boot objects....order is important (i.e. start must be first) @@ -236,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 @@ -263,7 +294,7 @@ LIBS += $(CPUDIR)/s5p-common/libs5p-common.o endif LIBS := $(addprefix $(obj),$(sort $(LIBS))) -.PHONY : $(LIBS) $(TIMESTAMP_FILE) $(VERSION_FILE) +.PHONY : $(LIBS) $(TIMESTAMP_FILE) LIBBOARD = board/$(BOARDDIR)/lib$(BOARD).o LIBBOARD := $(addprefix $(obj),$(LIBBOARD)) @@ -311,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 - -ifeq ($(CONFIG_NAND_U_BOOT),y) -ALL += $(obj)u-boot-nand.bin -endif +ALL-y += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map -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 $< $@ @@ -351,7 +375,7 @@ $(obj)u-boot.ldr.srec: $(obj)u-boot.ldr $(obj)u-boot.img: $(obj)u-boot.bin $(obj)tools/mkimage -A $(ARCH) -T firmware -C none \ - -a $(CONFIG_SYS_TEXT_BASE) -e 0 \ + -O u-boot -a $(CONFIG_SYS_TEXT_BASE) -e 0 \ -n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \ sed -e 's/"[ ]*$$/ for $(BOARD) board"/') \ -d $< $@ @@ -370,6 +394,10 @@ $(obj)u-boot.sha1: $(obj)u-boot.bin $(obj)u-boot.dis: $(obj)u-boot $(OBJDUMP) -d $< > $@ +$(obj)u-boot.ubl: $(obj)u-boot-nand.bin + $(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \ + -e $(CONFIG_SYS_TEXT_BASE) -d $< $@ + GEN_UBOOT = \ UNDEF_SYM=`$(OBJDUMP) -x $(LIBBOARD) $(LIBS) | \ sed -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\ @@ -422,18 +450,8 @@ mmc_spl: $(TIMESTAMP_FILE) $(VERSION_FILE) depend $(obj)mmc_spl/u-boot-mmc-spl.bin: mmc_spl -$(VERSION_FILE): - @( localvers='$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ; \ - printf '#define PLAIN_VERSION "%s%s"\n' \ - "$(U_BOOT_VERSION)" "$${localvers}" ; \ - printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' \ - "$(U_BOOT_VERSION)" "$${localvers}" ; \ - ) > $@.tmp - @( printf '#define CC_VERSION_STRING "%s"\n' \ - '$(shell $(CC) --version | head -n 1)' )>> $@.tmp - @( printf '#define LD_VERSION_STRING "%s"\n' \ - '$(shell $(LD) -v | head -n 1)' )>> $@.tmp - @cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@ +$(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"' > $@ @@ -454,15 +472,19 @@ TAG_SUBDIRS = $(SUBDIRS) TAG_SUBDIRS += $(dir $(__LIBS)) TAG_SUBDIRS += include +FIND := find +FINDFLAGS := -L + tags ctags: - ctags -w -o $(obj)ctags `find $(TAG_SUBDIRS) \ + ctags -w -o $(obj)ctags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \ -name '*.[chS]' -print` etags: - etags -a -o $(obj)etags `find $(TAG_SUBDIRS) \ + etags -a -o $(obj)etags `$(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) \ -name '*.[chS]' -print` cscope: - find $(TAG_SUBDIRS) -name '*.[chS]' -print > cscope.files + $(FIND) $(FINDFLAGS) $(TAG_SUBDIRS) -name '*.[chS]' -print > \ + cscope.files cscope -b -q -k SYSTEM_MAP = \ @@ -509,20 +531,34 @@ $(obj)lib/asm-offsets.s: $(obj)include/autoconf.mk.dep \ else # !config.mk all $(obj)u-boot.hex $(obj)u-boot.srec $(obj)u-boot.bin \ $(obj)u-boot.img $(obj)u-boot.dis $(obj)u-boot \ -$(filter-out tools,$(SUBDIRS)) $(TIMESTAMP_FILE) $(VERSION_FILE) \ +$(filter-out tools,$(SUBDIRS)) $(TIMESTAMP_FILE) \ updater depend dep tags ctags etags cscope $(obj)System.map: @echo "System not configured - see README" >&2 @ exit 1 -tools: +tools: $(VERSION_FILE) $(MAKE) -C $@ all 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}" ; \ + printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' \ + "$(U_BOOT_VERSION)" "$${localvers}" ; \ + ) > $@.tmp + @( printf '#define CC_VERSION_STRING "%s"\n' \ + '$(shell $(CC) --version | head -n 1)' )>> $@.tmp + @( printf '#define LD_VERSION_STRING "%s"\n' \ + '$(shell $(LD) -v | head -n 1)' )>> $@.tmp + @cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@ + easylogo env gdb: $(MAKE) -C tools/$@ all MTD_VERSION=${MTD_VERSION} gdbtools: gdb -tools-all: easylogo env gdb +tools-all: easylogo env gdb $(VERSION_FILE) $(MAKE) -C tools HOST_TOOLS_ALL=y .PHONY : CHANGELOG @@ -937,29 +973,6 @@ SX1_config: unconfig fi; @$(MKCONFIG) -n $@ SX1 arm arm925t sx1 -# TRAB default configuration: 8 MB Flash, 32 MB RAM -trab_config \ -trab_bigram_config \ -trab_bigflash_config \ -trab_old_config: unconfig - @mkdir -p $(obj)include - @mkdir -p $(obj)board/trab - @[ -z "$(findstring _bigram,$@)" ] || \ - { echo "#define CONFIG_FLASH_8MB" >>$(obj)include/config.h ; \ - echo "#define CONFIG_RAM_32MB" >>$(obj)include/config.h ; \ - } - @[ -z "$(findstring _bigflash,$@)" ] || \ - { echo "#define CONFIG_FLASH_16MB" >>$(obj)include/config.h ; \ - echo "#define CONFIG_RAM_16MB" >>$(obj)include/config.h ; \ - echo "CONFIG_SYS_TEXT_BASE = 0x0CF40000" >$(obj)board/trab/config.tmp ; \ - } - @[ -z "$(findstring _old,$@)" ] || \ - { echo "#define CONFIG_FLASH_8MB" >>$(obj)include/config.h ; \ - echo "#define CONFIG_RAM_16MB" >>$(obj)include/config.h ; \ - echo "CONFIG_SYS_TEXT_BASE = 0x0CF40000" >$(obj)board/trab/config.tmp ; \ - } - @$(MKCONFIG) -n $@ -a trab arm arm920t trab - s3c24x0 - tx25_config : unconfig @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk @$(MKCONFIG) $@ arm arm926ejs tx25 karo mx25 @@ -1040,20 +1053,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 - ######################################################################### ######################################################################### @@ -1079,17 +1078,18 @@ clean: @rm -f $(obj)board/cray/L1/{bootscript.c,bootscript.image} \ $(obj)board/matrix_vision/*/bootscript.img \ $(obj)board/netstar/{eeprom,crcek,crcit,*.srec,*.bin} \ - $(obj)board/trab/trab_fkt $(obj)board/voiceblue/eeprom \ + $(obj)board/voiceblue/eeprom \ $(obj)board/armltd/{integratorap,integratorcp}/u-boot.lds \ $(obj)u-boot.lds \ $(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 '*~' \ @@ -1103,9 +1103,10 @@ 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)u-boot.ubl @rm -f $(obj)tools/{env/crc32.c,inca-swap-bytes} @rm -f $(obj)arch/powerpc/cpu/mpc824x/bedbug_603e.c @rm -fr $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm @@ -1114,12 +1115,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