wdenk | 34b613e | 2002-12-17 01:51:00 +0000 | [diff] [blame] | 1 | # |
Marian Balakowicz | d62379d | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 2 | # (C) Copyright 2002-2006 |
wdenk | 34b613e | 2002-12-17 01:51:00 +0000 | [diff] [blame] | 3 | # Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 4 | # |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | # SPDX-License-Identifier: GPL-2.0+ |
wdenk | 34b613e | 2002-12-17 01:51:00 +0000 | [diff] [blame] | 6 | # |
| 7 | |
Masahiro Yamada | 9563d57 | 2014-02-04 17:24:45 +0900 | [diff] [blame] | 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. |
| 11 | HOSTCC = $(CC) |
| 12 | |
Daniel Hobi | 4683c4b | 2010-11-10 14:11:21 +0100 | [diff] [blame] | 13 | # Compile for a hosted environment on the target |
Masahiro Yamada | 0302445 | 2014-02-04 17:24:20 +0900 | [diff] [blame] | 14 | HOST_EXTRACFLAGS = $(patsubst -I%,-idirafter%, $(UBOOTINCLUDE)) \ |
Masahiro Yamada | ff51704 | 2014-03-11 11:05:20 +0900 | [diff] [blame] | 15 | -idirafter $(srctree)/tools/env \ |
Joe Hershberger | 671adc4 | 2012-10-03 09:38:46 +0000 | [diff] [blame] | 16 | -DUSE_HOSTCC \ |
| 17 | -DTEXT_BASE=$(TEXT_BASE) |
Marian Balakowicz | d62379d | 2006-09-01 19:49:50 +0200 | [diff] [blame] | 18 | |
Markus Klotzbücher | 94db557 | 2007-11-27 10:23:20 +0100 | [diff] [blame] | 19 | ifeq ($(MTD_VERSION),old) |
Masahiro Yamada | f243180 | 2014-02-04 17:24:10 +0900 | [diff] [blame] | 20 | HOST_EXTRACFLAGS += -DMTD_OLD |
Markus Klotzbücher | 94db557 | 2007-11-27 10:23:20 +0100 | [diff] [blame] | 21 | endif |
| 22 | |
Masahiro Yamada | 9563d57 | 2014-02-04 17:24:45 +0900 | [diff] [blame] | 23 | always := fw_printenv |
| 24 | hostprogs-y := fw_printenv_unstripped |
wdenk | 34b613e | 2002-12-17 01:51:00 +0000 | [diff] [blame] | 25 | |
Masahiro Yamada | 9563d57 | 2014-02-04 17:24:45 +0900 | [diff] [blame] | 26 | fw_printenv_unstripped-objs := fw_env.o fw_env_main.o \ |
Masahiro Yamada | f243180 | 2014-02-04 17:24:10 +0900 | [diff] [blame] | 27 | crc32.o ctype.o linux_string.o \ |
Marek Vasut | 05ed2a5 | 2014-03-05 19:59:52 +0100 | [diff] [blame] | 28 | env_attr.o env_flags.o aes.o |
Masahiro Yamada | 9563d57 | 2014-02-04 17:24:45 +0900 | [diff] [blame] | 29 | |
| 30 | quiet_cmd_strip = STRIP $@ |
| 31 | cmd_strip = $(STRIP) -o $@ $< |
| 32 | |
| 33 | $(obj)/fw_printenv: $(obj)/fw_printenv_unstripped FORCE |
| 34 | $(call if_changed,strip) |