Makefile.soc 1.0 KB

1234567891011121314151617181920212223242526
  1. ifeq ($(SOC),demosoc)
  2. $(warning SOC demosoc is deprecated since Nuclei SDK 0.5.0, please use SOC=evalsoc now)
  3. override SOC := evalsoc
  4. endif
  5. # Check if the SOC is valid, if there is only one SoC in this folder, force it to be the only SoC
  6. ifeq ($(wildcard $(NUCLEI_SDK_SOC)),)
  7. NUCLEI_SOC_VALID_BUILD_MKS := $(wildcard $(NUCLEI_SDK_ROOT)/SoC/*/build.mk)
  8. NUCLEI_SOC_COUNT := $(words $(NUCLEI_SOC_VALID_BUILD_MKS))
  9. NUCLEI_SOC_VALID := $(notdir $(patsubst %/,%,$(dir $(NUCLEI_SOC_VALID_BUILD_MKS))))
  10. ifeq ($(NUCLEI_SOC_COUNT),1)
  11. $(warning No SoC named $(SOC) located $(realpath $(NUCLEI_SDK_ROOT)/SoC), force SOC=$(NUCLEI_SOC_VALID) now)
  12. override SOC := $(NUCLEI_SOC_VALID)
  13. else
  14. $(error There is no SoC named $(SOC) located in $(realpath $(NUCLEI_SDK_ROOT)/SoC), please pass correct SOC variable)
  15. endif
  16. endif
  17. SOC_BUILD_MAKEFILE := $(NUCLEI_SDK_ROOT)/SoC/$(SOC)/build.mk
  18. ifneq ($(wildcard $(SOC_BUILD_MAKEFILE)),)
  19. MAKEFILE_PREREQS += $(SOC_BUILD_MAKEFILE)
  20. include $(SOC_BUILD_MAKEFILE)
  21. else
  22. $(error build.mk might not exist in $(realpath $(NUCLEI_SDK_ROOT)/SoC/$(SOC)))
  23. endif