From 4af73b60edeef25169787c9e0d8087d397a70bd4 Mon Sep 17 00:00:00 2001 From: Albert Cahalan Date: Sun, 4 May 2008 07:36:04 +0000 Subject: [PATCH] provide OS as a variable; use to simplify --- Makefile | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index a6758d310..b8ec7a8e9 100644 --- a/Makefile +++ b/Makefile @@ -14,13 +14,40 @@ VER_VERSION:=0.9.20 VER_DATE:=`date +"%Y-%m-%d"` - MAGIC_API_VERSION:=0x00000001 -SO_TYPE:=so + +# Need to know the OS + +ifneq ($(SystemDrive),) +OS:=windows +else +SYSNAME:=$(shell uname -s) +ifeq ($(SYSNAME),Darwin) +OS:=osx +else ifeq ($(SYSNAME),BeOS) +OS:=beos +else ifeq ($(SYSNAME),Haiku) +OS:=beos +else +OS:=linux +endif + +windows_SO_TYPE:=dll +osx_SO_TYPE:=bundle +beos_SO_TYPE:=so +linux_SO_TYPE:=so +SO_TYPE:=$(OS)_SO_TYPE + +windows_EXE_EXT:=.exe +EXE_EXT:=$(OS)_EXE_EXT # Where to install things: -PREFIX:=/usr/local +windows_PREFIX:=/usr/local +osx_PREFIX:=/usr/local +beos_PREFIX:=./ +linux_PREFIX:=/usr/local +PREFIX:=$(OS)_PREFIX # Root directory to place files when creating packages. @@ -31,8 +58,6 @@ DESTDIR:=$(PKG_ROOT) # Program: BIN_PREFIX:=$(DESTDIR)$(PREFIX)/bin -EXE_EXT:= - # Data: