]> git.ipfire.org Git - people/ms/u-boot.git/blob - tools/env/Makefile
27892f74d096b56c8440c898e0af73e876b8cf4e
[people/ms/u-boot.git] / tools / env / Makefile
1 #
2 # (C) Copyright 2002-2006
3 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 #
5 # SPDX-License-Identifier: GPL-2.0+
6 #
7
8 include $(TOPDIR)/config.mk
9
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
14
15 # Compile for a hosted environment on the target
16 HOSTCPPFLAGS = -idirafter $(SRCTREE)/include \
17 -idirafter $(SRCTREE)/arch/$(ARCH)/include \
18 -idirafter $(OBJTREE)/include \
19 -idirafter $(SRCTREE)/tools/env \
20 -DUSE_HOSTCC \
21 -DTEXT_BASE=$(TEXT_BASE)
22
23 ifeq ($(MTD_VERSION),old)
24 HOSTCPPFLAGS += -DMTD_OLD
25 endif
26
27 all: $(obj)fw_printenv
28
29 # Some files complain if compiled with -pedantic, use HOSTCFLAGS_NOPED
30 $(obj)fw_printenv: $(HOSTSRCS) $(HEADERS)
31 $(HOSTCC) $(HOSTCFLAGS_NOPED) $(HOSTLDFLAGS) -o $@ $(HOSTSRCS)
32 $(HOSTSTRIP) $@
33
34 clean:
35 rm -f $(obj)fw_printenv
36
37 #########################################################################
38
39 include $(TOPDIR)/rules.mk
40
41 sinclude $(obj).depend
42
43 #########################################################################