Makefile 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. include $(TOPDIR)/config.mk
  8. HOSTSRCS := $(SRCTREE)/lib/crc32.c fw_env.c fw_env_main.c
  9. HOSTSRCS += $(SRCTREE)/lib/ctype.c $(SRCTREE)/lib/linux_string.c
  10. HOSTSRCS += $(SRCTREE)/common/env_attr.c $(SRCTREE)/common/env_flags.c
  11. HEADERS := fw_env.h $(OBJTREE)/include/config.h
  12. # Compile for a hosted environment on the target
  13. HOSTCPPFLAGS = -idirafter $(SRCTREE)/include \
  14. -idirafter $(SRCTREE)/arch/$(ARCH)/include \
  15. -idirafter $(OBJTREE)/include \
  16. -idirafter $(SRCTREE)/tools/env \
  17. -DUSE_HOSTCC \
  18. -DTEXT_BASE=$(TEXT_BASE)
  19. ifeq ($(MTD_VERSION),old)
  20. HOSTCPPFLAGS += -DMTD_OLD
  21. endif
  22. all: $(obj)fw_printenv
  23. # Some files complain if compiled with -pedantic, use HOSTCFLAGS_NOPED
  24. $(obj)fw_printenv: $(HOSTSRCS) $(HEADERS)
  25. $(HOSTCC) $(HOSTCFLAGS_NOPED) $(HOSTLDFLAGS) -o $@ $(HOSTSRCS)
  26. $(HOSTSTRIP) $@
  27. clean:
  28. rm -f $(obj)fw_printenv
  29. #########################################################################
  30. include $(TOPDIR)/rules.mk
  31. sinclude $(obj).depend
  32. #########################################################################