X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=tools%2Fenv%2FMakefile;h=2f7a59c00b959a04a8f28d64b1d5b662b26dd849;hb=52eb2c79110151b9017a0829c4d44ee7b8e2ca04;hp=7da1d2b7b0f46d4a6adbf258decc3c921a2d475f;hpb=6aff3115b90780933d390d2b471479179927468d;p=karo-tx-uboot.git diff --git a/tools/env/Makefile b/tools/env/Makefile index 7da1d2b7b0..2f7a59c00b 100644 --- a/tools/env/Makefile +++ b/tools/env/Makefile @@ -1,5 +1,5 @@ # -# (C) Copyright 2002 +# (C) Copyright 2002-2006 # Wolfgang Denk, DENX Software Engineering, wd@denx.de. # # See file CREDITS for list of people who contributed to this @@ -12,7 +12,7 @@ # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License @@ -21,26 +21,37 @@ # MA 02111-1307 USA # -SOURCES := crc32.c fw_env.c fw_env_main.c -HEADERS := fw_env.h +include $(TOPDIR)/config.mk -all: fw_printenv +HOSTSRCS := $(obj)crc32.c fw_env.c fw_env_main.c +HEADERS := fw_env.h -fw_printenv: $(SOURCES) $(HEADERS) - $(CROSS_COMPILE)gcc -Wall -DUSE_HOSTCC $(SOURCES) -o fw_printenv +# Compile for a hosted environment on the target +HOSTCPPFLAGS = -idirafter $(SRCTREE)/include \ + -idirafter $(OBJTREE)/include2 \ + -idirafter $(OBJTREE)/include \ + -DUSE_HOSTCC + +ifeq ($(MTD_VERSION),old) +HOSTCPPFLAGS += -DMTD_OLD +endif + +all: $(obj)fw_printenv + +# Some files complain if compiled with -pedantic, use HOSTCFLAGS_NOPED +$(obj)fw_printenv: $(HOSTSRCS) $(HEADERS) + $(HOSTCC) $(HOSTCFLAGS_NOPED) $(HOSTLDFLAGS) -o $@ $(HOSTSRCS) clean: - rm -f fw_printenv crc32.c + rm -f $(obj)fw_printenv $(obj)crc32.c -crc32.c: - ln -s ../../lib_generic/crc32.c crc32.c +$(obj)crc32.c: + ln -s $(src)../../lib/crc32.c $(obj)crc32.c ######################################################################### -.depend: Makefile $(SOURCES) - $(CC) -M $(HOST_CFLAGS) $(CPPFLAGS) -DUSE_HOSTCC $(SOURCES) > $@ +include $(TOPDIR)/rules.mk -sinclude .depend +sinclude $(obj).depend ######################################################################### -