public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] config.mk: move LDSCRIPT processing to the top-level Makefile
@ 2011-06-20 22:45 Ilya Yanok
  2011-06-20 22:45 ` [U-Boot] [PATCH 2/3] Makefile: move $(VERSION_FILE) rule out of ifeq configured Ilya Yanok
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Ilya Yanok @ 2011-06-20 22:45 UTC (permalink / raw)
  To: u-boot

LDSCRIPT is used only from the top-level Makefile and only when the
system is configured so we can move LDSCRIPT and CONFIG_SYS_LDSCRIPT
related logic into the top level Makefile and under configured condition
to avoid errors when building tools from unconfigured tree.

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
---
 Makefile  |   30 ++++++++++++++++++++++++++++++
 config.mk |   30 ------------------------------
 2 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/Makefile b/Makefile
index dcf5d93..e73cfc7 100644
--- a/Makefile
+++ b/Makefile
@@ -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)
 
diff --git a/config.mk b/config.mk
index 7ce554e..2eb7fa2 100644
--- a/config.mk
+++ b/config.mk
@@ -154,36 +154,6 @@ RELFLAGS= $(PLATFORM_RELFLAGS)
 DBGFLAGS= -g # -DDEBUG
 OPTFLAGS= -Os #-fomit-frame-pointer
 
-# 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
-
 OBJCFLAGS += --gap-fill=0xff
 
 gccincdir := $(shell $(CC) -print-file-name=include)
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 2/3] Makefile: move $(VERSION_FILE) rule out of ifeq configured
  2011-06-20 22:45 [U-Boot] [PATCH 1/3] config.mk: move LDSCRIPT processing to the top-level Makefile Ilya Yanok
@ 2011-06-20 22:45 ` Ilya Yanok
  2011-06-21  1:57   ` Mike Frysinger
  2011-06-20 22:45 ` [U-Boot] [PATCH 3/3] tools/Makefile: fix errors during deps generation for envcrc Ilya Yanok
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Ilya Yanok @ 2011-06-20 22:45 UTC (permalink / raw)
  To: u-boot

mkimage relies on autogenerated version so we need to move
$(VERSION_FILE) rule out of ifeq and make tools rule depend on it to be
able to run 'make tools' from the unconfigured tree.

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
---
 Makefile |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/Makefile b/Makefile
index e73cfc7..f264c0c 100644
--- a/Makefile
+++ b/Makefile
@@ -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))
 
@@ -293,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))
@@ -452,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"' >> $@
@@ -539,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
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 3/3] tools/Makefile: fix errors during deps generation for envcrc
  2011-06-20 22:45 [U-Boot] [PATCH 1/3] config.mk: move LDSCRIPT processing to the top-level Makefile Ilya Yanok
  2011-06-20 22:45 ` [U-Boot] [PATCH 2/3] Makefile: move $(VERSION_FILE) rule out of ifeq configured Ilya Yanok
@ 2011-06-20 22:45 ` Ilya Yanok
  2011-06-21  1:58   ` Mike Frysinger
  2011-06-22 18:05   ` Wolfgang Denk
  2011-06-21  1:57 ` [U-Boot] [PATCH 1/3] config.mk: move LDSCRIPT processing to the top-level Makefile Mike Frysinger
  2011-06-22 18:05 ` Wolfgang Denk
  3 siblings, 2 replies; 8+ messages in thread
From: Ilya Yanok @ 2011-06-20 22:45 UTC (permalink / raw)
  To: u-boot

From: Mike Frysinger <vapier@gentoo.org>

Dependencies for the envcrc objects should be generated only in the case
we are going to build envcrc itself. Otherwise it's a waste of work and
can lead to the (harmless but annoying) errors during dependency
generation.

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
---
 tools/Makefile |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 623f908..97f83f8 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -48,17 +48,21 @@ CONFIG_NETCONSOLE = y
 CONFIG_SHA1_CHECK_UB_IMG = y
 endif
 
