Skip to contentSkip to conversation

Fix "make tools" without a config

U-Boot New Loïc Minier 4 participants 10 messages Oct 3, 2011 – Oct 6, 2011 Kbuild

lore
Share & tools
lore
#0 lore raw

Hi

This series fixes "make tools" when u-boot isn't configured which regressed recently (with timestamp_generated.h and ublimage support). This is used in e.g. Debian/Ubuntu to provide a board-independent mkimage.

Cheers,

Signature · 1 line
Lo?c Minier
#1 lore raw

PATCH 1/3 Build timestamp_autogenerated.h without config

Tools such as mkimage include version information but are config-agnostic; build timestamp_autogenerated.h even when config.mk isn't generated to fix "make tools" build failure:
gcc [...] -o mkimage.o mkimage.c -c
In file included from include/version.h:27:0, from mkimage.c:26:
include/timestamp.h:27:37: fatal error: timestamp_autogenerated.h: No such file or directory

Cc patches at linaro.org
---
 Makefile |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)
Makefile +10 -9
index 77140eb..0892908 100644
@@ -141,7 +141,7 @@ SUBDIRS	= tools \
 	  examples/standalone \
 	  examples/api
 
-.PHONY : $(SUBDIRS) $(VERSION_FILE)
+.PHONY : $(SUBDIRS) $(VERSION_FILE) $(TIMESTAMP_FILE)
 
 ifeq ($(obj)include/config.mk,$(wildcard $(obj)include/config.mk))
 
@@ -294,7 +294,7 @@ LIBS += $(CPUDIR)/s5p-common/libs5p-common.o
 endif
 
 LIBS := $(addprefix $(obj),$(sort $(LIBS)))
-.PHONY : $(LIBS) $(TIMESTAMP_FILE)
+.PHONY : $(LIBS)
 
 LIBBOARD = board/$(BOARDDIR)/lib$(BOARD).o
 LIBBOARD := $(addprefix $(obj),$(LIBBOARD))
@@ -453,10 +453,6 @@ $(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"' >> $@
-
 updater:
 		$(MAKE) -C tools/updater all
 
@@ -547,12 +543,12 @@ $(obj)$(CPUDIR)/$(SOC)/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) \
+$(filter-out tools,$(SUBDIRS)) \
 updater depend dep tags ctags etags cscope $(obj)System.map:
 	@echo "System not configured - see README" >&2
 	@ exit 1
 
-tools: $(VERSION_FILE)
+tools: $(VERSION_FILE) $(TIMESTAMP_FILE)
 	$(MAKE) -C $@ all
 endif	# config.mk
 
@@ -570,11 +566,16 @@ $(VERSION_FILE):
 		 '$(shell $(LD) -v | head -n 1)' )>>  [email protected]
 		@cmp -s $@ [email protected] && rm -f [email protected] || mv -f [email protected] $@
 
+$(TIMESTAMP_FILE):
+		@mkdir -p $(dir $(TIMESTAMP_FILE))
+		@LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > $@
+		@LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> $@
+
 easylogo env gdb:
 	$(MAKE) -C tools/$@ all MTD_VERSION=${MTD_VERSION}
 gdbtools: gdb
 
-tools-all: easylogo env gdb $(VERSION_FILE)
+tools-all: easylogo env gdb $(VERSION_FILE) $(TIMESTAMP_FILE)
 	$(MAKE) -C tools HOST_TOOLS_ALL=y
 
 .PHONY : CHANGELOG
Signature · 1 line
1.7.5.4
#3 lore raw

PATCH 1/3 Build timestamp_autogenerated.h without config

In reply to Loïc Minier

Dear =?UTF-8?q?Lo=C3=AFc=20Minier?=,

Quoted 8 lines · In message <[email protected]> you wrote:

Tools such as mkimage include version information but are config-agnostic; build timestamp_autogenerated.h even when config.mk isn't generated to fix "make tools" build failure:
gcc [...] -o mkimage.o mkimage.c -c
In file included from include/version.h:27:0, from mkimage.c:26:
include/timestamp.h:27:37: fatal error: timestamp_autogenerated.h: No such file or directory

Quoted 5 lines
Cc patches at linaro.org
---
 Makefile |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
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
"Life and death are seldom logical."
"But attaining a desired goal always is."
	-- McCoy and Spock, "The Galileo Seven", stardate 2821.7
#4 lore raw

PATCH 2/3 Safer timestamp_autogenerated.h generation

In reply to Loïc Minier

Generate timestamp_autogenerated.h as safely as version_autogenerated.h.

Cc patches at linaro.org
---
 Makefile |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
