Commit 02bd475e authored by Daniel Hobi's avatar Daniel Hobi Committed by Wolfgang Denk

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
- 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: default avatarDaniel Hobi <>
Tested-by: default avatarDetlev Zundel <>
Tested-by: default avatarSteve Sakoman <>
parent 34bbf618
......@@ -23,19 +23,24 @@
include $(TOPDIR)/
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
# Compile for a hosted environment on the target
HOSTCPPFLAGS = -idirafter $(SRCTREE)/include \
-idirafter $(OBJTREE)/include2 \
-idirafter $(OBJTREE)/include \
ifeq ($(MTD_VERSION),old)
all: $(obj)fw_printenv
$(obj)fw_printenv: $(SRCS) $(HEADERS)
# Some files complain if compiled with -pedantic, use HOSTCFLAGS_NOPED
$(obj)fw_printenv: $(HOSTSRCS) $(HEADERS)
rm -f $(obj)fw_printenv $(obj)crc32.c
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment