config.mk 2.1 KB

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