2008-07-10 10:19:17 -07:00
|
|
|
include $(top_builddir)/makerules/config.mk
|
2006-12-01 14:02:14 -08:00
|
|
|
|
|
|
|
|
|
|
|
# Check for unset config
|
|
|
|
|
2008-06-23 06:54:47 -07:00
|
|
|
$(info Checking config...)
|
|
|
|
|
|
|
|
ifeq ($(strip $(PACKAGE_VERSION)),)
|
2008-06-24 16:41:52 -07:00
|
|
|
$(error You must set PACKAGE_VERSION in $(top_srcdir)/makerules/config.mk)
|
2008-06-23 06:54:47 -07:00
|
|
|
else
|
|
|
|
$(info PACKAGE_VERSION := $(PACKAGE_VERSION))
|
|
|
|
endif
|
|
|
|
|
2006-12-01 14:02:14 -08:00
|
|
|
ifeq ($(strip $(MODE)),)
|
2008-06-24 16:41:52 -07:00
|
|
|
$(error You must set MODE in $(top_srcdir)/makerules/config.mk)
|
2006-12-01 14:02:14 -08:00
|
|
|
else
|
2008-06-23 06:54:47 -07:00
|
|
|
$(info MODE := $(MODE))
|
2006-12-01 14:02:14 -08:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(strip $(DEVDIR)),)
|
2008-06-24 16:41:52 -07:00
|
|
|
$(error You must set DEVDIR in $(top_srcdir)/makerules/config.mk)
|
2006-12-01 14:02:14 -08:00
|
|
|
else
|
2008-06-23 06:54:47 -07:00
|
|
|
$(info DEVDIR := $(DEVDIR))
|
2006-12-01 14:02:14 -08:00
|
|
|
endif
|
|
|
|
|
2008-06-23 06:54:47 -07:00
|
|
|
$(info Config seems valid.)
|
2006-12-01 14:02:14 -08:00
|
|
|
|
|
|
|
|
2008-06-23 06:54:47 -07:00
|
|
|
# Setup paths and static values
|
|
|
|
|
2008-07-06 07:28:50 -07:00
|
|
|
PACKAGE:=warzone2100
|
|
|
|
PACKAGE_NAME:=Warzone 2100
|
|
|
|
PACKAGE_BUGREPORT:=http://wz2100.net/
|
|
|
|
|
2008-06-28 15:32:44 -07:00
|
|
|
WZ_CPPFLAGS:=-DPACKAGE=\"$(PACKAGE)\" -DPACKAGE_VERSION=\"$(PACKAGE_VERSION)\" -DYY_STATIC -I$(DEVDIR)/include/SDL -I$(DEVDIR)/include/libpng12 -I$(DEVDIR)/include/bfd -I$(DEVDIR)/include
|
|
|
|
WZ_CFLAGS:=-std=gnu99
|
|
|
|
WZ_CXXFLAGS:=
|
|
|
|
WZ_LDFLAGS:=-L$(DEVDIR)/lib
|
|
|
|
|
2006-12-01 14:02:14 -08:00
|
|
|
|
|
|
|
# Setup build environment with config values
|
|
|
|
|
|
|
|
ifeq ($(strip $(MODE)),debug)
|
2008-06-28 15:32:44 -07:00
|
|
|
WZ_CPPFLAGS+=-DDEBUG
|
|
|
|
WZ_CFLAGS+=-g -O0 -Wall -Werror-implicit-function-declaration
|
|
|
|
WZ_CXXFLAGS+=-g -O0 -Wall -Werror-implicit-function-declaration
|
2006-12-01 14:02:14 -08:00
|
|
|
else
|
2008-06-28 15:32:44 -07:00
|
|
|
WZ_CPPFLAGS+=-DNDEBUG
|
2006-12-01 14:02:14 -08:00
|
|
|
endif
|
|
|
|
|
2008-06-28 15:32:44 -07:00
|
|
|
ifneq ($(strip $(TRANSLATION)),)
|
|
|
|
WZ_CPPFLAGS+=-DENABLE_NLS=1
|
2007-08-16 15:50:05 -07:00
|
|
|
endif
|
|
|
|
|
2008-06-23 06:54:47 -07:00
|
|
|
DIRSEP:=\\
|
2008-06-24 15:34:56 -07:00
|
|
|
MV:=move
|
2008-06-23 06:54:47 -07:00
|
|
|
RM_F:=del /F
|
2008-06-24 15:34:56 -07:00
|
|
|
RMDIR:=rmdir
|
|
|
|
MKDIR_P:=mkdir
|
2008-06-28 15:32:44 -07:00
|
|
|
XGETTEXT:=xgettext
|
|
|
|
MSGMERGE:=msgmerge
|
|
|
|
MSGFMT:=msgfmt
|
|
|
|
FLEX:=flex
|
|
|
|
BISON:=bison
|
|
|
|
MAKENSIS:=makensis
|
|
|
|
|
2008-06-23 06:54:47 -07:00
|
|
|
EXEEXT:=.exe
|
|
|
|
AR:=mingw32-ar
|
|
|
|
CC:=mingw32-gcc
|
|
|
|
CXX:=mingw32-g++
|
2008-07-06 07:28:50 -07:00
|
|
|
WINDRES:=windres
|
2008-06-28 15:32:44 -07:00
|
|
|
WZ_CPPFLAGS+=-DWIN32
|
|
|
|
WZ_CFLAGS+=-mwindows
|
|
|
|
WZ_CXXFLAGS+=-mwindows
|
|
|
|
WZ_LDFLAGS+=-lmingw32 -lSDLmain
|
|
|
|
|
2006-12-01 14:02:14 -08:00
|
|
|
|
2006-12-28 03:47:58 -08:00
|
|
|
# Generic libs
|
|
|
|
|
2008-06-28 15:32:44 -07:00
|
|
|
WZ_LDFLAGS+=-lSDL -lSDL_net -lpng12 -lphysfs -lz -lvorbisfile -lvorbis -logg -lpopt -lintl
|
2006-12-01 14:02:14 -08:00
|
|
|
|
2006-12-28 03:47:58 -08:00
|
|
|
|
2008-06-28 15:32:44 -07:00
|
|
|
# Additional target-platform-dependend libs
|
|
|
|
|
|
|
|
ifeq ($(strip $(TARGET)),windows)
|
|
|
|
WZ_LDFLAGS+=-lGLC -lglu32 -lopengl32 -lopenal32 -ldbghelp -lshfolder -lwinmm -lwsock32 -lbfd -liberty
|
2007-01-08 15:48:12 -08:00
|
|
|
else
|
2008-06-28 15:32:44 -07:00
|
|
|
WZ_LDFLAGS+=-lGLC -lGLU -lGL -lopenal
|
2007-01-15 05:26:01 -08:00
|
|
|
endif
|
2006-12-28 03:47:58 -08:00
|
|
|
|
2008-06-28 15:32:44 -07:00
|
|
|
|
2008-01-09 12:51:48 -08:00
|
|
|
# Additionaly link against the deps of our deps
|
|
|
|
|
2008-06-28 15:32:44 -07:00
|
|
|
WZ_LDFLAGS+=-liconv -lz -lfreetype -lfontconfig -lexpat
|
|
|
|
|
|
|
|
|
|
|
|
# Import environment variables
|
|
|
|
|
|
|
|
CPPFLAGS:=$(WZ_CPPFLAGS) $(CPPFLAGS)
|
|
|
|
CFLAGS:=$(WZ_CFLAGS) $(CFLAGS)
|
|
|
|
CXXFLAGS:=$(WZ_CXXFLAGS) $(CXXFLAGS)
|
|
|
|
LDFLAGS:=$(WZ_LDFLAGS) $(LDFLAGS)
|
|
|
|
|
2008-01-09 12:51:48 -08:00
|
|
|
|
2008-06-28 15:32:44 -07:00
|
|
|
# Export to environment
|
2008-06-28 15:32:14 -07:00
|
|
|
|
2008-07-06 07:28:50 -07:00
|
|
|
export PACKAGE PACKAGE_NAME PACKAGE_BUGREPORT
|
|
|
|
export MV RM_F MKDIR_P RMDIR
|
2008-06-28 15:32:44 -07:00
|
|
|
export XGETTEXT MSGMERGE MSGFMT
|
|
|
|
export FLEX BISON MAKENSIS
|
|
|
|
export EXEEXT AR CC CXX WINDRES
|
|
|
|
export CPPFLAGS CFLAGS CXXFLAGS LDFLAGS
|