# debian, RedHat, Mandrake
ifeq ($(OSTYPE), linux-gnu)
	OPERATING_SYSTEM = Linux
endif
# SuSE
ifeq ($(OSTYPE), linux)
	OPERATING_SYSTEM = Linux
endif
# Caldera
ifeq ($(OSTYPE), Linux)
	OPERATING_SYSTEM = Linux
endif


# for creating windows binary under linux
ifeq ($(OSTYPE), Linux_to_Windows)
	OPERATING_SYSTEM = Linux_to_Windows
endif


# HPUX
ifeq ($(OSTYPE), hpux11.00)
	OPERATING_SYSTEM = HPUX
endif
ifeq ($(OSTYPE), hpux11.11)
	OPERATING_SYSTEM = HPUX
endif

# Apple
ifeq ($(OSTYPE), darvin)
	OPERATING_SYSTEM = MACOSX
endif

# Windows
ifeq ($(OS), Windows_NT)
  	ifeq ($(OSTYPE), Cygwin)
    	OPERATING_SYSTEM = Cygwin
  	else
	  OPERATING_SYSTEM = Windows
	  override SHELL = asdf
	endif
endif

ifeq ($(OPERATING_SYSTEM), )
	OPERATING_SYSTEM = Windows
endif

ifeq ($(OSTYPE), msys)
	OPERATING_SYSTEM = MSYS
endif


# the shelltype
ifeq ($(OPERATING_SYSTEM), Linux)
	SHELLTYPE = sh
endif
ifeq ($(OPERATING_SYSTEM), Linux_to_Windows)
	SHELLTYPE = sh
endif
ifeq ($(OPERATING_SYSTEM), HPUX)
	SHELLTYPE = sh
endif
ifeq ($(OPERATING_SYSTEM), MSYS)
	SHELLTYPE = sh
endif
ifeq ($(OPERATING_SYSTEM), Windows)
	SHELLTYPE = COMMAND.COM
	RM = del
endif
ifeq ($(OPERATING_SYSTEM), Cygwin)
	SHELLTYPE = sh
	OPERATING_SYSTEM = Windows
endif
