summaryrefslogtreecommitdiff
path: root/tools/env/Makefile
diff options
context:
space:
mode:
authorDaniel Hobi <daniel.hobi@schmid-telecom.ch>2010-11-10 14:11:21 +0100
committerWolfgang Denk <wd@denx.de>2010-11-14 23:26:29 +0100
commit02bd475e343582b3c915b94ef4016d5876d4a4f1 (patch)
treee0530e3952b87d1081f1ccce4be1cb17218201c1 /tools/env/Makefile
parent34bbf618600fb6961d8359e42fb87e59fbd788d9 (diff)
downloadu-boot-imx-02bd475e343582b3c915b94ef4016d5876d4a4f1.zip
u-boot-imx-02bd475e343582b3c915b94ef4016d5876d4a4f1.tar.gz
u-boot-imx-02bd475e343582b3c915b94ef4016d5876d4a4f1.tar.bz2
tools/env: cleanup host build flags
This patch makes tools/env/Makefile more similar to tools/imls: - define HOSTSRCS and HOSTCPPFLAGS, so that .depend generation works. - include U-Boot headers using -idirafter to prevent picking up u-boot/include/errno.h. - use HOSTCFLAGS_NOPED (fw_env.c does not conform to -pedantic). In order to cross-compile tools/env, override the HOSTCC variable as in this example: make tools env HOSTCC=bfin-uclinux-gcc Signed-off-by: Daniel Hobi <daniel.hobi@schmid-telecom.ch> Tested-by: Detlev Zundel <dzu@denx.de> Tested-by: Steve Sakoman <steve.sakoman@linaro.org>
Diffstat (limited to 'tools/env/Makefile')
-rw-r--r--tools/env/Makefile15
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/env/Makefile b/tools/env/Makefile
index f893040..04dfe9c 100644
--- a/tools/env/Makefile
+++ b/tools/env/Makefile
@@ -23,19 +23,24 @@
include $(TOPDIR)/config.mk
-SRCS := $(obj)crc32.c fw_env.c fw_env_main.c
+HOSTSRCS := $(obj)crc32.c fw_env.c fw_env_main.c
HEADERS := fw_env.h
-HOSTCFLAGS += -Wall -DUSE_HOSTCC -I$(SRCTREE)/include
+# Compile for a hosted environment on the target
+HOSTCPPFLAGS = -idirafter $(SRCTREE)/include \
+ -idirafter $(OBJTREE)/include2 \
+ -idirafter $(OBJTREE)/include \
+ -DUSE_HOSTCC
ifeq ($(MTD_VERSION),old)
-HOSTCFLAGS += -DMTD_OLD
+HOSTCPPFLAGS += -DMTD_OLD
endif
all: $(obj)fw_printenv
-$(obj)fw_printenv: $(SRCS) $(HEADERS)
- $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $(SRCS)
+# Some files complain if compiled with -pedantic, use HOSTCFLAGS_NOPED
+$(obj)fw_printenv: $(HOSTSRCS) $(HEADERS)
+ $(HOSTCC) $(HOSTCFLAGS_NOPED) $(HOSTLDFLAGS) -o $@ $(HOSTSRCS)
clean:
rm -f $(obj)fw_printenv $(obj)crc32.c