2018-05-07 05:58:06 +08:00
|
|
|
# SPDX-License-Identifier: GPL-2.0+
|
2002-12-17 09:51:00 +08:00
|
|
|
#
|
2006-09-02 01:49:50 +08:00
|
|
|
# (C) Copyright 2002-2006
|
2002-12-17 09:51:00 +08:00
|
|
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
|
2014-02-04 16:24:45 +08:00
|
|
|
# fw_printenv is supposed to run on the target system, which means it should be
|
|
|
|
# built with cross tools. Although it may look weird, we only replace "HOSTCC"
|
|
|
|
# with "CC" here for the maximum code reuse of scripts/Makefile.host.
|
2017-03-13 16:43:16 +08:00
|
|
|
override HOSTCC = $(CC)
|
2014-02-04 16:24:45 +08:00
|
|
|
|
2010-11-10 21:11:21 +08:00
|
|
|
# Compile for a hosted environment on the target
|
2018-07-27 11:37:53 +08:00
|
|
|
HOST_EXTRACFLAGS = -I$(srctree)/tools \
|
|
|
|
$(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \
|
2014-03-11 10:05:20 +08:00
|
|
|
-idirafter $(srctree)/tools/env \
|
2012-10-03 17:38:46 +08:00
|
|
|
-DUSE_HOSTCC \
|
|
|
|
-DTEXT_BASE=$(TEXT_BASE)
|
2006-09-02 01:49:50 +08:00
|
|
|
|
2007-11-27 17:23:20 +08:00
|
|
|
ifeq ($(MTD_VERSION),old)
|
2014-02-04 16:24:10 +08:00
|
|
|
HOST_EXTRACFLAGS += -DMTD_OLD
|
2007-11-27 17:23:20 +08:00
|
|
|
endif
|
|
|
|
|
2014-02-04 16:24:45 +08:00
|
|
|
always := fw_printenv
|
2014-08-27 20:29:00 +08:00
|
|
|
hostprogs-y := fw_printenv
|
2002-12-17 09:51:00 +08:00
|
|
|
|
2015-10-30 21:57:04 +08:00
|
|
|
lib-y += fw_env.o \
|
2014-02-04 16:24:10 +08:00
|
|
|
crc32.o ctype.o linux_string.o \
|
2017-11-14 21:39:35 +08:00
|
|
|
env_attr.o env_flags.o
|
2014-02-04 16:24:45 +08:00
|
|
|
|
2015-10-30 21:57:04 +08:00
|
|
|
fw_printenv-objs := fw_env_main.o $(lib-y)
|
|
|
|
|
2014-08-27 20:29:00 +08:00
|
|
|
quiet_cmd_crosstools_strip = STRIP $^
|
|
|
|
cmd_crosstools_strip = $(STRIP) $^; touch $@
|
2014-02-04 16:24:45 +08:00
|
|
|
|
2014-08-27 20:29:00 +08:00
|
|
|
$(obj)/.strip: $(obj)/fw_printenv
|
|
|
|
$(call cmd,crosstools_strip)
|
|
|
|
|
|
|
|
always += .strip
|