1# 2# (C) Copyright 2002-2006 3# Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4# 5# SPDX-License-Identifier: GPL-2.0+ 6# 7 8# 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. 11override HOSTCC = $(CC) 12 13# Compile for a hosted environment on the target 14HOST_EXTRACFLAGS = $(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \ 15 -idirafter $(srctree)/tools/env \ 16 -DUSE_HOSTCC \ 17 -DTEXT_BASE=$(TEXT_BASE) 18 19HOSTLDFLAGS = -static 20 21ifeq ($(MTD_VERSION),old) 22HOST_EXTRACFLAGS += -DMTD_OLD 23endif 24 25always := fw_printenv 26hostprogs-y := fw_printenv 27 28lib-y += fw_env.o \ 29 crc32.o ctype.o linux_string.o \ 30 env_attr.o env_flags.o aes.o 31 32fw_printenv-objs := fw_env_main.o $(lib-y) 33 34quiet_cmd_crosstools_strip = STRIP $^ 35 cmd_crosstools_strip = $(STRIP) $^; touch $@ 36 37$(obj)/.strip: $(obj)/fw_printenv 38 $(call cmd,crosstools_strip) 39 40always += .strip 41