[U-Boot] [PATCH 17/26 v2] tools/Makefile: Give precedence to U-Boot's include directory

Peter Tyser ptyser at xes-inc.com
Thu Mar 12 20:49:06 CET 2009


Update include search path so that the includes in U-Boot's include/
directory have precedence over system includes.  This allows crc32.c
to use U-Boot's zlib.h header which removes the previously required
symlinked zlib.h.

The 'pedantic' gcc flag was also removed to prevent new warnings of
"long long" variables which occurred as a result of this change.  Strict
ISO C is not required for the tools thus the pedantic flag is not
strictly necessary.

The __32 typedef for WIN32 targets in mkimage.h is also no longer
necessary because U-Boot's asm-xxx/types.h provides it.

Signed-off-by: Peter Tyser <ptyser at xes-inc.com>
---
 Makefile        |    2 +-
 tools/Makefile  |   15 +++++----------
 tools/mkimage.h |    2 --
 3 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/Makefile b/Makefile
index b68de1c..ecb8430 100644
--- a/Makefile
+++ b/Makefile
@@ -3482,7 +3482,7 @@ clobber:	clean
 		$(obj)cscope.* $(obj)*.*~
 	@rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL)
 	@rm -f $(obj)tools/{crc32.c,env_embedded.c,env/crc32.c,md5.c,sha1.c,inca-swap-bytes}
-	@rm -f $(obj)tools/{image.c,fdt.c,fdt_ro.c,fdt_rw.c,fdt_strerror.c,zlib.h}
+	@rm -f $(obj)tools/{image.c,fdt.c,fdt_ro.c,fdt_rw.c,fdt_strerror.c,}
 	@rm -f $(obj)tools/{fdt_wip.c,libfdt_internal.h}
 	@rm -f $(obj)cpu/mpc824x/bedbug_603e.c
 	@rm -f $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
diff --git a/tools/Makefile b/tools/Makefile
index e1f262b..db4ecc8 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -42,7 +42,7 @@ HOST_ENVIRO_CFLAGS =
 
 else
 ifeq ($(HOSTOS)-$(HOSTARCH),netbsd-ppc)
-HOST_CFLAGS = -Wall -pedantic
+HOST_CFLAGS = -Wall
 HOST_LDFLAGS =
 HOST_ENVIRO_CFLAGS =
 
@@ -50,7 +50,7 @@ HOST_ENVIRO_CFLAGS =
 # Everyone else
 #
 else
-HOST_CFLAGS = -Wall -pedantic
+HOST_CFLAGS = -Wall
 HOST_LDFLAGS =
 HOST_ENVIRO_CFLAGS =
 endif
@@ -133,10 +133,9 @@ LIBFDT_OBJS	:= $(addprefix $(obj),$(LIBFDT_OBJ_FILES-y))
 #
 # Use native tools and options
 #
-CPPFLAGS   = -idirafter $(SRCTREE)/include \
-		-idirafter $(OBJTREE)/include2 \
-		-idirafter $(OBJTREE)/include \
+CPPFLAGS   = -I $(SRCTREE)/include \
 		-I $(SRCTREE)/tools \
+		-idirafter $(OBJTREE)/include2 \
 		-DTEXT_BASE=$(TEXT_BASE) -DUSE_HOSTCC
 CFLAGS     = $(HOST_CFLAGS) $(CPPFLAGS) -O
 
@@ -258,11 +257,7 @@ $(obj)env_embedded.c:
 $(obj)env_embedded.o:	$(obj)env_embedded.c
 	$(CC) -g $(HOST_ENVIRO_CFLAGS) $(CPPFLAGS) -c -o $@ $<
 
-$(obj)zlib.h:
-	@rm -f $@
-	ln -s $(src)../include/zlib.h $@
-
-$(obj)crc32.c: $(obj)zlib.h
+$(obj)crc32.c:
 	@rm -f $(obj)crc32.c
 	ln -s $(src)../lib_generic/crc32.c $(obj)crc32.c
 
diff --git a/tools/mkimage.h b/tools/mkimage.h
index a2d5248..9b4c0ce 100644
--- a/tools/mkimage.h
+++ b/tools/mkimage.h
@@ -54,8 +54,6 @@
 #endif
 
 #ifdef __WIN32__
-typedef unsigned int __u32;
-
 #define SWAP_LONG(x) \
 	((__u32)( \
 		(((__u32)(x) & (__u32)0x000000ffUL) << 24) | \
-- 
1.6.0.2.GIT



More information about the U-Boot mailing list