Browse Source

Automatically detect OS during build

tags/1.9.8
falkTX 7 years ago
parent
commit
c2f7af8c55
1 changed files with 20 additions and 1 deletions
  1. +20
    -1
      source/Makefile.mk

+ 20
- 1
source/Makefile.mk View File

@@ -18,15 +18,34 @@ CC ?= gcc
CXX ?= g++

# ---------------------------------------------------------------------------------------------------------------------
# Fallback to Linux if no other OS defined
# Auto-detect OS is not defined

ifneq ($(BSD),true)
ifneq ($(HAIKU),true)
ifneq ($(HURD),true)
ifneq ($(LINUX),true)
ifneq ($(MACOS),true)
ifneq ($(WIN32),true)

UNAME := $(shell uname)
ifeq ($(UNAME),$(filter $(UNAME),FreeBSD GNU/kFreeBSD NetBSD OpenBSD))
BSD=true
endif
ifeq ($(UNAME),$(filter $(UNAME),Haiku))
HAIKU=true
endif
ifeq ($(UNAME),$(filter $(UNAME),GNU))
HURD=true
endif
ifeq ($(UNAME),$(filter $(UNAME),Linux))
LINUX=true
endif
ifeq ($(UNAME),$(filter $(UNAME),Darwin))
MACOS=true
endif

endif
endif
endif
endif
endif


Loading…
Cancel
Save