config.mk 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. PLATFORM_LDFLAGS :=
  15. LDFLAGS :=
  16. LDFLAGS_FINAL :=
  17. LDFLAGS_STANDALONE :=
  18. OBJCOPYFLAGS :=
  19. # clear VENDOR for tcsh
  20. VENDOR :=
  21. #########################################################################
  22. ARCH := $(CONFIG_SYS_ARCH:"%"=%)
  23. CPU := $(CONFIG_SYS_CPU:"%"=%)
  24. ifdef CONFIG_SPL_BUILD
  25. ifdef CONFIG_TEGRA
  26. CPU := arm720t
  27. endif
  28. endif
  29. BOARD := $(CONFIG_SYS_BOARD:"%"=%)
  30. ifneq ($(CONFIG_SYS_VENDOR),)
  31. VENDOR := $(CONFIG_SYS_VENDOR:"%"=%)
  32. endif
  33. ifneq ($(CONFIG_SYS_SOC),)
  34. SOC := $(CONFIG_SYS_SOC:"%"=%)
  35. endif
  36. # Some architecture config.mk files need to know what CPUDIR is set to,
  37. # so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
  38. # Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains
  39. # CPU-specific code.
  40. CPUDIR=arch/$(ARCH)/cpu$(if $(CPU),/$(CPU),)
  41. sinclude $(srctree)/arch/$(ARCH)/config.mk # include architecture dependend rules
  42. sinclude $(srctree)/$(CPUDIR)/config.mk # include CPU specific rules
  43. ifdef SOC
  44. sinclude $(srctree)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules
  45. endif
  46. ifneq ($(BOARD),)
  47. ifdef VENDOR
  48. BOARDDIR = $(VENDOR)/$(BOARD)
  49. else
  50. BOARDDIR = $(BOARD)
  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 += $(PLATFORM_LDFLAGS)
  64. LDFLAGS_FINAL += -Bstatic
  65. export PLATFORM_CPPFLAGS
  66. export RELFLAGS
  67. export LDFLAGS_FINAL
  68. export LDFLAGS_STANDALONE
  69. export CONFIG_STANDALONE_LOAD_ADDR