2016-03-06 09:29:15 -05:00
|
|
|
UNAME_OS:=$(shell uname -s | tr '[:upper:]' '[:lower:]' | sed 's,^linux$$,linux-gnu,g')
|
|
|
|
UNAME_MACHINE:=$(shell uname -m)
|
2013-03-19 18:28:32 -04:00
|
|
|
|
|
|
|
# Detect the platform that the software is being built on.
|
2016-03-06 09:29:15 -05:00
|
|
|
BUILD?=$(UNAME_MACHINE)-$(UNAME_OS)
|
2013-03-19 18:28:32 -04:00
|
|
|
|
|
|
|
# Determine the platform the software will run on.
|
2014-06-28 10:10:20 -04:00
|
|
|
HOST?=$(BUILD)
|
2016-01-04 16:46:34 -05:00
|
|
|
HOST_MACHINE:=$(shell expr x$(HOST) : 'x\([^-]*\).*')
|
2013-03-19 18:28:32 -04:00
|
|
|
|
|
|
|
# Determine the platform the software will target.
|
2014-06-28 10:10:20 -04:00
|
|
|
TARGET?=$(HOST)
|
2013-03-19 18:28:32 -04:00
|
|
|
|
2016-03-06 09:29:15 -05:00
|
|
|
BUILD_IS_SORTIX:=$(if $(shell echo $(BUILD) | grep -- -sortix),1,0)
|
|
|
|
HOST_IS_SORTIX:=$(if $(shell echo $(HOST) | grep -- -sortix),1,0)
|
|
|
|
TARGET_IS_SORTIX:=$(if $(shell echo $(TARGET) | grep -- -sortix),1,0)
|
|
|
|
|
|
|
|
# If the software is being built on Sortix.
|
|
|
|
ifeq ($(UNAME_OS),sortix)
|
|
|
|
ifeq ($(MAKEFILE_NOT_MEANT_FOR_SORTIX), 1)
|
|
|
|
makefile_not_meant_for_sortix:
|
|
|
|
@echo This makefile isn\'t meant to work under Sortix
|
|
|
|
@exit 1
|
|
|
|
endif
|
|
|
|
|
|
|
|
# If the software is not built on Sortix.
|
|
|
|
else ifeq ($(MEANT_FOR_SORTIX), 1)
|
|
|
|
makefile_meant_for_sortix:
|
|
|
|
@echo This makefile isn\'t meant to work under $(uname -s)
|
|
|
|
@exit 1
|
|
|
|
endif
|