rules.mk 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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 $(ADK_TOPDIR)/prereq.mk
  4. -include $(ADK_TOPDIR)/.config
  5. ifeq ($(ADK_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_ARCH:= $(strip $(subst ",, $(ADK_TARGET_ARCH)))
  26. ADK_TARGET_SYSTEM:= $(strip $(subst ",, $(ADK_TARGET_SYSTEM)))
  27. ADK_TARGET_BOARD:= $(strip $(subst ",, $(ADK_TARGET_BOARD)))
  28. ADK_TARGET_CPU_ARCH:= $(strip $(subst ",, $(ADK_TARGET_CPU_ARCH)))
  29. ADK_TARGET_CPU_TYPE:= $(strip $(subst ",, $(ADK_TARGET_CPU_TYPE)))
  30. ADK_TARGET_KERNEL:= $(strip $(subst ",, $(ADK_TARGET_KERNEL)))
  31. ADK_TARGET_LIBC:= $(strip $(subst ",, $(ADK_TARGET_LIBC)))
  32. ADK_TARGET_LIBC_PATH:= $(strip $(subst ",, $(ADK_TARGET_LIBC_PATH)))
  33. ADK_TARGET_ENDIAN:= $(strip $(subst ",, $(ADK_TARGET_ENDIAN)))
  34. ADK_TARGET_ENDIAN_SUFFIX:= $(strip $(subst ",, $(ADK_TARGET_ENDIAN_SUFFIX)))
  35. ADK_TARGET_GCC_CPU:= $(strip $(subst ",, $(ADK_TARGET_GCC_CPU)))
  36. ADK_TARGET_GCC_ARCH:= $(strip $(subst ",, $(ADK_TARGET_GCC_ARCH)))
  37. ADK_TARGET_FLOAT:= $(strip $(subst ",, $(ADK_TARGET_FLOAT)))
  38. ADK_TARGET_FPU:= $(strip $(subst ",, $(ADK_TARGET_FPU)))
  39. ADK_TARGET_ARM_MODE:= $(strip $(subst ",, $(ADK_TARGET_ARM_MODE)))
  40. ADK_TARGET_CFLAGS:= $(strip $(subst ",, $(ADK_TARGET_CFLAGS)))
  41. ADK_TARGET_CPU_FLAGS:= $(strip $(subst ",, $(ADK_TARGET_CPU_FLAGS)))
  42. ADK_TARGET_CFLAGS_OPT:= $(strip $(subst ",, $(ADK_TARGET_CFLAGS_OPT)))
  43. ADK_TARGET_ABI_CFLAGS:= $(strip $(subst ",, $(ADK_TARGET_ABI_CFLAGS)))
  44. ADK_TARGET_ABI:= $(strip $(subst ",, $(ADK_TARGET_ABI)))
  45. ADK_TARGET_MIPS_ABI:= $(strip $(subst ",, $(ADK_TARGET_MIPS_ABI)))
  46. ADK_TARGET_IP:= $(strip $(subst ",, $(ADK_TARGET_IP)))
  47. ADK_TARGET_SUFFIX:= $(strip $(subst ",, $(ADK_TARGET_SUFFIX)))
  48. ADK_TARGET_CMDLINE:= $(strip $(subst ",, $(ADK_TARGET_CMDLINE)))
  49. ADK_QEMU_ARGS:= $(strip $(subst ",, $(ADK_QEMU_ARGS)))
  50. ADK_RUNTIME_TMPFS_SIZE:= $(strip $(subst ",, $(ADK_RUNTIME_TMPFS_SIZE)))
  51. ADK_RUNTIME_CONSOLE_SERIAL_SPEED:= $(strip $(subst ",, $(ADK_RUNTIME_CONSOLE_SERIAL_SPEED)))
  52. ADK_RUNTIME_CONSOLE_SERIAL_DEVICE:= $(strip $(subst ",, $(ADK_RUNTIME_CONSOLE_SERIAL_DEVICE)))
  53. ADK_RUNTIME_CONSOLE_VGA_DEVICE:= $(strip $(subst ",, $(ADK_RUNTIME_CONSOLE_VGA_DEVICE)))
  54. ADK_HOST:= $(strip $(subst ",, $(ADK_HOST)))
  55. ADK_VENDOR:= $(strip $(subst ",, $(ADK_VENDOR)))
  56. ADK_DL_DIR:= $(strip $(subst ",, $(ADK_DL_DIR)))
  57. ADK_COMPRESSION_TOOL:= $(strip $(subst ",, $(ADK_COMPRESSION_TOOL)))
  58. ADK_TARGET_KERNEL_VERSION:= $(strip $(subst ",, $(ADK_TARGET_KERNEL_VERSION)))
  59. ADK_LIBC_VERSION:= $(strip $(subst ",, $(ADK_LIBC_VERSION)))
  60. ADK_PARAMETER_NETCONSOLE_SRC_IP:= $(strip $(subst ",, $(ADK_PARAMETER_NETCONSOLE_SRC_IP)))
  61. ADK_PARAMETER_NETCONSOLE_DST_IP:= $(strip $(subst ",, $(ADK_PARAMETER_NETCONSOLE_DST_IP)))
  62. ADK_JFFS2_OPTS:= $(strip $(subst ",, $(ADK_JFFS2_OPTS)))
  63. ADK_WGET_TIMEOUT:= $(strip $(subst ",, $(ADK_WGET_TIMEOUT)))
  64. ADK_TARGET_KERNEL_HASH:= $(strip $(subst ",, $(ADK_TARGET_KERNEL_HASH)))
  65. ADK_TARGET_KERNEL_DEFCONFIG:= $(strip $(subst ",, $(ADK_TARGET_KERNEL_DEFCONFIG)))
  66. ADK_TARGET_KARCH:=$(ADK_TARGET_ARCH)
  67. # translate toolchain arch to kernel arch
  68. ifeq ($(ADK_TARGET_ARCH),aarch64)
  69. ADK_TARGET_KARCH:=arm64
  70. endif
  71. ifeq ($(ADK_TARGET_ARCH),bfin)
  72. ADK_TARGET_KARCH:=blackfin
  73. endif
  74. ifeq ($(ADK_TARGET_ARCH),or1k)
  75. ADK_TARGET_KARCH:=openrisc
  76. endif
  77. ifeq ($(ADK_TARGET_ARCH),ppc)
  78. ADK_TARGET_KARCH:=powerpc
  79. endif
  80. ifeq ($(ADK_TARGET_ARCH),ppc64)
  81. ADK_TARGET_KARCH:=powerpc
  82. endif
  83. ifeq ($(ADK_TARGET_ARCH),mips64)
  84. ADK_TARGET_KARCH:=mips
  85. endif
  86. ifeq ($(ADK_TARGET_ARCH),hppa)
  87. ADK_TARGET_KARCH:=parisc
  88. endif
  89. include $(ADK_TOPDIR)/mk/vars.mk
  90. ifneq (${show},)
  91. .DEFAULT_GOAL:= show
  92. show:
  93. @$(info ${${show}})
  94. else ifneq (${dump},)
  95. __shquote= '$(subst ','\'',$(1))'
  96. __dumpvar= echo $(call __shquote,$(1)=$(call __shquote,${$(1)}))
  97. .DEFAULT_GOAL:= show
  98. show:
  99. @$(foreach _s,${dump},$(call __dumpvar,${_s});)
  100. endif