2002-12-17 01:51:00 +00:00
|
|
|
#
|
2006-09-01 17:49:50 +00:00
|
|
|
# (C) Copyright 2002-2006
|
2002-12-17 01:51:00 +00:00
|
|
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
#
|
2013-07-08 07:37:19 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0+
|
2002-12-17 01:51:00 +00:00
|
|
|
#
|
|
|
|
|
2006-09-01 17:49:50 +00:00
|
|
|
include $(TOPDIR)/config.mk
|
2002-12-17 01:51:00 +00:00
|
|
|
|
2011-10-17 22:11:12 +00:00
|
|
|
HOSTSRCS := $(SRCTREE)/lib/crc32.c fw_env.c fw_env_main.c
|
2012-12-12 04:16:32 +00:00
|
|
|
HOSTSRCS += $(SRCTREE)/lib/ctype.c $(SRCTREE)/lib/linux_string.c
|
|
|
|
HOSTSRCS += $(SRCTREE)/common/env_attr.c $(SRCTREE)/common/env_flags.c
|
2012-12-20 14:30:27 +00:00
|
|
|
HEADERS := fw_env.h $(OBJTREE)/include/config.h
|
2002-12-17 01:51:00 +00:00
|
|
|
|
2010-11-10 13:11:21 +00:00
|
|
|
# Compile for a hosted environment on the target
|
|
|
|
HOSTCPPFLAGS = -idirafter $(SRCTREE)/include \
|
2013-11-01 01:28:45 +00:00
|
|
|
-idirafter $(SRCTREE)/arch/$(ARCH)/include \
|
2010-11-27 22:30:56 +00:00
|
|
|
-idirafter $(OBJTREE)/include \
|
2012-12-12 04:16:32 +00:00
|
|
|
-idirafter $(SRCTREE)/tools/env \
|
2012-10-03 09:38:46 +00:00
|
|
|
-DUSE_HOSTCC \
|
|
|
|
-DTEXT_BASE=$(TEXT_BASE)
|
2006-09-01 17:49:50 +00:00
|
|
|
|
2007-11-27 09:23:20 +00:00
|
|
|
ifeq ($(MTD_VERSION),old)
|
2010-11-10 13:11:21 +00:00
|
|
|
HOSTCPPFLAGS += -DMTD_OLD
|
2007-11-27 09:23:20 +00:00
|
|
|
endif
|
|
|
|
|
2006-09-01 17:49:50 +00:00
|
|
|
all: $(obj)fw_printenv
|
|
|
|
|
2010-11-10 13:11:21 +00:00
|
|
|
# Some files complain if compiled with -pedantic, use HOSTCFLAGS_NOPED
|
|
|
|
$(obj)fw_printenv: $(HOSTSRCS) $(HEADERS)
|
|
|
|
$(HOSTCC) $(HOSTCFLAGS_NOPED) $(HOSTLDFLAGS) -o $@ $(HOSTSRCS)
|
2012-03-11 15:43:02 +00:00
|
|
|
$(HOSTSTRIP) $@
|
2002-12-17 01:51:00 +00:00
|
|
|
|
|
|
|
clean:
|
2011-10-17 22:11:12 +00:00
|
|
|
rm -f $(obj)fw_printenv
|
2002-12-17 01:51:00 +00:00
|
|
|
|
|
|
|
#########################################################################
|
|
|
|
|
2006-09-01 17:49:50 +00:00
|
|
|
include $(TOPDIR)/rules.mk
|
2002-12-17 01:51:00 +00:00
|
|
|
|
2006-09-01 17:49:50 +00:00
|
|
|
sinclude $(obj).depend
|
2002-12-17 01:51:00 +00:00
|
|
|
|
|
|
|
#########################################################################
|