config.mk 2.1 KB

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