2 # (C) Copyright 2002-2006
3 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 # SPDX-License-Identifier: GPL-2.0+
8 include $(TOPDIR
)/config.mk
10 HOSTSRCS
:= $(SRCTREE
)/lib
/crc32.c fw_env.c fw_env_main.c
11 HOSTSRCS
+= $(SRCTREE
)/lib
/ctype.c
$(SRCTREE
)/lib
/linux_string.c
12 HOSTSRCS
+= $(SRCTREE
)/common
/env_attr.c
$(SRCTREE
)/common
/env_flags.c
13 HEADERS
:= fw_env.h
$(OBJTREE
)/include/config.h
15 # Compile for a hosted environment on the target
16 HOSTCPPFLAGS
= -idirafter
$(SRCTREE
)/include \
17 -idirafter
$(OBJTREE
)/include2 \
18 -idirafter
$(OBJTREE
)/include \
19 -idirafter
$(SRCTREE
)/tools
/env \
21 -DTEXT_BASE
=$(TEXT_BASE
)
23 ifeq ($(MTD_VERSION
),old
)
24 HOSTCPPFLAGS
+= -DMTD_OLD
27 all: $(obj
)fw_printenv
29 # Some files complain if compiled with -pedantic, use HOSTCFLAGS_NOPED
30 $(obj
)fw_printenv
: $(HOSTSRCS
) $(HEADERS
)
31 $(HOSTCC
) $(HOSTCFLAGS_NOPED
) $(HOSTLDFLAGS
) -o
$@
$(HOSTSRCS
)
35 rm -f
$(obj
)fw_printenv
37 #########################################################################
39 include $(TOPDIR
)/rules.mk
41 sinclude
$(obj
).depend
43 #########################################################################