Makefile 954 B

12345678910111213141516171819202122232425262728293031323334
  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. # fw_printenv is supposed to run on the target system, which means it should be
  8. # built with cross tools. Although it may look weird, we only replace "HOSTCC"
  9. # with "CC" here for the maximum code reuse of scripts/Makefile.host.
  10. HOSTCC = $(CC)
  11. # Compile for a hosted environment on the target
  12. HOST_EXTRACFLAGS = $(patsubst -I%,-idirafter%, $(UBOOTINCLUDE)) \
  13. -idirafter $(srctree)/tools/env \
  14. -DUSE_HOSTCC \
  15. -DTEXT_BASE=$(TEXT_BASE)
  16. ifeq ($(MTD_VERSION),old)
  17. HOST_EXTRACFLAGS += -DMTD_OLD
  18. endif
  19. always := fw_printenv
  20. hostprogs-y := fw_printenv_unstripped
  21. fw_printenv_unstripped-objs := fw_env.o fw_env_main.o \
  22. crc32.o ctype.o linux_string.o \
  23. env_attr.o env_flags.o
  24. quiet_cmd_strip = STRIP $@
  25. cmd_strip = $(STRIP) -o $@ $<
  26. $(obj)/fw_printenv: $(obj)/fw_printenv_unstripped FORCE
  27. $(call if_changed,strip)