Makefile 1020 B

12345678910111213141516171819202122232425262728293031323334353637
  1. # SPDX-License-Identifier: GPL-2.0+
  2. #
  3. # (C) Copyright 2002-2006
  4. # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  5. # fw_printenv is supposed to run on the target system, which means it should be
  6. # built with cross tools. Although it may look weird, we only replace "HOSTCC"
  7. # with "CC" here for the maximum code reuse of scripts/Makefile.host.
  8. override HOSTCC = $(CC)
  9. # Compile for a hosted environment on the target
  10. HOST_EXTRACFLAGS = -I$(srctree)/tools \
  11. $(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \
  12. -idirafter $(srctree)/tools/env \
  13. -DUSE_HOSTCC \
  14. -DTEXT_BASE=$(TEXT_BASE)
  15. ifeq ($(MTD_VERSION),old)
  16. HOST_EXTRACFLAGS += -DMTD_OLD
  17. endif
  18. always := fw_printenv
  19. hostprogs-y := fw_printenv
  20. lib-y += fw_env.o \
  21. crc32.o ctype.o linux_string.o \
  22. env_attr.o env_flags.o
  23. fw_printenv-objs := fw_env_main.o $(lib-y)
  24. quiet_cmd_crosstools_strip = STRIP $^
  25. cmd_crosstools_strip = $(STRIP) $^; touch $@
  26. $(obj)/.strip: $(obj)/fw_printenv
  27. $(call cmd,crosstools_strip)
  28. always += .strip