rules.mk 3.7 KB

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