blob: b627796e949ebbd8f6b421cfd949c34d49474292 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001# SPDX-License-Identifier: GPL-2.0+
wdenk6aff3112002-12-17 01:51:00 +00002#
Marian Balakowiczf9328632006-09-01 19:49:50 +02003# (C) Copyright 2002-2006
wdenk6aff3112002-12-17 01:51:00 +00004# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
wdenk6aff3112002-12-17 01:51:00 +00005
Masahiro Yamada79fc0c52014-02-04 17:24:45 +09006# 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.
Masahiro Yamada3b082522017-03-13 17:43:16 +09009override HOSTCC = $(CC)
Masahiro Yamada79fc0c52014-02-04 17:24:45 +090010
Daniel Hobi02bd4752010-11-10 14:11:21 +010011# Compile for a hosted environment on the target
Matt Webere1df3fa2018-07-26 22:37:53 -050012HOST_EXTRACFLAGS = -I$(srctree)/tools \
13 $(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \
Masahiro Yamada01286322014-03-11 11:05:20 +090014 -idirafter $(srctree)/tools/env \
Joe Hershberger497f2052012-10-03 09:38:46 +000015 -DUSE_HOSTCC \
16 -DTEXT_BASE=$(TEXT_BASE)
Marian Balakowiczf9328632006-09-01 19:49:50 +020017
Markus Klotzbücher6de66b32007-11-27 10:23:20 +010018ifeq ($(MTD_VERSION),old)
Masahiro Yamada940db162014-02-04 17:24:10 +090019HOST_EXTRACFLAGS += -DMTD_OLD
Markus Klotzbücher6de66b32007-11-27 10:23:20 +010020endif
21
Masahiro Yamada79fc0c52014-02-04 17:24:45 +090022always := fw_printenv
Thomas Petazzonibdc7dc42014-08-27 14:29:00 +020023hostprogs-y := fw_printenv
Marian Balakowiczf9328632006-09-01 19:49:50 +020024
Stefano Babic2cb11b32015-10-30 14:57:04 +010025lib-y += fw_env.o \
Masahiro Yamada940db162014-02-04 17:24:10 +090026 crc32.o ctype.o linux_string.o \
Tom Rinic6831c72017-11-14 08:39:35 -050027 env_attr.o env_flags.o
Masahiro Yamada79fc0c52014-02-04 17:24:45 +090028
Stefano Babic2cb11b32015-10-30 14:57:04 +010029fw_printenv-objs := fw_env_main.o $(lib-y)
30
Thomas Petazzonibdc7dc42014-08-27 14:29:00 +020031quiet_cmd_crosstools_strip = STRIP $^
32 cmd_crosstools_strip = $(STRIP) $^; touch $@
Masahiro Yamada79fc0c52014-02-04 17:24:45 +090033
Thomas Petazzonibdc7dc42014-08-27 14:29:00 +020034$(obj)/.strip: $(obj)/fw_printenv
35 $(call cmd,crosstools_strip)
36
37always += .strip