config.mk 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. ifdef CONFIG_SPL_BUILD
  26. ifdef CONFIG_TEGRA
  27. CPU := arm720t
  28. endif
  29. endif
  30. BOARD := $(CONFIG_SYS_BOARD:"%"=%)
  31. ifneq ($(CONFIG_SYS_VENDOR),)
  32. VENDOR := $(CONFIG_SYS_VENDOR:"%"=%)
  33. endif
  34. ifneq ($(CONFIG_SYS_SOC),)
  35. SOC := $(CONFIG_SYS_SOC:"%"=%)
  36. endif
  37. # Some architecture config.mk files need to know what CPUDIR is set to,
  38. # so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
  39. # Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains
  40. # CPU-specific code.
  41. CPUDIR=arch/$(ARCH)/cpu$(if $(CPU),/$(CPU),)
  42. sinclude $(srctree)/arch/$(ARCH)/config.mk # include architecture dependend rules
  43. sinclude $(srctree)/$(CPUDIR)/config.mk # include CPU specific rules
  44. ifdef SOC
  45. sinclude $(srctree)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules
  46. endif
  47. ifneq ($(BOARD),)
  48. ifdef VENDOR
  49. BOARDDIR = $(VENDOR)/$(BOARD)
  50. else
  51. BOARDDIR = $(BOARD)
  52. endif
  53. endif
  54. ifdef BOARD
  55. sinclude $(srctree)/board/$(BOARDDIR)/config.mk # include board specific rules
  56. endif
  57. ifdef FTRACE
  58. PLATFORM_CPPFLAGS += -finstrument-functions -DFTRACE
  59. endif
  60. # Allow use of stdint.h if available
  61. ifneq ($(USE_STDINT),)
  62. PLATFORM_CPPFLAGS += -DCONFIG_USE_STDINT
  63. endif
  64. #########################################################################
  65. RELFLAGS := $(PLATFORM_RELFLAGS)
  66. OBJCOPYFLAGS += --gap-fill=0xff
  67. PLATFORM_CPPFLAGS += $(RELFLAGS)
  68. PLATFORM_CPPFLAGS += -pipe
  69. LDFLAGS += $(PLATFORM_LDFLAGS)
  70. LDFLAGS_FINAL += -Bstatic
  71. export PLATFORM_CPPFLAGS
  72. export RELFLAGS
  73. export LDFLAGS_FINAL
  74. export CONFIG_STANDALONE_LOAD_ADDR