2018-05-06 21:58:06 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0+
|
2002-12-17 01:51:00 +00:00
|
|
|
#
|
2006-09-01 17:49:50 +00:00
|
|
|
# (C) Copyright 2002-2006
|
2002-12-17 01:51:00 +00:00
|
|
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
|
2014-02-04 08:24:45 +00: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 08:43:16 +00:00
|
|
|
override HOSTCC = $(CC)
|
2014-02-04 08:24:45 +00:00
|
|
|
|
2010-11-10 13:11:21 +00:00
|
|
|
# Compile for a hosted environment on the target
|
2018-07-27 03:37:53 +00:00
|
|
|
HOST_EXTRACFLAGS = -I$(srctree)/tools \
|
|
|
|
$(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \
|
2014-03-11 02:05:20 +00:00
|
|
|
-idirafter $(srctree)/tools/env \
|
2012-10-03 09:38:46 +00:00
|
|
|
-DUSE_HOSTCC \
|
|
|
|
-DTEXT_BASE=$(TEXT_BASE)
|
2006-09-01 17:49:50 +00:00
|
|
|
|
2007-11-27 09:23:20 +00:00
|
|
|
ifeq ($(MTD_VERSION),old)
|
2014-02-04 08:24:10 +00:00
|
|
|
HOST_EXTRACFLAGS += -DMTD_OLD
|
2007-11-27 09:23:20 +00:00
|
|
|
endif
|
|
|
|
|
2014-02-04 08:24:45 +00:00
|
|
|
always := fw_printenv
|
2014-08-27 12:29:00 +00:00
|
|
|
hostprogs-y := fw_printenv
|
2002-12-17 01:51:00 +00:00
|
|
|
|
2015-10-30 13:57:04 +00:00
|
|
|
lib-y += fw_env.o \
|
2014-02-04 08:24:10 +00:00
|
|
|
crc32.o ctype.o linux_string.o \
|
2017-11-14 13:39:35 +00:00
|
|
|
env_attr.o env_flags.o
|
2014-02-04 08:24:45 +00:00
|
|
|
|
2015-10-30 13:57:04 +00:00
|
|
|
fw_printenv-objs := fw_env_main.o $(lib-y)
|
|
|
|
|
2014-08-27 12:29:00 +00:00
|
|
|
quiet_cmd_crosstools_strip = STRIP $^
|
|
|
|
cmd_crosstools_strip = $(STRIP) $^; touch $@
|
2014-02-04 08:24:45 +00:00
|
|
|
|
2014-08-27 12:29:00 +00:00
|
|
|
$(obj)/.strip: $(obj)/fw_printenv
|
|
|
|
$(call cmd,crosstools_strip)
|
|
|
|
|
|
|
|
always += .strip
|