xref: /openbmc/u-boot/tools/env/Makefile (revision 3765b3e7)
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
8include $(TOPDIR)/config.mk
9
10HOSTSRCS := $(SRCTREE)/lib/crc32.c  fw_env.c  fw_env_main.c
11HOSTSRCS += $(SRCTREE)/lib/ctype.c $(SRCTREE)/lib/linux_string.c
12HOSTSRCS += $(SRCTREE)/common/env_attr.c $(SRCTREE)/common/env_flags.c
13HEADERS	:= fw_env.h $(OBJTREE)/include/config.h
14
15# Compile for a hosted environment on the target
16HOSTCPPFLAGS  = -idirafter $(SRCTREE)/include \
17		-idirafter $(OBJTREE)/include2 \
18		-idirafter $(OBJTREE)/include \
19		-idirafter $(SRCTREE)/tools/env \
20		-DUSE_HOSTCC \
21		-DTEXT_BASE=$(TEXT_BASE)
22
23ifeq ($(MTD_VERSION),old)
24HOSTCPPFLAGS += -DMTD_OLD
25endif
26
27all:	$(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
34clean:
35	rm -f $(obj)fw_printenv
36
37#########################################################################
38
39include $(TOPDIR)/rules.mk
40
41sinclude $(obj).depend
42
43#########################################################################
44