2006-04-13 20:47:06 +00:00
|
|
|
# Shared make information between Build engine and games
|
|
|
|
|
|
|
|
ENGINELIB=libengine.a
|
|
|
|
EDITORLIB=libbuild.a
|
|
|
|
|
|
|
|
SDLCONFIG=sdl-config
|
|
|
|
#SDLCONFIG=/usr/local/bin/sdl11-config
|
|
|
|
|
|
|
|
# overridden for OSes that don't have the cutdown stdc++ that is supc++
|
|
|
|
STDCPPLIB=-lsupc++
|
|
|
|
|
|
|
|
BUILDCFLAGS=
|
|
|
|
|
|
|
|
# Detect the platform if it wasn't explicitly given to us from
|
|
|
|
# the outside world. This allows cross-compilation by overriding
|
|
|
|
# CC and giving us PLATFORM specifically.
|
|
|
|
ifndef PLATFORM
|
|
|
|
uname=$(strip $(shell uname -s))
|
|
|
|
PLATFORM=UNKNOWN
|
|
|
|
ifeq ($(findstring Linux,$(uname)),Linux)
|
|
|
|
PLATFORM=LINUX
|
|
|
|
endif
|
|
|
|
ifeq ($(findstring BSD,$(uname)),BSD)
|
|
|
|
PLATFORM=BSD
|
|
|
|
endif
|
|
|
|
ifeq ($(findstring MINGW,$(uname)),MINGW)
|
|
|
|
PLATFORM=WINDOWS
|
|
|
|
endif
|
|
|
|
ifeq ($(findstring Darwin,$(uname)),Darwin)
|
|
|
|
PLATFORM=DARWIN
|
|
|
|
endif
|
|
|
|
ifeq ($(findstring BeOS,$(uname)),BeOS)
|
|
|
|
PLATFORM=BEOS
|
|
|
|
endif
|
|
|
|
ifeq ($(findstring skyos,$(uname)),skyos)
|
|
|
|
PLATFORM=SKYOS
|
|
|
|
endif
|
|
|
|
ifeq ($(findstring QNX,$(uname)),QNX)
|
|
|
|
PLATFORM=QNX
|
|
|
|
endif
|
|
|
|
ifeq ($(findstring SunOS,$(uname)),SunOS)
|
|
|
|
PLATFORM=SUNOS
|
|
|
|
endif
|
|
|
|
ifeq ($(findstring syllable,$(uname)),syllable)
|
|
|
|
PLATFORM=SYLLABLE
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(PLATFORM),LINUX)
|
|
|
|
RENDERTYPE=SDL
|
2008-02-16 22:27:08 +00:00
|
|
|
BUILDCFLAGS+= -DHAVE_INTTYPES
|
2007-12-13 17:38:46 +00:00
|
|
|
|
|
|
|
GTKCOMPAT32=0
|
2006-04-13 20:47:06 +00:00
|
|
|
ifeq ($(findstring x86_64,$(shell uname -m)),x86_64)
|
2007-12-13 17:38:46 +00:00
|
|
|
ifeq (1,$(BUILD32_ON_64))
|
|
|
|
# on my 64bit Gentoo these are the 32bit emulation libs
|
|
|
|
LIBS+= -m32 -L/emul/linux/x86/usr/lib
|
|
|
|
BUILDCFLAGS+= -m32
|
|
|
|
#override WITHOUT_GTK=0
|
|
|
|
GTKCOMPAT32=1
|
2008-02-16 22:27:08 +00:00
|
|
|
else
|
|
|
|
override NOASM=1
|
2007-12-13 17:38:46 +00:00
|
|
|
endif
|
2006-04-13 20:47:06 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
ifeq ($(PLATFORM),WINDOWS)
|
|
|
|
RENDERTYPE ?= WIN
|
2008-02-16 22:27:08 +00:00
|
|
|
BUILDCFLAGS+= -DHAVE_INTTYPES
|
2006-04-13 20:47:06 +00:00
|
|
|
EXESUFFIX=.exe
|
2006-07-01 01:40:18 +00:00
|
|
|
LIBS+= -lmingwex -lwinmm -L$(DXROOT)/lib -lwsock32 -lcomctl32 #-lshfolder
|
2006-04-13 20:47:06 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(PLATFORM),BSD)
|
|
|
|
RENDERTYPE=SDL
|
2008-02-16 22:27:08 +00:00
|
|
|
BUILDCFLAGS+= -DHAVE_INTTYPES
|
2006-04-13 20:47:06 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(PLATFORM),BEOS)
|
|
|
|
RENDERTYPE=SDL
|
|
|
|
STDCPPLIB=-lstdc++
|
|
|
|
endif
|
|
|
|
ifeq ($(PLATFORM),SKYOS)
|
|
|
|
RENDERTYPE=SDL
|
|
|
|
EXESUFFIX=.app
|
2006-09-10 17:40:34 +00:00
|
|
|
override NOASM=1
|
2006-04-13 20:47:06 +00:00
|
|
|
BUILDCFLAGS+= -DUNDERSCORES
|
|
|
|
SDLCONFIG=
|
|
|
|
SDLCONFIG_CFLAGS=-I/boot/programs/sdk/include/sdl
|
|
|
|
LIBS+= -lSDL -lnet
|
|
|
|
endif
|
|
|
|
ifeq ($(PLATFORM),QNX)
|
|
|
|
RENDERTYPE=SDL
|
|
|
|
override USE_OPENGL=0
|
2006-09-10 17:40:34 +00:00
|
|
|
override NOASM=1
|
2006-04-13 20:47:06 +00:00
|
|
|
STDCPPLIB=-lstdc++
|
|
|
|
LIBS+= -lsocket
|
|
|
|
endif
|
|
|
|
ifeq ($(PLATFORM),SUNOS)
|
|
|
|
RENDERTYPE=SDL
|
|
|
|
override USE_OPENGL=0
|
|
|
|
override NOASM=1
|
|
|
|
STDCPPLIB=-lstdc++
|
|
|
|
LIBS+= -lsocket -lnsl
|
|
|
|
endif
|
|
|
|
ifeq ($(PLATFORM),SYLLABLE)
|
|
|
|
RENDERTYPE=SDL
|
|
|
|
override USE_OPENGL=0
|
|
|
|
override NOASM=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(RENDERTYPE),SDL)
|
|
|
|
ifneq ($(SDLCONFIG),)
|
|
|
|
LIBS+= $(shell $(SDLCONFIG) --libs)
|
|
|
|
SDLCONFIG_CFLAGS+=$(shell $(SDLCONFIG) --cflags)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq (1,$(WITHOUT_GTK))
|
|
|
|
HAVE_GTK2=0
|
|
|
|
else
|
|
|
|
ifneq (No,$(shell pkg-config --exists gtk+-2.0 || echo No))
|
|
|
|
HAVE_GTK2=1
|
2006-07-01 12:00:26 +00:00
|
|
|
# on my 64bit Gentoo box I have Cairo enabled which means the libs list includes
|
|
|
|
# -lpangocairo-1.0 and -lcairo, however the 32bit compatibility libraries don't
|
|
|
|
# include cairo, so we need to filter out those -l switches in order to link
|
2007-08-17 19:32:56 +00:00
|
|
|
ifneq ($(LINKED_GTK),0)
|
|
|
|
ifeq ($(GTKCOMPAT32),1)
|
|
|
|
LIBS+= $(shell pkg-config --libs gtk+-2.0 | sed 's/\s-l\(pango\)\{0,1\}cairo\S*\s/ /g')
|
|
|
|
else
|
|
|
|
LIBS+= $(shell pkg-config --libs gtk+-2.0)
|
|
|
|
endif
|
2006-07-01 12:00:26 +00:00
|
|
|
endif
|
2006-04-13 20:47:06 +00:00
|
|
|
else
|
|
|
|
HAVE_GTK2=0
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
ifeq ($(RENDERTYPE),WIN)
|
2006-10-15 18:59:45 +00:00
|
|
|
LIBS+= -mwindows -ldxguid
|
2006-04-13 20:47:06 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
BUILDCFLAGS+= -DRENDERTYPE$(RENDERTYPE)=1
|
|
|
|
|
|
|
|
ifneq (0,$(SUPERBUILD))
|
|
|
|
BUILDCFLAGS+= -DSUPERBUILD
|
|
|
|
endif
|
|
|
|
ifneq (0,$(POLYMOST))
|
|
|
|
BUILDCFLAGS+= -DPOLYMOST
|
|
|
|
endif
|
|
|
|
ifneq (0,$(USE_OPENGL))
|
|
|
|
BUILDCFLAGS+= -DUSE_OPENGL
|
|
|
|
endif
|
|
|
|
ifneq (0,$(NOASM))
|
|
|
|
BUILDCFLAGS+= -DNOASM
|
|
|
|
endif
|
2007-08-17 19:32:56 +00:00
|
|
|
ifneq (0,$(LINKED_GTK))
|
|
|
|
BUILDCFLAGS+= -DLINKED_GTK
|
|
|
|
endif
|
2007-08-16 23:25:24 +00:00
|
|
|
|