config.mk 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #
  2. # (C) Copyright 2000-2013
  3. # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. #
  5. # SPDX-License-Identifier: GPL-2.0+
  6. #
  7. #########################################################################
  8. # This file is included from ./Makefile and spl/Makefile.
  9. # Clean the state to avoid the same flags added twice.
  10. #
  11. # (Tegra needs different flags for SPL.
  12. # That's the reason why this file must be included from spl/Makefile too.
  13. # If we did not have Tegra SoCs, build system would be much simpler...)
  14. PLATFORM_RELFLAGS :=
  15. PLATFORM_CPPFLAGS :=
  16. PLATFORM_LDFLAGS :=
  17. LDFLAGS :=
  18. LDFLAGS_FINAL :=
  19. OBJCOPYFLAGS :=
  20. # clear VENDOR for tcsh
  21. VENDOR :=
  22. #########################################################################
  23. ARCH := $(CONFIG_SYS_ARCH:"%"=%)
  24. CPU := $(CONFIG_SYS_CPU:"%"=%)
  25. BOARD := $(CONFIG_SYS_BOARD:"%"=%)
  26. ifneq ($(CONFIG_SYS_VENDOR),)
  27. VENDOR := $(CONFIG_SYS_VENDOR:"%"=%)
  28. endif
  29. ifneq ($(CONFIG_SYS_SOC),)
  30. SOC := $(CONFIG_SYS_SOC:"%"=%)
  31. endif
  32. # Some architecture config.mk files need to know what CPUDIR is set to,
  33. # so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
  34. # Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains
  35. # CPU-specific code.
  36. CPUDIR=arch/$(ARCH)/cpu$(if $(CPU),/$(CPU),)
  37. sinclude $(srctree)/arch/$(ARCH)/config.mk # include architecture dependend rules
  38. sinclude $(srctree)/$(CPUDIR)/config.mk # include CPU specific rules
  39. ifdef SOC
  40. sinclude $(srctree)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules
  41. endif
  42. ifneq ($(BOARD),)
  43. ifdef VENDOR
  44. BOARDDIR = $(VENDOR)/$(BOARD)
  45. else
  46. BOARDDIR = $(BOARD)
  47. endif
  48. endif
  49. ifdef BOARD
  50. sinclude $(srctree)/board/$(BOARDDIR)/config.mk # include board specific rules
  51. endif
  52. ifdef FTRACE
  53. PLATFORM_CPPFLAGS += -finstrument-functions -DFTRACE
  54. endif
  55. # Allow use of stdint.h if available
  56. ifneq ($(USE_STDINT),)
  57. PLATFORM_CPPFLAGS += -DCONFIG_USE_STDINT
  58. endif
  59. #########################################################################
  60. RELFLAGS := $(PLATFORM_RELFLAGS)
  61. OBJCOPYFLAGS += --gap-fill=0xff
  62. PLATFORM_CPPFLAGS += $(RELFLAGS)
  63. PLATFORM_CPPFLAGS += -pipe
  64. LDFLAGS += $(PLATFORM_LDFLAGS)
  65. LDFLAGS_FINAL += -Bstatic
  66. export PLATFORM_CPPFLAGS
  67. export RELFLAGS
  68. export LDFLAGS_FINAL
  69. export CONFIG_STANDALONE_LOAD_ADDR