rules.mk 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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_KERNEL:= $(strip $(subst ",, $(ADK_TARGET_KERNEL)))
  26. ADK_TARGET_ARCH:= $(strip $(subst ",, $(ADK_TARGET_ARCH)))
  27. ADK_TARGET_SYSTEM:= $(strip $(subst ",, $(ADK_TARGET_SYSTEM)))
  28. ADK_TARGET_LIBC:= $(strip $(subst ",, $(ADK_TARGET_LIBC)))
  29. ADK_TARGET_LIBC_PATH:= $(strip $(subst ",, $(ADK_TARGET_LIBC_PATH)))
  30. ADK_TARGET_ENDIAN:= $(strip $(subst ",, $(ADK_TARGET_ENDIAN)))
  31. ADK_TARGET_CPU_ARCH:= $(strip $(subst ",, $(ADK_TARGET_CPU_ARCH)))
  32. ADK_TARGET_CFLAGS:= $(strip $(subst ",, $(ADK_TARGET_CFLAGS)))
  33. ADK_TARGET_ABI_CFLAGS:= $(strip $(subst ",, $(ADK_TARGET_ABI_CFLAGS)))
  34. ADK_TARGET_ABI_LDFLAGS:= $(strip $(subst ",, $(ADK_TARGET_ABI_LDFLAGS)))
  35. ADK_TARGET_KERNEL_LDFLAGS:= $(strip $(subst ",, $(ADK_TARGET_KERNEL_LDFLAGS)))
  36. ADK_TARGET_ABI:= $(strip $(subst ",, $(ADK_TARGET_ABI)))
  37. ADK_TARGET_IP:= $(strip $(subst ",, $(ADK_TARGET_IP)))
  38. ADK_TARGET_SUFFIX:= $(strip $(subst ",, $(ADK_TARGET_SUFFIX)))
  39. ADK_TARGET_CMDLINE:= $(strip $(subst ",, $(ADK_TARGET_CMDLINE)))
  40. ADK_RUNTIME_TMPFS_SIZE:= $(strip $(subst ",, $(ADK_RUNTIME_TMPFS_SIZE)))
  41. ADK_RUNTIME_CONSOLE_SERIAL_SPEED:= $(strip $(subst ",, $(ADK_RUNTIME_CONSOLE_SERIAL_SPEED)))
  42. ADK_HOST:= $(strip $(subst ",, $(ADK_HOST)))
  43. ADK_VENDOR:= $(strip $(subst ",, $(ADK_VENDOR)))
  44. ADK_COMPRESSION_TOOL:= $(strip $(subst ",, $(ADK_COMPRESSION_TOOL)))
  45. ADK_TOOLS_ADDPATTERN_ARGS:= $(strip $(subst ",, $(ADK_TOOLS_ADDPATTERN_ARGS)))
  46. ADK_KERNEL_VERSION:= $(strip $(subst ",, $(ADK_KERNEL_VERSION)))
  47. ADK_PARAMETER_NETCONSOLE_SRC_IP:= $(strip $(subst ",, $(ADK_PARAMETER_NETCONSOLE_SRC_IP)))
  48. ADK_PARAMETER_NETCONSOLE_DST_IP:= $(strip $(subst ",, $(ADK_PARAMETER_NETCONSOLE_DST_IP)))
  49. ifeq ($(strip ${ADK_HAVE_DOT_CONFIG}),y)
  50. ifneq ($(strip $(wildcard $(TOPDIR)/target/$(ADK_TARGET_ARCH)/target.mk)),)
  51. include $(TOPDIR)/target/$(ADK_TARGET_ARCH)/target.mk
  52. endif
  53. endif
  54. ifneq (${DEBUG},)
  55. ADK_DEBUG:=y
  56. endif
  57. ifneq (${STATIC},)
  58. ADK_STATIC:=y
  59. endif
  60. include $(TOPDIR)/mk/vars.mk
  61. ifneq (${show},)
  62. .DEFAULT_GOAL:= show
  63. show:
  64. @$(info ${${show}})
  65. else ifneq (${dump},)
  66. __shquote= '$(subst ','\'',$(1))'
  67. __dumpvar= echo $(call __shquote,$(1)=$(call __shquote,${$(1)}))
  68. .DEFAULT_GOAL:= show
  69. show:
  70. @$(foreach _s,${dump},$(call __dumpvar,${_s});)
  71. endif