rules.mk 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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_ARCH:= $(strip $(subst ",, $(ADK_TARGET_ARCH)))
  26. ADK_TARGET_SYSTEM:= $(strip $(subst ",, $(ADK_TARGET_SYSTEM)))
  27. ADK_TARGET_LIBC:= $(strip $(subst ",, $(ADK_TARGET_LIBC)))
  28. ADK_TARGET_CFLAGS:= $(strip $(subst ",, $(ADK_TARGET_CFLAGS)))
  29. ADK_TARGET_IP:= $(strip $(subst ",, $(ADK_TARGET_IP)))
  30. ADK_TARGET_SUFFIX:= $(strip $(subst ",, $(ADK_TARGET_SUFFIX)))
  31. ADK_TARGET_CMDLINE:= $(strip $(subst ",, $(ADK_TARGET_CMDLINE)))
  32. ADK_RUNTIME_TMPFS_SIZE:= $(strip $(subst ",, $(ADK_RUNTIME_TMPFS_SIZE)))
  33. ADK_RUNTIME_CONSOLE_SERIAL_SPEED:= $(strip $(subst ",, $(ADK_RUNTIME_CONSOLE_SERIAL_SPEED)))
  34. ADK_HOST:= $(strip $(subst ",, $(ADK_HOST)))
  35. ADK_VENDOR:= $(strip $(subst ",, $(ADK_VENDOR)))
  36. ifeq ($(strip ${ADK_HAVE_DOT_CONFIG}),y)
  37. ifneq ($(strip $(wildcard $(TOPDIR)/target/$(ADK_TARGET_ARCH)/target.mk)),)
  38. include $(TOPDIR)/target/$(ADK_TARGET_ARCH)/target.mk
  39. endif
  40. endif
  41. include $(TOPDIR)/mk/vars.mk
  42. export BASH HOSTCC HOSTCXX MAKE LANGUAGE LC_ALL OStype PATH
  43. HOSTCFLAGS?= -O2
  44. HOSTCXXFLAGS?= -O2
  45. HOSTCPPFLAGS?=
  46. HOSTLDFLAGS?=
  47. TARGET_CFLAGS:= $(strip ${TARGET_CFLAGS} -fno-ident -fhonour-copts)
  48. TARGET_CC:= $(strip ${TARGET_CC})
  49. TARGET_CXX:= $(strip ${TARGET_CXX})
  50. ifneq (${show},)
  51. .DEFAULT_GOAL:= show
  52. show:
  53. @$(info ${${show}})
  54. else ifneq (${dump},)
  55. __shquote= '$(subst ','\'',$(1))'
  56. __dumpvar= echo $(call __shquote,$(1)=$(call __shquote,${$(1)}))
  57. .DEFAULT_GOAL:= show
  58. show:
  59. @$(foreach _s,${dump},$(call __dumpvar,${_s});)
  60. endif