Makefile +3 -2
index 0892908..2991357 100644
@@ -568,8 +568,9 @@ $(VERSION_FILE):
 
 $(TIMESTAMP_FILE):
 		@mkdir -p $(dir $(TIMESTAMP_FILE))
-		@LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > $@
-		@LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> $@
+		@LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > [email protected]
+		@LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> [email protected]
+		@cmp -s $@ [email protected] && rm -f [email protected] || mv -f [email protected] $@
 
 easylogo env gdb:
 	$(MAKE) -C tools/$@ all MTD_VERSION=${MTD_VERSION}
Signature · 1 line
1.7.5.4
#6 lore raw

PATCH 2/3 Safer timestamp_autogenerated.h generation

In reply to Loïc Minier

Dear =?UTF-8?q?Lo=C3=AFc=20Minier?=,

Quoted 7 lines · In message <[email protected]> you wrote:

Generate timestamp_autogenerated.h as safely as version_autogenerated.h.

Cc patches at linaro.org
---
 Makefile |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
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
What is mind?  No matter.  What is matter?  Never mind.
                                      -- Thomas Hewitt Key, 1799-1875
#7 lore raw

PATCH 3/3 ublimage: NAND block size isn't set at build-time

In reply to Loïc Minier

mkimage's ublimage support can't depend of build-time board configs; instead, this should be set in ublimage.cfg. Since currently no configs in u-boot override the NAND block size, hardcode it as such in ublimage.h to fix a build failure with "make tools":
gcc [...] -o ublimage.o ublimage.c -c
In file included from ublimage.c:37:0:
ublimage.h:31:20: fatal error: config.h: No such file or directory

Cc Heiko Schocher <[email protected]>
Cc patches at linaro.org
---
 tools/ublimage.h |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)
tools/ublimage.h +4 -7
index c926689..93ec8ee 100644
@@ -28,12 +28,6 @@
 #ifndef _UBLIMAGE_H_
 #define _UBLIMAGE_H_
 
-#include <config.h>
-
-#if !defined(CONFIG_SYS_UBL_BLOCK)
-#define CONFIG_SYS_UBL_BLOCK 512
-#endif
-
 enum ublimage_cmd {
 	CMD_INVALID,
 	CMD_BOOT_MODE,
@@ -71,6 +65,9 @@ enum ublimage_fld_types {
 /* Define max UBL image size */
 #define UBL_IMAGE_SIZE              (0x00003800u)
 
+/* one NAND block */
+#define UBL_BLOCK_SIZE 512
+
 /* from sprufg5a.pdf Table 109 */
 struct ubl_header {
 	uint32_t	magic;	/* Magic Number, see UBL_* defines */
@@ -97,7 +94,7 @@ struct ubl_header {
 				 * Magic Number indicates fast EMIF boot).
 				 */
 	/* to fit in one nand block */
-	unsigned char	res[CONFIG_SYS_UBL_BLOCK - 8 * 4];
+	unsigned char	res[UBL_BLOCK_SIZE - 8 * 4];
 };
 
 #endif /* _UBLIMAGE_H_ */
Signature · 1 line
1.7.5.4
#8 lore raw

PATCH 3/3 ublimage: NAND block size isn't set at build-time

Hello Lo?c,

Quoted 8 lines · Lo?c Minier

mkimage's ublimage support can't depend of build-time board configs; instead, this should be set in ublimage.cfg. Since currently no configs in u-boot override the NAND block size, hardcode it as such in ublimage.h to fix a build failure with "make tools":
gcc [...] -o ublimage.o ublimage.c -c
In file included from ublimage.c:37:0:
ublimage.h:31:20: fatal error: config.h: No such file or directory

Quoted 6 lines
Cc Heiko Schocher <[email protected]>
Cc patches at linaro.org
---
 tools/ublimage.h |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

Thanks!

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#9 lore raw

PATCH 3/3 ublimage: NAND block size isn't set at build-time

In reply to Loïc Minier

Dear =?UTF-8?q?Lo=C3=AFc=20Minier?=,

Quoted 8 lines · In message <[email protected]> you wrote:

mkimage's ublimage support can't depend of build-time board configs; instead, this should be set in ublimage.cfg. Since currently no configs in u-boot override the NAND block size, hardcode it as such in ublimage.h to fix a build failure with "make tools":
gcc [...] -o ublimage.o ublimage.c -c
In file included from ublimage.c:37:0:
ublimage.h:31:20: fatal error: config.h: No such file or directory

Quoted 6 lines
Cc Heiko Schocher <[email protected]>
Cc patches at linaro.org
---
 tools/ublimage.h |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
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
When choosing between two evils, I always like to take the  one  I've
never tried before.                     -- Mae West, "Klondike Annie"