Makefile.Host 408 B

123456789101112131415161718
  1. all_hosts = Skeleton Linux 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. else
  12. ifeq ($(findstring $(OS),$(all_hosts)),)
  13. $(error Unsupported platform: $(OS))
  14. endif
  15. endif
  16. OS_MACRO := $(shell echo $(OS) | tr '[:lower:]' '[:upper:]' | tr '-' '_')