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
|
|
|
|
|
2007-04-02 13:49:14 -07:00
|
|
|
CFLAGS+=-DVERSION=\"$(VERSION)\" -DYY_STATIC -DLOCALEDIR=\"$(LOCALEDIR)\" -DPACKAGE=\"$(PACKAGE)\" -I.. -I../.. -I$(DEVDIR)/include
|
2006-12-01 14:02:14 -08:00
|
|
|
LDFLAGS+=-L$(DEVDIR)/lib
|
|
|
|
|
|
|
|
|
|
|
|
# Setup build environment with config values
|
|
|
|
|
|
|
|
ifeq ($(strip $(MODE)),debug)
|
2007-04-09 08:02:04 -07:00
|
|
|
CFLAGS+=-g -O0 -DDEBUG -Wall -Werror-implicit-function-declaration
|
2006-12-01 14:02:14 -08:00
|
|
|
else
|
2007-02-14 09:50:12 -08:00
|
|
|
CFLAGS+=-DNDEBUG
|
2006-12-01 14:02:14 -08:00
|
|
|
endif
|
|
|
|
|
|
|
|
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
|
|
|
|
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
|
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
|
|
|
|
|
2007-04-17 11:24:31 -07:00
|
|
|
LDFLAGS+=-lSDL -lSDL_net -lpng -lphysfs -lz -lvorbisfile -lvorbis -logg
|
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)
|
2007-02-23 09:27:33 -08:00
|
|
|
LDFLAGS+=-ldbghelp -lshfolder -lwinmm -lwsock32 -lglu32 -lopengl32 -lopenal32
|
2007-01-15 05:26:01 -08:00
|
|
|
else
|
|
|
|
ifeq ($(strip $(PLATFORM)),mingw32)
|
2007-02-23 09:27:33 -08:00
|
|
|
LDFLAGS+=-L. -ldbghelp -lshfolder -lwinmm -lwsock32 -lglu32 -lopengl32 -lopenal32
|
2007-01-08 15:48:12 -08:00
|
|
|
else
|
|
|
|
LDFLAGS+=-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
|
|
|
|
2006-12-01 14:02:14 -08:00
|
|
|
include $(MAKERULES)/common.mk
|