config.mk 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. #########################################################################
  56. RELFLAGS := $(PLATFORM_RELFLAGS)
  57. OBJCOPYFLAGS += --gap-fill=0xff
  58. PLATFORM_CPPFLAGS += $(RELFLAGS)
  59. PLATFORM_CPPFLAGS += -pipe
  60. LDFLAGS += $(PLATFORM_LDFLAGS)
  61. LDFLAGS_FINAL += -Bstatic
  62. export PLATFORM_CPPFLAGS
  63. export RELFLAGS
  64. export LDFLAGS_FINAL
  65. export CONFIG_STANDALONE_LOAD_ADDR