xref: /openbmc/u-boot/tools/env/Makefile (revision 2cb11b35e8b2b21a00b5d1c1c76404cb65d1ceb9)
16aff3115Swdenk#
2f9328639SMarian Balakowicz# (C) Copyright 2002-2006
36aff3115Swdenk# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
46aff3115Swdenk#
51a459660SWolfgang Denk# SPDX-License-Identifier:	GPL-2.0+
66aff3115Swdenk#
76aff3115Swdenk
879fc0c5fSMasahiro Yamada# fw_printenv is supposed to run on the target system, which means it should be
979fc0c5fSMasahiro Yamada# built with cross tools. Although it may look weird, we only replace "HOSTCC"
1079fc0c5fSMasahiro Yamada# with "CC" here for the maximum code reuse of scripts/Makefile.host.
1179fc0c5fSMasahiro YamadaHOSTCC = $(CC)
1279fc0c5fSMasahiro Yamada
1302bd475eSDaniel Hobi# Compile for a hosted environment on the target
1451148790SMasahiro YamadaHOST_EXTRACFLAGS  = $(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \
1501286329SMasahiro Yamada		-idirafter $(srctree)/tools/env \
16497f2053SJoe Hershberger		-DUSE_HOSTCC \
17497f2053SJoe Hershberger		-DTEXT_BASE=$(TEXT_BASE)
186aff3115Swdenk
196de66b35SMarkus Klotzbücherifeq ($(MTD_VERSION),old)
20940db16dSMasahiro YamadaHOST_EXTRACFLAGS += -DMTD_OLD
216de66b35SMarkus Klotzbücherendif
226de66b35SMarkus Klotzbücher
2379fc0c5fSMasahiro Yamadaalways := fw_printenv
24bdc7dc45SThomas Petazzonihostprogs-y := fw_printenv
25f9328639SMarian Balakowicz
26*2cb11b35SStefano Babiclib-y += fw_env.o \
27940db16dSMasahiro Yamada	crc32.o ctype.o linux_string.o \
28a8a752c0SMarek Vasut	env_attr.o env_flags.o aes.o
2979fc0c5fSMasahiro Yamada
30*2cb11b35SStefano Babicfw_printenv-objs := fw_env_main.o $(lib-y)
31*2cb11b35SStefano Babic
32bdc7dc45SThomas Petazzoniquiet_cmd_crosstools_strip = STRIP   $^
33bdc7dc45SThomas Petazzoni      cmd_crosstools_strip = $(STRIP) $^; touch $@
3479fc0c5fSMasahiro Yamada
35bdc7dc45SThomas Petazzoni$(obj)/.strip: $(obj)/fw_printenv
36bdc7dc45SThomas Petazzoni	$(call cmd,crosstools_strip)
37bdc7dc45SThomas Petazzoni
38bdc7dc45SThomas Petazzonialways += .strip
39