config.mk 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. # clean the slate ...
  9. PLATFORM_RELFLAGS =
  10. PLATFORM_CPPFLAGS =
  11. PLATFORM_LDFLAGS =
  12. #########################################################################
  13. # Some architecture config.mk files need to know what CPUDIR is set to,
  14. # so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
  15. # Check if arch/$ARCH/cpu/$CPU exists, otherwise assume arch/$ARCH/cpu contains
  16. # CPU-specific code.
  17. CPUDIR=arch/$(ARCH)/cpu/$(CPU)
  18. ifneq ($(SRCTREE)/$(CPUDIR),$(wildcard $(SRCTREE)/$(CPUDIR)))
  19. CPUDIR=arch/$(ARCH)/cpu
  20. endif
  21. sinclude $(TOPDIR)/arch/$(ARCH)/config.mk # include architecture dependend rules
  22. sinclude $(TOPDIR)/$(CPUDIR)/config.mk # include CPU specific rules
  23. ifdef SOC
  24. sinclude $(TOPDIR)/$(CPUDIR)/$(SOC)/config.mk # include SoC specific rules
  25. endif
  26. ifneq ($(BOARD),)
  27. ifdef VENDOR
  28. BOARDDIR = $(VENDOR)/$(BOARD)
  29. else
  30. BOARDDIR = $(BOARD)
  31. endif
  32. endif
  33. ifdef BOARD
  34. sinclude $(TOPDIR)/board/$(BOARDDIR)/config.mk # include board specific rules
  35. endif
  36. #########################################################################
  37. RELFLAGS= $(PLATFORM_RELFLAGS)
  38. OBJCOPYFLAGS += --gap-fill=0xff
  39. CPPFLAGS = $(RELFLAGS)
  40. CPPFLAGS += -pipe $(PLATFORM_CPPFLAGS)
  41. LDFLAGS += $(PLATFORM_LDFLAGS)
  42. LDFLAGS_FINAL += -Bstatic