X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=Makefile;h=e56fa02b2c1e4356cd934ecda61bc9b383deb5f1;hb=f456445f29d22bb31ad29fdf1d6b2769decd37a2;hp=41437da2a6699cfa4adfb16510568d5f529c9233;hpb=566e5cf451ae7e33e31bb62ae5b9b258e33f8609;p=oweals%2Fu-boot.git diff --git a/Makefile b/Makefile index 41437da2a6..e56fa02b2c 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 @@ -140,7 +140,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 +163,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 +266,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 +293,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)) @@ -422,19 +452,6 @@ 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 $@ - $(TIMESTAMP_FILE): @LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > $@ @LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> $@ @@ -509,20 +526,33 @@ $(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): + @( 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 @@ -1017,20 +1047,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 - ######################################################################### ######################################################################### @@ -1062,7 +1078,7 @@ 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)