Makefile.Host 631 B

123456789101112131415161718192021222324252627
  1. all_hosts = Skeleton Linux Linux-SGX FreeBSD
  2. ifeq ($(OS),)
  3. SYS := $(shell gcc -dumpmachine)
  4. ifeq ($(SYS),x86_64-linux-gnu)
  5. OS := Linux
  6. else ifeq ($(findstring freebsd,$(SYS)),freebsd)
  7. OS := 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. OS := $(patsubst %-SGX,%,$(OS))-SGX
  18. endif
  19. ifeq ($(findstring $(OS),$(all_hosts)),)
  20. $(error Unsupported platform: $(OS))
  21. endif
  22. export OS
  23. export OS_MACRO = $(shell echo $(OS) | tr '[:lower:]' '[:upper:]' | tr '-' '_')