Makefile.Host 766 B

12345678910111213141516171819202122232425262728293031
  1. all_hosts = Skeleton Linux Linux-SGX
  2. SYS ?= $(shell gcc -dumpmachine)
  3. ifeq ($(PAL_HOST),)
  4. ifeq ($(findstring x86_64,$(SYS))$(findstring linux,$(SYS)),x86_64linux)
  5. PAL_HOST := Linux
  6. else
  7. $(error Unsupported platform: $(SYS))
  8. endif
  9. endif
  10. ifeq ($(SGX_RUN),1)
  11. $(error "SGX_RUN has been removed. Always set SGX=1 if building for SGX and use the 'sgx-tokens' make target to build launch/EINIT tokens")
  12. endif
  13. ifeq ($(SGX),1)
  14. PAL_HOST := $(patsubst %-SGX,%,$(PAL_HOST))-SGX
  15. endif
  16. ifeq ($(findstring $(PAL_HOST),$(all_hosts)),)
  17. $(error Unsupported platform: $(PAL_HOST))
  18. endif
  19. export SYS
  20. export PAL_HOST
  21. export PAL_HOST_MACRO = $(shell echo $(PAL_HOST) | tr '[:lower:]' '[:upper:]' | tr '-' '_')
  22. .DEFAULT_GOAL := all
  23. .PHONY: print_host
  24. print_host:
  25. @echo $(PAL_HOST)