1 # SPDX-License-Identifier: GPL-2.0+
3 # (C) Copyright 2002-2006
4 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
6 # fw_printenv is supposed to run on the target system, which means it should be
7 # built with cross tools. Although it may look weird, we only replace "HOSTCC"
8 # with "CC" here for the maximum code reuse of scripts/Makefile.host.
9 override HOSTCC = $(CC)
11 # Compile for a hosted environment on the target
12 HOST_EXTRACFLAGS = -I$(srctree)/tools \
13 $(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \
14 -idirafter $(srctree)/tools/env \
16 -DTEXT_BASE=$(TEXT_BASE)
18 ifeq ($(MTD_VERSION),old)
19 HOST_EXTRACFLAGS += -DMTD_OLD
23 hostprogs-y := fw_printenv
26 crc32.o ctype.o linux_string.o \
27 env_attr.o env_flags.o
29 fw_printenv-objs := fw_env_main.o $(lib-y)
31 quiet_cmd_crosstools_strip = STRIP $^
32 cmd_crosstools_strip = $(STRIP) $^; touch $@
34 $(obj)/.strip: $(obj)/fw_printenv
35 $(call cmd,crosstools_strip)