+# Merge all the different vars for envcrc into one
+ENVCRC-$(CONFIG_ENV_IS_EMBEDDED) = y
+ENVCRC-$(CONFIG_ENV_IS_IN_DATAFLASH) = y
+ENVCRC-$(CONFIG_ENV_IS_IN_EEPROM) = y
+ENVCRC-$(CONFIG_ENV_IS_IN_FLASH) = y
+ENVCRC-$(CONFIG_ENV_IS_IN_ONENAND) = y
+ENVCRC-$(CONFIG_ENV_IS_IN_NAND) = y
+ENVCRC-$(CONFIG_ENV_IS_IN_NVRAM) = y
+ENVCRC-$(CONFIG_ENV_IS_IN_SPI_FLASH) = y
+CONFIG_BUILD_ENVCRC ?= $(ENVCRC-y)
+
 # Generated executable files
 BIN_FILES-$(CONFIG_LCD_LOGO) += bmp_logo$(SFX)
 BIN_FILES-$(CONFIG_VIDEO_LOGO) += bmp_logo$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_EMBEDDED) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_DATAFLASH) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_EEPROM) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_FLASH) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_ONENAND) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_NAND) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_NVRAM) += envcrc$(SFX)
-BIN_FILES-$(CONFIG_ENV_IS_IN_SPI_FLASH) += envcrc$(SFX)
+BIN_FILES-$(CONFIG_BUILD_ENVCRC) += envcrc$(SFX)
 BIN_FILES-$(CONFIG_CMD_NET) += gen_eth_addr$(SFX)
 BIN_FILES-$(CONFIG_CMD_LOADS) += img2srec$(SFX)
 BIN_FILES-$(CONFIG_INCA_IP) += inca-swap-bytes$(SFX)
@@ -67,7 +71,7 @@ BIN_FILES-$(CONFIG_NETCONSOLE) += ncb$(SFX)
 BIN_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX)
 
 # Source files which exist outside the tools directory
-EXT_OBJ_FILES-y += common/env_embedded.o
+EXT_OBJ_FILES-$(CONFIG_BUILD_ENVCRC) += common/env_embedded.o
 EXT_OBJ_FILES-y += common/image.o
 EXT_OBJ_FILES-y += lib/crc32.o
 EXT_OBJ_FILES-y += lib/md5.o
@@ -77,7 +81,7 @@ EXT_OBJ_FILES-y += lib/sha1.o
 OBJ_FILES-$(CONFIG_LCD_LOGO) += bmp_logo.o
 OBJ_FILES-$(CONFIG_VIDEO_LOGO) += bmp_logo.o
 NOPED_OBJ_FILES-y += default_image.o
-OBJ_FILES-y += envcrc.o
+OBJ_FILES-$(CONFIG_BUILD_ENVCRC) += envcrc.o
 NOPED_OBJ_FILES-y += fit_image.o
 OBJ_FILES-$(CONFIG_CMD_NET) += gen_eth_addr.o
 OBJ_FILES-$(CONFIG_CMD_LOADS) += img2srec.o
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 1/3] config.mk: move LDSCRIPT processing to the top-level Makefile
  2011-06-20 22:45 [U-Boot] [PATCH 1/3] config.mk: move LDSCRIPT processing to the top-level Makefile Ilya Yanok
  2011-06-20 22:45 ` [U-Boot] [PATCH 2/3] Makefile: move $(VERSION_FILE) rule out of ifeq configured Ilya Yanok
  2011-06-20 22:45 ` [U-Boot] [PATCH 3/3] tools/Makefile: fix errors during deps generation for envcrc Ilya Yanok
@ 2011-06-21  1:57 ` Mike Frysinger
  2011-06-22 18:05 ` Wolfgang Denk
  3 siblings, 0 replies; 8+ messages in thread
From: Mike Frysinger @ 2011-06-21  1:57 UTC (permalink / raw)
  To: u-boot

Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110620/1f1177a2/attachment.pgp 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 2/3] Makefile: move $(VERSION_FILE) rule out of ifeq configured
  2011-06-20 22:45 ` [U-Boot] [PATCH 2/3] Makefile: move $(VERSION_FILE) rule out of ifeq configured Ilya Yanok
@ 2011-06-21  1:57   ` Mike Frysinger
  0 siblings, 0 replies; 8+ messages in thread
