2006-12-01 14:02:14 -08:00
|
|
|
include $(MAKERULES)/config.mk
|
|
|
|
|
|
|
|
|
|
|
|
# Check for unset config
|
|
|
|
|
|
|
|
ifeq ($(strip $(VERSION)),)
|
|
|
|
$(error You must set VERSION in $(MAKERULES)/config.mk)
|
|
|
|
else
|
|
|
|
$(info VERSION set to $(VERSION))
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(strip $(PLATFORM)),)
|
|
|
|
$(error You must set PLATFORM in $(MAKERULES)/config.mk)
|
|
|
|
else
|
|
|
|
$(info PLATFORM set to $(PLATFORM))
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(strip $(MODE)),)
|
|
|
|
$(error You must set MODE in $(MAKERULES)/config.mk)
|
|
|
|
else
|
|
|
|
$(info MODE set to $(MODE))
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(strip $(DEVDIR)),)
|
|
|
|
$(error You must set DEVDIR in $(MAKERULES)/config.mk)
|
|
|
|
else
|
|
|
|
$(info DEVDIR set to $(DEVDIR))
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(strip $(BISON)),)
|
|
|
|
$(error You must set BISON in $(MAKERULES)/config.mk)
|
|
|
|
else
|
|
|
|
$(info BISON is set to $(BISON))
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(strip $(FLEX)),)
|
|
|
|
$(error You must set FLEX in $(MAKERULES)/config.mk)
|
|
|
|
else
|
|
|
|
$(info FLEX is set to $(FLEX))
|
|
|
|
endif
|
|
|
|
|
2007-01-13 12:55:33 -08:00
|
|
|
ifneq ($(strip $(INSTALLER)),)
|
|
|
|
ifeq ($(strip $(MAKENSIS)),)
|
|
|
|
$(error You must set MAKENSIS in $(MAKERULES)/config.mk)
|
|
|
|
else
|
|
|
|
$(info MAKENSIS is set to $(MAKENSIS))
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2006-12-01 14:02:14 -08:00
|
|
|
|
|
|
|
# Setup paths and static values
|
|
|
|
|
2008-01-15 11:23:31 -08:00
|
|
|
CFLAGS+=-DPACKAGE_VERSION=\"$(VERSION)\" -DYY_STATIC -DLOCALEDIR=\"$(LOCALEDIR)\" -DPACKAGE=\"$(PACKAGE)\" -I.. -I../.. -I$(DEVDIR)/include/SDL -I$(DEVDIR)/include/libpng12 -I$(DEVDIR)/include
|
2008-01-15 11:16:02 -08:00
|
|
|
CXXFLAGS+=$(CFLAGS)
|
2006-12-01 14:02:14 -08:00
|
|
|
LDFLAGS+=-L$(DEVDIR)/lib
|
|
|
|
|
2008-01-15 11:23:31 -08:00
|
|
|
# Use C99
|
|
|
|
CFLAGS+=-std=c99
|
2006-12-01 14:02:14 -08:00
|
|
|
|
|
|
|
# Setup build environment with config values
|
|
|
|
|
|
|
|
ifeq ($(strip $(MODE)),debug)
|
2008-01-15 11:16:02 -08:00
|
|
|
CFLAGS+=-g -O0 -DDEBUG -Wall -Werror-implicit-function-declaration
|
|
|
|
CXXFLAGS+=-g -O0 -DDEBUG -Wall
|
2006-12-01 14:02:14 -08:00
|
|
|
else
|
2007-02-14 09:50:12 -08:00
|
|
|
CFLAGS+=-DNDEBUG
|
2008-01-15 11:16:02 -08:00
|
|
|
CXXFLAGS+=-DNDEBUG
|
2006-12-01 14:02:14 -08:00
|
|
|
endif
|
|
|
|
|
2007-08-16 15:50:05 -07:00
|
|
|
ifeq ($(strip $(USE_GETTEXT)),yes)
|
|
|
|
CFLAGS+=-DENABLE_NLS=1
|
|
|
|
endif
|
|
|
|
|
2006-12-01 14:02:14 -08:00
|
|
|
ifeq ($(strip $(PLATFORM)),windows)
|
|
|
|
DIRSEP=\\
|
|
|
|
RMF=del /F
|
|
|
|
EXEEXT=.exe
|
2007-01-13 12:55:33 -08:00
|
|
|
AR=ar
|
|
|
|
CC=gcc
|
|
|
|
WINDRES=windres
|
|
|
|
CFLAGS+=-mwindows -DWIN32
|
2008-01-15 11:16:02 -08:00
|
|
|
CXXFLAGS+=-mwindows -DWIN32
|
2007-01-13 12:55:33 -08:00
|
|
|
LDFLAGS+=-lmingw32 -lSDLmain
|
2007-01-15 05:26:01 -08:00
|
|
|
else
|
|
|
|
ifeq ($(strip $(PLATFORM)),mingw32)
|
2007-01-13 12:55:33 -08:00
|
|
|
DIRSEP=/
|
|
|
|
RMF=rm -f
|
|
|
|
EXEEXT=.exe
|
2007-01-08 17:28:01 -08:00
|
|
|
AR=mingw32-ar
|
|
|
|
CC=mingw32-gcc
|
|
|
|
WINDRES=mingw32-windres
|
|
|
|
CFLAGS+=-mwindows -DWIN32
|
2008-01-15 11:16:02 -08:00
|
|
|
CXXFLAGS+=-mwindows -DWIN32
|
2007-01-08 15:25:38 -08:00
|
|
|
LDFLAGS+=-lmingw32 -lSDLmain
|
2006-12-01 14:02:14 -08:00
|
|
|
else
|
|
|
|
DIRSEP=/
|
|
|
|
RMF=rm -f
|
|
|
|
EXEEXT=
|
2006-12-28 03:47:58 -08:00
|
|
|
AR=ar
|
2007-01-08 17:28:01 -08:00
|
|
|
CC=gcc
|
2006-12-01 14:02:14 -08:00
|
|
|
WINDRES=
|
|
|
|
endif
|
2007-01-15 05:26:01 -08:00
|
|
|
endif
|
2006-12-01 14:02:14 -08:00
|
|
|
|
2006-12-28 03:47:58 -08:00
|
|
|
# Generic libs
|
|
|
|
|
2008-01-09 12:51:48 -08:00
|
|
|
LDFLAGS+=-lSDL -lSDL_net -lpng -lphysfs -lz -lvorbisfile -lvorbis -logg -lpopt -lintl
|
2006-12-01 14:02:14 -08:00
|
|
|
|
2007-01-08 15:48:12 -08:00
|
|
|
# Additional platform-dependend libs
|
2006-12-28 03:47:58 -08:00
|
|
|
|
|
|
|
ifeq ($(strip $(PLATFORM)),windows)
|
2008-01-09 12:26:29 -08:00
|
|
|
LDFLAGS+=-lGLC -lglu32 -lopengl32 -lopenal32 -ldbghelp -lshfolder -lwinmm -lwsock32
|
2007-01-15 05:26:01 -08:00
|
|
|
else
|
|
|
|
ifeq ($(strip $(PLATFORM)),mingw32)
|
2008-01-09 12:26:29 -08:00
|
|
|
LDFLAGS+=-lglc32 -lglu32 -lopengl32 -lopenal32 -ldbghelp -lshfolder -lwinmm -lwsock32
|
2007-01-08 15:48:12 -08:00
|
|
|
else
|
2007-10-11 15:55:34 -07:00
|
|
|
LDFLAGS+=-lGLC -lGLU -lGL -lopenal
|
2006-12-28 03:47:58 -08:00
|
|
|
endif
|
2007-01-15 05:26:01 -08:00
|
|
|
endif
|
2006-12-28 03:47:58 -08:00
|
|
|
|
2008-01-09 12:51:48 -08:00
|
|
|
# Additionaly link against the deps of our deps
|
|
|
|
|
|
|
|
LDFLAGS+=-liconv -lz -lfreetype -lfontconfig -lexpat
|
|
|
|
|
2006-12-01 14:02:14 -08:00
|
|
|
include $(MAKERULES)/common.mk
|