config.mk 1.8 KB

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