From: Mike Frysinger @ 2011-06-21  1:57 UTC (permalink / raw)
  To: u-boot

Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110620/b5edc30d/attachment.pgp 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 3/3] tools/Makefile: fix errors during deps generation for envcrc
  2011-06-20 22:45 ` [U-Boot] [PATCH 3/3] tools/Makefile: fix errors during deps generation for envcrc Ilya Yanok
@ 2011-06-21  1:58   ` Mike Frysinger
  2011-06-22 18:05   ` Wolfgang Denk
  1 sibling, 0 replies; 8+ messages in thread
From: Mike Frysinger @ 2011-06-21  1:58 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110620/f4fe863d/attachment.pgp 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 1/3] config.mk: move LDSCRIPT processing to the top-level Makefile
  2011-06-20 22:45 [U-Boot] [PATCH 1/3] config.mk: move LDSCRIPT processing to the top-level Makefile Ilya Yanok
                   ` (2 preceding siblings ...)
  2011-06-21  1:57 ` [U-Boot] [PATCH 1/3] config.mk: move LDSCRIPT processing to the top-level Makefile Mike Frysinger
@ 2011-06-22 18:05 ` Wolfgang Denk
  3 siblings, 0 replies; 8+ messages in thread
From: Wolfgang Denk @ 2011-06-22 18:05 UTC (permalink / raw)
  To: u-boot

Dear Ilya Yanok,

In message <1308609939-23337-1-git-send-email-yanok@emcraft.com> you wrote:
> LDSCRIPT is used only from the top-level Makefile and only when the
> system is configured so we can move LDSCRIPT and CONFIG_SYS_LDSCRIPT
> related logic into the top level Makefile and under configured condition
> to avoid errors when building tools from unconfigured tree.
> 
> Signed-off-by: Ilya Yanok <yanok@emcraft.com>
> ---
>  Makefile  |   30 ++++++++++++++++++++++++++++++
>  config.mk |   30 ------------------------------
>  2 files changed, 30 insertions(+), 30 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Don't panic.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH 3/3] tools/Makefile: fix errors during deps generation for envcrc
  2011-06-20 22:45 ` [U-Boot] [PATCH 3/3] tools/Makefile: fix errors during deps generation for envcrc Ilya Yanok
  2011-06-21  1:58   ` Mike Frysinger
@ 2011-06-22 18:05   ` Wolfgang Denk
  1 sibling, 0 replies; 8+ messages in thread
From: Wolfgang Denk @ 2011-06-22 18:05 UTC (permalink / raw)
  To: u-boot

Dear Ilya Yanok,

In message <1308609939-23337-3-git-send-email-yanok@emcraft.com> you wrote:
> From: Mike Frysinger <vapier@gentoo.org>
> 
> Dependencies for the envcrc objects should be generated only in the case
> we are going to build envcrc itself. Otherwise it's a waste of work and
> can lead to the (harmless but annoying) errors during dependency
> generation.
> 
> Signed-off-by: Ilya Yanok <yanok@emcraft.com>
> ---
>  tools/Makefile |   24 ++++++++++++++----------
>  1 files changed, 14 insertions(+), 10 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A failure will not appear until a unit has passed final inspection.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-06-22 18:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-20 22:45 [U-Boot] [PATCH 1/3] config.mk: move LDSCRIPT processing to the top-level Makefile Ilya Yanok
2011-06-20 22:45 ` [U-Boot] [PATCH 2/3] Makefile: move $(VERSION_FILE) rule out of ifeq configured Ilya Yanok
2011-06-21  1:57   ` Mike Frysinger
2011-06-20 22:45 ` [U-Boot] [PATCH 3/3] tools/Makefile: fix errors during deps generation for envcrc Ilya Yanok
2011-06-21  1:58   ` Mike Frysinger
2011-06-22 18:05   ` Wolfgang Denk
2011-06-21  1:57 ` [U-Boot] [PATCH 1/3] config.mk: move LDSCRIPT processing to the top-level Makefile Mike Frysinger
2011-06-22 18:05 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox