blob: f5368bc4d0253286ae4ba08f501f50ea5605ceb0 [file] [log] [blame]
wdenk6aff3112002-12-17 01:51:00 +00001#
Marian Balakowiczf9328632006-09-01 19:49:50 +02002# (C) Copyright 2002-2006
wdenk6aff3112002-12-17 01:51:00 +00003# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4#
Wolfgang Denk1a459662013-07-08 09:37:19 +02005# SPDX-License-Identifier: GPL-2.0+
wdenk6aff3112002-12-17 01:51:00 +00006#
7
Masahiro Yamada79fc0c52014-02-04 17:24:45 +09008# fw_printenv is supposed to run on the target system, which means it should be
9# built with cross tools. Although it may look weird, we only replace "HOSTCC"
10# with "CC" here for the maximum code reuse of scripts/Makefile.host.
11HOSTCC = $(CC)
12
Daniel Hobi02bd4752010-11-10 14:11:21 +010013# Compile for a hosted environment on the target
Masahiro Yamadafea1ca82014-02-04 17:24:20 +090014HOST_EXTRACFLAGS = $(patsubst -I%,-idirafter%, $(UBOOTINCLUDE)) \
Masahiro Yamada01286322014-03-11 11:05:20 +090015 -idirafter $(srctree)/tools/env \
Joe Hershberger497f2052012-10-03 09:38:46 +000016 -DUSE_HOSTCC \
17 -DTEXT_BASE=$(TEXT_BASE)
Marian Balakowiczf9328632006-09-01 19:49:50 +020018
Markus Klotzbücher6de66b32007-11-27 10:23:20 +010019ifeq ($(MTD_VERSION),old)
Masahiro Yamada940db162014-02-04 17:24:10 +090020HOST_EXTRACFLAGS += -DMTD_OLD
Markus Klotzbücher6de66b32007-11-27 10:23:20 +010021endif
22
Masahiro Yamada79fc0c52014-02-04 17:24:45 +090023always := fw_printenv
24hostprogs-y := fw_printenv_unstripped
Marian Balakowiczf9328632006-09-01 19:49:50 +020025
Masahiro Yamada79fc0c52014-02-04 17:24:45 +090026fw_printenv_unstripped-objs := fw_env.o fw_env_main.o \
Masahiro Yamada940db162014-02-04 17:24:10 +090027 crc32.o ctype.o linux_string.o \
Marek Vasuta8a752c2014-03-05 19:59:52 +010028 env_attr.o env_flags.o aes.o
Masahiro Yamada79fc0c52014-02-04 17:24:45 +090029
30quiet_cmd_strip = STRIP $@
31 cmd_strip = $(STRIP) -o $@ $<
32
33$(obj)/fw_printenv: $(obj)/fw_printenv_unstripped FORCE
34 $(call if_changed,strip)