config.mk 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. #########################################################################
  21. ARCH := $(CONFIG_SYS_ARCH:"%"=%)
  22. CPU := $(CONFIG_SYS_CPU:"%"=%)
  23. BOARD := $(CONFIG_SYS_BOARD:"%"=%)
  24. ifneq ($(CONFIG_SYS_VENDOR),)
  25. VENDOR := $(CONFIG_SYS_VENDOR:"%"=%)
  26. endif
  27. ifneq ($(CONFIG_SYS_SOC),)
  28. SOC := $(CONFIG_SYS_SOC:"%"=%)
  29. endif
  30. # Some architecture config.mk files need to know what CPUDIR is set to,
  31. # so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
  32. # Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains
  33. # CPU-specific code.
  34. CPUDIR=arch/$(ARCH)/cpu$(if $(CPU),/$(CPU),)
  35. sinclude $(srctree)/arch/$(ARCH)/config.mk # include architecture dependend rules
  36. sinclude $(srctree)/$(CPUDIR)/config.mk # include CPU specific rules
  37. ifdef SOC
  38. sinclude $(srctree)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules
  39. endif
  40. ifneq ($(BOARD),)
  41. ifdef VENDOR
  42. BOARDDIR = $(VENDOR)/$(BOARD)
  43. else
  44. BOARDDIR = $(BOARD)
  45. endif
  46. endif
  47. ifdef BOARD
  48. sinclude $(srctree)/board/$(BOARDDIR)/config.mk # include board specific rules
  49. endif
  50. #########################################################################
  51. RELFLAGS := $(PLATFORM_RELFLAGS)
  52. OBJCOPYFLAGS += --gap-fill=0xff
  53. PLATFORM_CPPFLAGS += $(RELFLAGS)
  54. PLATFORM_CPPFLAGS += -pipe
  55. LDFLAGS += $(PLATFORM_LDFLAGS)
  56. LDFLAGS_FINAL += -Bstatic
  57. export PLATFORM_CPPFLAGS
  58. export RELFLAGS
  59. export LDFLAGS_FINAL
  60. export CONFIG_STANDALONE_LOAD_ADDR