rules.mk 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. include $(TOPDIR)/prereq.mk
  4. -include $(TOPDIR)/.config
  5. ifeq ($(VERBOSE),1)
  6. START_TRACE:= :
  7. END_TRACE:= :
  8. TRACE:= :
  9. CMD_TRACE:= :
  10. PKG_TRACE:= :
  11. MAKE_TRACE:=
  12. EXTRA_MAKEFLAGS:=
  13. SET_DASHX:= set -x
  14. else
  15. START_TRACE:= echo -n "---> "
  16. END_TRACE:= echo
  17. TRACE:= echo "---> "
  18. CMD_TRACE:= echo -n
  19. PKG_TRACE:= echo "------> "
  20. EXTRA_MAKEFLAGS:= -s
  21. MAKE_TRACE:= >/dev/null 2>&1 || { echo "Build failed. Please re-run make with v to see what's going on"; false; }
  22. SET_DASHX:= :
  23. endif
  24. # Strip off the annoying quoting
  25. ADK_TARGET:= $(strip $(subst ",, $(ADK_TARGET)))
  26. ADK_LIBC:= $(strip $(subst ",, $(ADK_LIBC)))
  27. ADK_HOST:= $(strip $(subst ",, $(ADK_HOST)))
  28. ADK_VENDOR:= $(strip $(subst ",, $(ADK_VENDOR)))
  29. ADK_TARGET_SUFFIX:= $(strip $(subst ",, $(ADK_TARGET_SUFFIX)))
  30. ADK_COMPRESSION_TOOL:= $(strip $(subst ",, $(ADK_COMPRESSION_TOOL)))
  31. ifeq ($(strip ${ADK_HAVE_DOT_CONFIG}),y)
  32. ifneq ($(strip $(wildcard $(TOPDIR)/target/$(ADK_TARGET)/target.mk)),)
  33. include $(TOPDIR)/target/$(ADK_TARGET)/target.mk
  34. endif
  35. endif
  36. include $(TOPDIR)/mk/vars.mk
  37. export BASH HOSTCC HOSTCFLAGS MAKE LANGUAGE LC_ALL OStype PATH
  38. HOSTCPPFLAGS?=
  39. HOSTLDFLAGS?=
  40. TARGET_CFLAGS:= $(strip -fno-ident ${TARGET_CFLAGS})
  41. TARGET_CC:= $(strip ${TARGET_CC})
  42. TARGET_CXX:= $(strip ${TARGET_CXX})
  43. ifneq (${show},)
  44. .DEFAULT_GOAL:= show
  45. show:
  46. @$(info ${${show}})
  47. else ifneq (${dump},)
  48. __shquote= '$(subst ','\'',$(1))'
  49. __dumpvar= echo $(call __shquote,$(1)=$(call __shquote,${$(1)}))
  50. .DEFAULT_GOAL:= show
  51. show:
  52. @$(foreach _s,${dump},$(call __dumpvar,${_s});)
  53. endif