2013-03-19 18:28:32 -04:00
|
|
|
UNAME_OS:=$(shell uname -o)
|
|
|
|
UNAME_PLATFORM:=$(shell uname -i)
|
|
|
|
|
|
|
|
# Detect the platform that the software is being built on.
|
|
|
|
ifndef BUILD
|
|
|
|
|
2014-06-28 10:10:20 -04:00
|
|
|
# If the software is being built on Sortix.
|
2013-03-19 18:28:32 -04:00
|
|
|
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
|
|
|
|
ifeq ($(UNAME_PLATFORM),i386)
|
|
|
|
BUILD:=i486-sortix
|
|
|
|
endif
|
|
|
|
ifeq ($(UNAME_PLATFORM),x86_64)
|
|
|
|
BUILD:=x86_64-sortix
|
|
|
|
endif
|
|
|
|
|
2014-06-28 10:10:20 -04:00
|
|
|
# If the software is not built on Sortix.
|
2013-03-19 18:28:32 -04:00
|
|
|
else
|
|
|
|
ifeq ($(MEANT_FOR_SORTIX), 1)
|
|
|
|
makefile_meant_for_sortix:
|
|
|
|
@echo This makefile isn\'t meant to work under $(UNAME_OS)
|
|
|
|
@exit 1
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(UNAME_OS),GNU/Linux)
|
|
|
|
ifeq ($(UNAME_PLATFORM),i386)
|
|
|
|
BUILD:=i386-linux-gnu
|
|
|
|
endif
|
|
|
|
ifeq ($(UNAME_PLATFORM),x86_64)
|
|
|
|
BUILD:=x86_64-linux-gnu
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Determine the platform the software will run on.
|
2014-06-28 10:10:20 -04:00
|
|
|
HOST?=$(BUILD)
|
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
|
|
|
|
|
|
|
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)
|