Makefile.Host 763 B

1234567891011121314151617181920212223242526272829303132
  1. all_hosts = Skeleton Linux Linux-SGX FreeBSD
  2. ifeq ($(PAL_HOST),)
  3. SYS := $(shell gcc -dumpmachine)
  4. ifeq ($(SYS),x86_64-linux-gnu)
  5. PAL_HOST := Linux
  6. else ifeq ($(findstring freebsd,$(SYS)),freebsd)
  7. PAL_HOST := FreeBSD
  8. else
  9. $(error Unsupported platform: $(SYS))
  10. endif
  11. endif
  12. # Set SGX=1 to build Graphene for SGX
  13. ifeq ($(SGX)$(SGX_RUN),11)
  14. $(error "Do not use SGX=1 and SGX_RUN=1 at the same time")
  15. endif
  16. ifeq ($(SGX)$(SGX_RUN),1)
  17. PAL_HOST := $(patsubst %-SGX,%,$(PAL_HOST))-SGX
  18. endif
  19. ifeq ($(findstring $(PAL_HOST),$(all_hosts)),)
  20. $(error Unsupported platform: $(PAL_HOST))
  21. endif
  22. export PAL_HOST
  23. export PAL_HOST_MACRO = $(shell echo $(PAL_HOST) | tr '[:lower:]' '[:upper:]' | tr '-' '_')
  24. .DEFAULT_GOAL := all
  25. .PHONY: print_host
  26. print_host:
  27. @echo $(PAL_HOST)