Boost raw Makefiles

- Use PACKAGE, PACKAGE_VERSION, remove VERSION
- Allow out-of-source-dir builds (mkdir build && cd build && make -f ../Makefile.raw)
- Move config.mk from $(top_srcdir)/makerules/config.mk to $(top_builddir)/config.mk
   When keeping current behaviour (srcdir=builddir), this means: Move it from makerules into the main directory


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5308 4a71c877-e1ca-e34f-864e-861f7616d084
master
Dennis Schridde 2008-06-23 13:54:47 +00:00
parent aa2c897bd2
commit 9bd8b24921
30 changed files with 326 additions and 272 deletions

View File

@ -1,10 +1,18 @@
SUBDIRS=build_tools po win32 lib src data pkg
all clean: $(SUBDIRS)
# Figure out top source dir: The Makefile.raw will be in it, and it is relative to this directory
build_path:=$(patsubst %/Makefile.raw,%,$(lastword $(MAKEFILE_LIST)))
ifneq ($(strip $(build_path)),Makefile.raw)
export top_srcdir:=$(CURDIR)/$(build_path)
else
export top_srcdir:=$(CURDIR)
endif
.PHONY: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -f Makefile.raw -C $@ $(MAKECMDGOALS)
# Top build dir is this directory
export top_builddir:=$(CURDIR)
src: win32 lib build_tools
packaging: data src po
include $(top_srcdir)/makerules/configure.mk
include $(top_srcdir)/makerules/submake.mk
src: build_tools win32 lib
pkg: data src po

View File

@ -1,8 +1,5 @@
include $(top_srcdir)/makerules/configure.mk
SUBDIRS=autorevision
all clean: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -f Makefile.raw -C $@ $(MAKECMDGOALS)
.PHONY: all clean $(SUBDIRS)
include $(top_srcdir)/makerules/submake.mk

View File

@ -1,26 +1,29 @@
MAKERULES=../../makerules
include $(MAKERULES)/configure.mk
include $(MAKERULES)/common.mk
include $(top_srcdir)/makerules/configure.mk
# Hacks to build for compiling system, not for target
CC:=g++
CXX:=g++
CPPFLAGS:=$(subst -DWIN32,,$(CPPFLAGS))
CFLAGS:=$(subst -mwindows,,$(CFLAGS))
CXXFLAGS:=$(subst -mwindows,,$(CXXFLAGS))
LDFLAGS:=
EXEEXT=
SRC=autorevision.cpp
EXE=autorevision
CXX=g++
DEPS=$(patsubst %.c,%.o, $(SRC:%.cpp=%.o)) $(LIBS)
include $(top_srcdir)/makerules/exe.mk
.PHONY: all all-local clean clean-local
all: all-local
$(EXE)$(EXEEXT): $(DEPS)
$(CXX) -o $@ $<
all-local: $(EXE)$(EXEEXT)
$(EXE)$(EXEEXT) +cstr -v ../.. ../../src/autorevision.h
$(builddir)$(DIRSEP)$(EXE)$(EXEEXT) +cstr -v $(top_srcdir) $(top_builddir)/src/autorevision.h
clean-local:
-$(RMF) ../../src/autorevision.h
-$(RM_F) $(top_builddir)/src/autorevision.h
clean:
$(RMF) $(DEPS) $(EXE)$(EXEEXT)
.PHONY: all all-local clean
clean: clean-local
$(RM_F) $(DEPS) $(EXE)$(EXEEXT)

View File

@ -1,35 +1,41 @@
include $(top_srcdir)/makerules/configure.mk
SUBDIRS=mods
MAKERULES=../makerules
include $(MAKERULES)/configure.mk
BASELIST = anims audio components effects features tagdefinitions \
gamedesc.lev images messages misc multiplay novideo.rpl \
script sequenceaudio stats stats-sql structs texpages wrf
PATCHLIST = addon.lev anims components effects \
BASELIST=anims audio components effects features tagdefinitions \
gamedesc.lev images messages misc multiplay music novideo.rpl script \
sequenceaudio stats stats-sql structs texpages wrf
PATCHLIST=addon.lev anims components effects \
messages multiplay stats structs wrf
BASEARCHIVE=base.wz
PATCHARCHIVE=mp.wz
CLEANFILES=$(BASEARCHIVE) $(PATCHARCHIVE)
include $(top_srcdir)/makerules/submake.mk
.PHONY: all clean $(BASEARCHIVE) $(PATCHARCHIVE) $(SUBDIRS)
all:
ifdef DATA
all: $(BASEARCHIVE) $(PATCHARCHIVE) $(SUBDIRS)
endif
$(SUBDIRS):
$(MAKE) -f Makefile.raw -C $@ $(MAKECMDGOALS)
stamp:
touch stamp
$(BASEARCHIVE): $(BASELIST:%=base/%)
cd base && zip -ru0 $@ $(BASELIST) -x *svn*
$(BASEARCHIVE): $(srcdir)/$(basename $(BASEARCHIVE)) stamp $(patsubst %,$(srcdir)/$(basename $(BASEARCHIVE))/%,$(BASELIST))
(cd $< && zip -ru0 $(builddir)/$@ $(filter-out stamp,$(filter-out $<,$(^:$</%=%))) -x '*svn*' || [ $$? -eq 12 ] && true) # zip returns 12 on "nothing to do"
zip -T $@
$(RM_F) stamp
$(PATCHARCHIVE): $(PATCHLIST:%=mp/%)
cd mp && zip -ru0 ../$@ $(PATCHLIST) -x *svn*
$(PATCHARCHIVE): $(srcdir)/$(basename $(BASEARCHIVE)) stamp $(patsubst %,$(srcdir)/$(basename $(PATCHARCHIVE))/%,$(PATCHLIST))
(cd $< && zip -ru0 $(builddir)/$@ $(filter-out stamp,$(filter-out $<,$(^:$</%=%))) -x '*svn*' || [ $$? -eq 12 ] && true) # zip returns 12 on "nothing to do"
zip -T $@
$(RM_F) stamp
clean: $(SUBDIRS)
$(RMF) $(BASEARCHIVE)
$(RMF) $(PATCHARCHIVE)
.PHONY: all clean $(SUBDIRS) $(BASEARCHIVE) $(PATCHARCHIVE)
$(RMDIR) $(SUBDIRS)
$(RM_F) $(BASEARCHIVE)
$(RM_F) $(PATCHARCHIVE)

View File

@ -1,8 +1,5 @@
include $(top_srcdir)/makerules/configure.mk
SUBDIRS=global
all clean: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -f Makefile.raw -C $@ $(MAKECMDGOALS)
.PHONY: all clean $(SUBDIRS)
include $(top_srcdir)/makerules/submake.mk

View File

@ -1,41 +1,49 @@
MAKERULES=../../../makerules
include $(MAKERULES)/configure.mk
include $(top_srcdir)/makerules/configure.mk
AIVOLUTIONLIST = multiplay commands.txt
GRIMLIST = components structs texpages wrf COPYING
NEWST_TILESLIST = texpages COPYING readme.txt
NTWLIST = addon.lev audio components COPYING doc effects images messages multiplay stats structs texpages wrf
AIVOLUTIONLIST=multiplay commands.txt
GRIMLIST=components structs texpages wrf COPYING
NEWST_TILESLIST=texpages COPYING readme.txt
NTWLIST=addon.lev audio components COPYING doc effects images messages multiplay stats structs texpages wrf
AIVOLUTIONARCHIVE=aivolution.wz
GRIMARCHIVE=grim.wz
NEWST_TILESARCHIVE=newst_tiles.wz
NTWARCHIVE=ntw.wz
CLEANFILES=$(AIVOLUTIONARCHIVE) $(GRIMARCHIVE) $(NEWST_TILESARCHIVE) $(NTWARCHIVE)
.PHONY: all clean $(AIVOLUTIONARCHIVE) $(GRIMARCHIVE) $(NEWST_TILESARCHIVE) $(NTWARCHIVE)
all:
ifdef DATA
all: $(AIVOLUTIONARCHIVE) $(GRIMARCHIVE) $(NEWST_TILESARCHIVE) $(NTWARCHIVE)
endif
$(AIVOLUTIONARCHIVE): $(AIVOLUTIONLIST:%=aivolution/%)
cd aivolution && zip -ru0 ../$@ $(AIVOLUTIONLIST) -x *svn*
zip -T $@
stamp:
touch stamp
$(GRIMARCHIVE): $(GRIMLIST:%=grim/%)
cd grim && zip -ru0 ../$@ $(GRIMLIST) -x *svn*
$(AIVOLUTIONARCHIVE): $(srcdir)/$(basename $(AIVOLUTIONARCHIVE)) stamp $(patsubst %,$(srcdir)/$(basename $(AIVOLUTIONARCHIVE))/%,$(AIVOLUTIONLIST))
(cd $< && zip -ru0 $(builddir)/$@ $(filter-out stamp,$(filter-out $<,$(^:$</%=%))) -x '*svn*' || [ $$? -eq 12 ] && true) # zip returns 12 on "nothing to do"
zip -T $@
$(RM_F) stamp
$(NEWST_TILESARCHIVE): $(NEWST_TILESLIST:%=newst_tiles/%)
cd newst_tiles && zip -ru0 ../$@ $(NEWST_TILESLIST) -x *svn*
$(GRIMARCHIVE): $(srcdir)/$(basename $(GRIMARCHIVE)) stamp $(patsubst %,$(srcdir)/$(basename $(GRIMARCHIVE))/%,$(GRIMLIST))
(cd $< && zip -ru0 $(builddir)/$@ $(filter-out stamp,$(filter-out $<,$(^:$</%=%))) -x '*svn*' || [ $$? -eq 12 ] && true) # zip returns 12 on "nothing to do"
zip -T $@
$(RM_F) stamp
$(NTWARCHIVE): $(NTWLIST:%=ntw/%)
cd ntw && zip -ru0 ../$@ $(NTWLIST) -x *svn*
$(NEWST_TILESARCHIVE): $(srcdir)/$(basename $(NEWST_TILESARCHIVE)) stamp $(patsubst %,$(srcdir)/$(basename $(NEWST_TILESARCHIVE))/%,$(NEWST_TILESLIST))
(cd $< && zip -ru0 $(builddir)/$@ $(filter-out stamp,$(filter-out $<,$(^:$</%=%))) -x '*svn*' || [ $$? -eq 12 ] && true) # zip returns 12 on "nothing to do"
zip -T $@
$(RM_F) stamp
$(NTWARCHIVE): $(srcdir)/$(basename $(NTWARCHIVE)) stamp $(patsubst %,$(srcdir)/$(basename $(NTWARCHIVE))/%,$(NTWLIST))
(cd $< && zip -ru0 $(builddir)/$@ $(filter-out stamp,$(filter-out $<,$(^:$</%=%))) -x '*svn*' || [ $$? -eq 12 ] && true) # zip returns 12 on "nothing to do"
zip -T $@
$(RM_F) stamp
clean:
$(RMF) $(GRIMARCHIVE)
$(RMF) $(AIVOLUTIONARCHIVE)
$(RMF) $(NEWST_TILESARCHIVE)
$(RMF) $(NTWARCHIVE)
.PHONY: all clean $(AIVOLUTIONARCHIVE) $(GRIMARCHIVE) $(NEWST_TILESARCHIVE) $(NTWARCHIVE)
$(RM_F) $(GRIMARCHIVE)
$(RM_F) $(AIVOLUTIONARCHIVE)
$(RM_F) $(NEWST_TILESARCHIVE)
$(RM_F) $(NTWARCHIVE)

View File

@ -1,3 +1,5 @@
include $(top_srcdir)/makerules/configure.mk
SUBDIRS=framework \
exceptionhandler \
gamelib \
@ -10,18 +12,4 @@ SUBDIRS=framework \
sqlite3 \
widget
.PHONY: $(SUBDIRS)
all clean: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -f Makefile.raw -C $@ $(MAKECMDGOALS)
# Dependencies not needed, since no linking done?
#gamelib: framework ivis_common ivis_opengl sound
#ivis_common: framework gamelib
#ivis_opengl: framework ivis_common gamelib
#netplay: framework
#script: framework
#sequence: framework
#sound: framework gamelib
#widget: framework ivis_common
include $(top_srcdir)/makerules/submake.mk

View File

@ -1,5 +1,4 @@
MAKERULES=../../makerules
include $(MAKERULES)/configure.mk
include $(top_srcdir)/makerules/configure.mk
SRC=dumpinfo.cpp \
exceptionhandler.c \
@ -7,4 +6,4 @@ SRC=dumpinfo.cpp \
LIB=exceptionhandler
include $(MAKERULES)/lib.mk
include $(top_srcdir)/makerules/lib.mk

View File

@ -1,5 +1,4 @@
MAKERULES=../../makerules
include $(MAKERULES)/configure.mk
include $(top_srcdir)/makerules/configure.mk
SRC=configfile.c \
cursors.c \
@ -25,4 +24,6 @@ SRC=configfile.c \
LIB=framework
include $(MAKERULES)/lib.mk
CLEANFILES=strres_parser.tab.h resource_parser.tab.h
include $(top_srcdir)/makerules/lib.mk

View File

@ -1,5 +1,4 @@
MAKERULES=../../makerules
include $(MAKERULES)/configure.mk
include $(top_srcdir)/makerules/configure.mk
SRC=anim.c \
animobj.c \
@ -10,4 +9,6 @@ SRC=anim.c \
LIB=gamelib
include $(MAKERULES)/lib.mk
CLEANFILES=audp_parser.tab.h
include $(top_srcdir)/makerules/lib.mk

View File

@ -1,5 +1,4 @@
MAKERULES=../../makerules
include $(MAKERULES)/configure.mk
include $(top_srcdir)/makerules/configure.mk
SRC=bitimage.c \
imd.c \
@ -10,4 +9,4 @@ SRC=bitimage.c \
LIB=ivis_common
include $(MAKERULES)/lib.mk
include $(top_srcdir)/makerules/lib.mk

View File

@ -1,5 +1,4 @@
MAKERULES=../../makerules
include $(MAKERULES)/configure.mk
include $(top_srcdir)/makerules/configure.mk
SRC=GLee.c \
ivi.c \
@ -17,4 +16,4 @@ SRC=GLee.c \
LIB=ivis_opengl
include $(MAKERULES)/lib.mk
include $(top_srcdir)/makerules/lib.mk

View File

@ -1,11 +1,10 @@
MAKERULES=../../makerules
include $(MAKERULES)/configure.mk
include $(top_srcdir)/makerules/configure.mk
SRC= netjoin_stub.c \
SRC=netjoin_stub.c \
netlog.c \
netplay.c \
nettypes.c
LIB=netplay
include $(MAKERULES)/lib.mk
include $(top_srcdir)/makerules/lib.mk

View File

@ -1,5 +1,4 @@
MAKERULES=../../makerules
include $(MAKERULES)/configure.mk
include $(top_srcdir)/makerules/configure.mk
SRC=codeprint.c \
event.c \
@ -14,5 +13,7 @@ SRC=codeprint.c \
LIB=script
include $(MAKERULES)/lib.mk
CLEANFILES=chat_parser.tab.h script_parser.tab.h
include $(top_srcdir)/makerules/lib.mk

View File

@ -1,8 +1,7 @@
MAKERULES=../../makerules
include $(MAKERULES)/configure.mk
include $(top_srcdir)/makerules/configure.mk
SRC=sequence.c
LIB=sequence
include $(MAKERULES)/lib.mk
include $(top_srcdir)/makerules/lib.mk

View File

@ -1,5 +1,4 @@
MAKERULES=../../makerules
include $(MAKERULES)/configure.mk
include $(top_srcdir)/makerules/configure.mk
SRC=audio.c \
audio_id.c \
@ -12,4 +11,4 @@ SRC=audio.c \
LIB=sound
include $(MAKERULES)/lib.mk
include $(top_srcdir)/makerules/lib.mk

View File

@ -1,8 +1,7 @@
MAKERULES=../../makerules
include $(MAKERULES)/configure.mk
include $(top_srcdir)/makerules/configure.mk
SRC=physfs_vfs.c sqlite3.c
LIB=sqlite3
include $(MAKERULES)/lib.mk
include $(top_srcdir)/makerules/lib.mk

View File

@ -1,5 +1,4 @@
MAKERULES=../../makerules
include $(MAKERULES)/configure.mk
include $(top_srcdir)/makerules/configure.mk
SRC=bar.c \
button.c \
@ -13,4 +12,4 @@ SRC=bar.c \
LIB=widget
include $(MAKERULES)/lib.mk
include $(top_srcdir)/makerules/lib.mk

View File

@ -1,14 +1,14 @@
%.o: %.rc
$(WINDRES) $(CPPFLAGS) -o$@ $<
%.o: $(srcdir)/%.rc
$(WINDRES) $(CPPFLAGS) -o $@ $<
%.o: %.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o$@ $<
%.o: $(srcdir)/%.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
%.o: %.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o$@ $<
%.o: $(srcdir)/%.cpp
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
%.lex.h %.lex.c: %.l
$(FLEX) $(FLEXFLAGS) -o$@ $<
%.lex.h %.lex.c: $(srcdir)/%.l
$(FLEX) $(FLEXFLAGS) -o $@ $<
%.tab.h %.tab.c: %.y
$(BISON) -d $(BISONFLAGS) -o$@ $<
%.tab.h %.tab.c: $(srcdir)/%.y
$(BISON) -d $(BISONFLAGS) -o $@ $<

View File

@ -1,40 +1,40 @@
# Version of Warzone you are compiling
VERSION=TRUNK
INSTALLER_VERSION=9.9.9.9
PACKAGE_BUGREPORT=http://wz2100.net/
PACKAGE_NAME=Warzone 2100
PACKAGE_VERSION=$(VERSION)
# Metadata of the version of Warzone 2100 you are compiling
PACKAGE:=warzone2100
PACKAGE_NAME:=Warzone 2100
PACKAGE_VERSION:=TRUNK
PACKAGE_BUGREPORT:=http://wz2100.net/
INSTALLER_VERSION:=9.9.9.9
# Platform you are running
#PLATFORM=windows
#PLATFORM=linux
#PLATFORM=mingw32
#PLATFORM:=windows
#PLATFORM:=linux
#PLATFORM:=mingw32
# Compilation mode
#MODE=debug
#MODE=release
#MODE:=debug
#MODE:=release
# Directory where you store your dev stuff (lib and include)
#DEVDIR=C:/devpkg
#DEVDIR:=C:/devpkg
# Remind the user to install Flex and Bison
#BISON=bison
#FLEX=flex
#BISON:=bison
#FLEX:=flex
## This is only needed for people planning to distribute this package and/or
## create installers from it.
# Path to makensis
#MAKENSIS="wine C:/Program\ Files/NSIS/makensis.exe"
#MAKENSIS=makensis
#MAKENSIS:="wine C:/Program\ Files/NSIS/makensis.exe"
#MAKENSIS:=makensis
# Whether to build data package and installer
#DATA=yes
#INSTALLER=yes
#USE_GETTEXT=yes
#DATA:=yes
#INSTALLER:=yes
#USE_GETTEXT:=yes
# Gettext stuff
#PACKAGE=warzone2100
#LOCALEDIR=""
#XGETTEXT="xgettext"
#MSGMERGE="msgmerge"
#MSGFMT="msgfmt"
#PACKAGE:=warzone2100
#LOCALEDIR:=""
#XGETTEXT:="xgettext"
#MSGMERGE:="msgmerge"
#MSGFMT:="msgfmt"

View File

@ -1,107 +1,160 @@
include $(MAKERULES)/config.mk
include $(top_builddir)/config.mk
# Check for unset config
ifeq ($(strip $(VERSION)),)
$(error You must set VERSION in $(MAKERULES)/config.mk)
ifeq ($(MAKELEVEL),0)
$(info Checking config...)
ifeq ($(strip $(PACKAGE)),)
$(error You must set PACKAGE in $(top_srcdir)/makerules/config.mk)
else
$(info VERSION set to $(VERSION))
$(info PACKAGE := $(PACKAGE))
endif
ifeq ($(strip $(PACKAGE_NAME)),)
$(error You must set PACKAGE_NAME in $(top_srcdir)/makerules/config.mk)
else
$(info PACKAGE_NAME := $(PACKAGE_NAME))
endif
ifeq ($(strip $(PACKAGE_VERSION)),)
$(error You must set PACKAGE_VERSION in $(top_srcdir)/makerules/config.mk)
else
$(info PACKAGE_VERSION := $(PACKAGE_VERSION))
endif
ifeq ($(strip $(PACKAGE_BUGREPORT)),)
$(error You must set PACKAGE_BUGREPORT in $(top_srcdir)/makerules/config.mk)
else
$(info PACKAGE_BUGREPORT := $(PACKAGE_BUGREPORT))
endif
ifeq ($(strip $(PLATFORM)),)
$(error You must set PLATFORM in $(MAKERULES)/config.mk)
$(error You must set PLATFORM in $(top_srcdir)/makerules/config.mk)
else
$(info PLATFORM set to $(PLATFORM))
$(info PLATFORM := $(PLATFORM))
endif
ifeq ($(strip $(MODE)),)
$(error You must set MODE in $(MAKERULES)/config.mk)
$(error You must set MODE in $(top_srcdir)/makerules/config.mk)
else
$(info MODE set to $(MODE))
$(info MODE := $(MODE))
endif
ifeq ($(strip $(DEVDIR)),)
$(error You must set DEVDIR in $(MAKERULES)/config.mk)
$(error You must set DEVDIR in $(top_srcdir)/makerules/config.mk)
else
$(info DEVDIR set to $(DEVDIR))
$(info DEVDIR := $(DEVDIR))
endif
ifeq ($(strip $(BISON)),)
$(error You must set BISON in $(MAKERULES)/config.mk)
$(error You must set BISON in $(top_srcdir)/makerules/config.mk)
else
$(info BISON is set to $(BISON))
$(info BISON := $(BISON))
endif
ifeq ($(strip $(FLEX)),)
$(error You must set FLEX in $(MAKERULES)/config.mk)
$(error You must set FLEX in $(top_srcdir)/makerules/config.mk)
else
$(info FLEX is set to $(FLEX))
$(info FLEX := $(FLEX))
endif
ifneq ($(strip $(INSTALLER)),)
ifeq ($(strip $(MAKENSIS)),)
$(error You must set MAKENSIS in $(MAKERULES)/config.mk)
$(error You must set MAKENSIS in $(top_srcdir)/makerules/config.mk)
else
$(info MAKENSIS is set to $(MAKENSIS))
$(info MAKENSIS is := $(MAKENSIS))
endif
endif
$(info Config seems valid.)
endif
# Find ourselves
sub_path:=$(patsubst $(top_builddir)/%,%,$(CURDIR))
ifneq ($(strip $(sub_path)),$(top_builddir))
srcdir:=$(top_srcdir)/$(sub_path)
else
srcdir:=$(top_srcdir)
endif
builddir:=$(CURDIR)
# Setup paths and static values
CFLAGS+=-DPACKAGE_VERSION=\"$(VERSION)\" -DYY_STATIC -DLOCALEDIR=\"$(LOCALEDIR)\" -DPACKAGE=\"$(PACKAGE)\" -I.. -I../.. -I$(DEVDIR)/include/SDL -I$(DEVDIR)/include/libpng12 -I$(DEVDIR)/include
CXXFLAGS+=-DPACKAGE_VERSION=\"$(VERSION)\" -DYY_STATIC -DLOCALEDIR=\"$(LOCALEDIR)\" -DPACKAGE=\"$(PACKAGE)\" -I.. -I../.. -I$(DEVDIR)/include/SDL -I$(DEVDIR)/include/libpng12 -I$(DEVDIR)/include
LDFLAGS+=-L$(DEVDIR)/lib
# Use C99
CPPFLAGS+=-DPACKAGE=\"$(PACKAGE)\" -DPACKAGE_VERSION=\"$(PACKAGE_VERSION)\" -DYY_STATIC -I$(builddir) -I$(srcdir) -I$(top_srcdir) -I$(DEVDIR)/include/SDL -I$(DEVDIR)/include/libpng12 -I$(DEVDIR)/include/bfd -I$(DEVDIR)/include
CFLAGS+=-std=gnu99
CXXFLAGS+=
LDFLAGS+=-L$(DEVDIR)/lib
# Setup build environment with config values
ifeq ($(strip $(MODE)),debug)
CFLAGS+=-g -O0 -DDEBUG -Wall -Werror-implicit-function-declaration
CXXFLAGS+=-g -O0 -DDEBUG -Wall
CPPFLAGS+=-DDEBUG -Wall -Werror-implicit-function-declaration
CFLAGS+=-g -O0
CXXFLAGS+=-g -O0
else
CFLAGS+=-DNDEBUG
CXXFLAGS+=-DNDEBUG
CPPFLAGS+=-DNDEBUG
endif
ifeq ($(strip $(USE_GETTEXT)),yes)
CFLAGS+=-DENABLE_NLS=1
ifneq ($(strip $(USE_GETTEXT)),)
CPPFLAGS+=-DENABLE_NLS=1
ifneq ($(LOCALEDIR),)
CPPFLAGS+=-DLOCALEDIR=$(LOCALEDIR)
endif
endif
ifeq ($(strip $(PLATFORM)),windows)
DIRSEP=\\
RMF=del /F
EXEEXT=.exe
AR=ar
CC=gcc
CXX=g++
WINDRES=windres
CFLAGS+=-mwindows -DWIN32
CXXFLAGS+=-mwindows -DWIN32
DIRSEP:=\\
MV:=???
RM_F:=del /F
RMDIR:=???
MKDIR_P:=???
TEST_D:=???
EXEEXT:=.exe
AR:=ar
CC:=gcc
CXX:=g++
WINDRES:=windres
CPPFLAGS+=-DWIN32
CFLAGS+=-mwindows
CXXFLAGS+=-mwindows
LDFLAGS+=-lmingw32 -lSDLmain
else
ifeq ($(strip $(PLATFORM)),mingw32)
DIRSEP=/
RMF=rm -f
EXEEXT=.exe
AR=mingw32-ar
CC=mingw32-gcc
CXX=mingw32-g++
WINDRES=mingw32-windres
CFLAGS+=-mwindows -DWIN32
CXXFLAGS+=-mwindows -DWIN32
DIRSEP:=/
MV:=mv
RM_F:=rm -f
RMDIR:=rmdir
MKDIR_P:=mkdir -p
TEST_D:=test -d
EXEEXT:=.exe
AR:=mingw32-ar
CC:=mingw32-gcc
CXX:=mingw32-g++
WINDRES:=mingw32-windres
CPPFLAGS+=-DWIN32
CFLAGS+=-mwindows
CXXFLAGS+=-mwindows
LDFLAGS+=-lmingw32 -lSDLmain
else
DIRSEP=/
RMF=rm -f
EXEEXT=
AR=ar
CC=gcc
CXX=g++
WINDRES=
DIRSEP:=/
MV:=mv
RM_F:=rm -f
RMDIR:=rmdir
MKDIR_P:=mkdir -p
TEST_D:=test -d
EXEEXT:=
AR:=ar
CC:=gcc
CXX:=g++
WINDRES:=
endif
endif
@ -125,4 +178,4 @@ endif
LDFLAGS+=-liconv -lz -lfreetype -lfontconfig -lexpat
include $(MAKERULES)/common.mk
include $(top_srcdir)/makerules/common.mk

View File

@ -1,6 +1,8 @@
include $(MAKERULES)/common.mk
include $(top_srcdir)/makerules/common.mk
DEPS=$(patsubst %.c,%.o, $(SRC:%.rc=%.o)) $(LIBS)
DEPS=$(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(patsubst %.rc,%.o,$(SRC)))) $(LIBS)
.PHONY: all clean
all: $(BUILT_SOURCES) $(EXE)$(EXEEXT)
@ -8,6 +10,4 @@ $(EXE)$(EXEEXT): $(DEPS)
$(CXX) $(CFLAGS) -o $@ $^ $(LDFLAGS)
clean:
$(RMF) $(EXE)$(EXEEXT) *.o $(CLEANFILES)
.PHONY: all clean
$(RM_F) $(EXE)$(EXEEXT) *.o $(CLEANFILES)

View File

@ -1,11 +1,11 @@
include $(MAKERULES)/common.mk
include $(top_srcdir)/makerules/common.mk
all: $(BUILT_SOURCES) ../lib$(LIB).a
.PHONY: all clean
../lib$(LIB).a: $(patsubst %.c,%.o, $(SRC:%.cpp=%.o))
all: $(top_builddir)/lib/lib$(LIB).a
$(top_builddir)/lib/lib$(LIB).a: $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SRC)))
$(AR) rcv $@ $^
clean:
$(RMF) ..$(DIRSEP)lib$(LIB).a *.o $(CLEANFILES)
.PHONY: all clean
$(RM_F) $(top_builddir)/lib/lib$(LIB).a *.o $(CLEANFILES)

10
makerules/submake.mk Normal file
View File

@ -0,0 +1,10 @@
.PHONY: all clean $(SUBDIRS)
all clean: $(SUBDIRS)
$(SUBDIRS):
$(TEST_D) $(builddir)/$@ || $(MKDIR_P) $(builddir)/$@
$(MAKE) -f $(srcdir)/$@/Makefile.raw -C $(builddir)/$@ $(MAKECMDGOALS)
clean: $(SUBDIRS)
$(RMDIR) $(SUBDIRS)

View File

@ -1,7 +1,5 @@
include $(top_srcdir)/makerules/configure.mk
SUBDIRS=nsis
all clean: $(SUBDIRS)
.PHONY: $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -f Makefile.raw -C $@ $(MAKECMDGOALS)
include $(top_srcdir)/makerules/submake.mk

View File

@ -1,17 +1,14 @@
MAKERULES=../../makerules
include $(MAKERULES)/configure.mk
include $(top_srcdir)/makerules/configure.mk
SETUPFILE=warzone2100-$(VERSION).exe
SETUPFILE=$(PACKAGE)-$(PACKAGE_VERSION).exe
all:
ifdef INSTALLER
ifeq ($(strip $(PLATFORM)),windows)
all: $(SETUPFILE)
endif
endif
$(SETUPFILE): warzone2100.nsi ../src/warzone2100.exe ../data/base.wz ../data/mp.wz ../data/mods/global/grim.wz
$(MAKENSIS) -DPACKAGE="$(PACKAGE)" -DPACKAGE_NAME="$(PACKAGE_NAME)" -DPACKAGE_VERSION="$(VERSION)" -DPACKAGE_BUGREPORT="$(PACKAGE_BUGREPORT)" -DVERSIONNUM="$(INSTALLER_VERSION)" -DEXTDIR="$(DEVDIR)\bin" -DLOCALEDIR=$(LOCALEDIR) $<
$(SETUPFILE): $(srcdir)/warzone2100.nsi $(top_builddir)/src/warzone2100.exe $(top_builddir)/data/base.wz $(top_builddir)/data/mp.wz $(top_builddir)/data/mods/global/grim.wz
$(MAKENSIS) -DPACKAGE="$(PACKAGE)" -DPACKAGE_NAME="$(PACKAGE_NAME)" -DPACKAGE_VERSION="$(PACKAGE_VERSION)" -DPACKAGE_BUGREPORT="$(PACKAGE_BUGREPORT)" -DVERSIONNUM="$(INSTALLER_VERSION)" -DEXTDIR="$(DEVDIR)\bin" -DLOCALEDIR=$(LOCALEDIR) $<
clean:
$(RMF) $(SETUPFILE)
$(RM_F) $(SETUPFILE)

View File

@ -1,32 +1,32 @@
MAKERULES=../makerules
include $(MAKERULES)/configure.mk
include $(top_srcdir)/makerules/configure.mk
include $(srcdir)/Makevars
PO_FILES=nb.po de.po da.po nl.po la.po
MO_FILES=$(patsubst %.po,%.gmo,$(PO_FILES))
.PHONY: all clean update-po po-files mo-files
all:
ifdef USE_GETTEXT
all: po-files mo-files
endif
PO_FILES=nb.po de.po da.po nl.po la.po
MO_FILES=$(patsubst %.po,%.gmo, $(PO_FILES))
po-files: $(PO_FILES)
po-files: $(patsubst %,$(srcdir)/%,$(PO_FILES))
mo-files: $(MO_FILES)
update-po: clean all
$(PACKAGE).pot: POTFILES.in
$(XGETTEXT) --default-domain=$(PACKAGE) --directory=.. --add-comments=TRANSLATORS: --keyword=_ --keyword=N_ --keyword=P_:1c,2 --keyword=NP_:1c,2 --files-from=$< --copyright-holder="Warzone Resurrection Project" --msgid-bugs-address="warzone-dev@gna.org"
mv $(PACKAGE).po $@
$(DOMAIN).pot: $(srcdir)/POTFILES.in
$(XGETTEXT) $(XGETTEXT_OPTIONS) --default-domain=$(DOMAIN) --copyright-holder=$(COPYRIGHT_HOLDER) --msgid-bugs-address=$(MSGID_BUGS_ADDRESS) --directory=$(top_builddir) --add-comments=TRANSLATORS: --files-from=$<
mv $(DOMAIN).po $@
%.po: $(PACKAGE).pot
$(MSGMERGE) $@ $(PACKAGE).pot -o $@.new
mv $@.new $@
$(srcdir)/%.po: $(srcdir)/$(DOMAIN).pot
$(MSGMERGE) $(MSGMERGE_OPTIONS) $@ $(DOMAIN).pot -o $@.new
$(MV) $@.new $@
%.gmo: %.po
%.gmo: $(srcdir)/%.po
$(MSGFMT) -c -o $@ $<
clean:
$(RMF) $(PACKAGE).pot
$(RMF) $(MO_FILES)
$(RM_F) $(PACKAGE).pot
$(RM_F) $(MO_FILES)

View File

@ -1,5 +1,4 @@
MAKERULES=../makerules
include $(MAKERULES)/configure.mk
include $(top_srcdir)/makerules/configure.mk
SRC=ai.c \
aiexperience.c \
@ -107,22 +106,24 @@ SRC=ai.c \
version.c \
warzoneconfig.c
LIBS=../lib/libgamelib.a \
../lib/libivis_common.a \
../lib/libivis_opengl.a \
../lib/libnetplay.a \
../lib/libscript.a \
../lib/libsequence.a \
../lib/libsound.a \
../lib/libwidget.a \
../lib/libframework.a \
../lib/libexceptionhandler.a \
../lib/libsqlite3.a
LIBS=$(top_builddir)/lib/libgamelib.a \
$(top_builddir)/lib/libivis_common.a \
$(top_builddir)/lib/libivis_opengl.a \
$(top_builddir)/lib/libnetplay.a \
$(top_builddir)/lib/libscript.a \
$(top_builddir)/lib/libsequence.a \
$(top_builddir)/lib/libsound.a \
$(top_builddir)/lib/libwidget.a \
$(top_builddir)/lib/libframework.a \
$(top_builddir)/lib/libexceptionhandler.a \
$(top_builddir)/lib/libsqlite3.a
ifeq ($(strip $(PLATFORM)),windows)
LIBS += ../win32/warzone2100.o
LIBS += $(top_builddir)/win32/warzone2100.o
endif
EXE=warzone2100
include $(MAKERULES)/exe.mk
CLEANFILES=scriptvals_parser.tab.h
include $(top_srcdir)/makerules/exe.mk

View File

@ -14,19 +14,13 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# $Revision$
# $Id$
# $HeadURL$
MAKERULES=../../../makerules
include $(MAKERULES)/configure.mk
include $(top_srcdir)/makerules/configure.mk
OBJS=main.o lobby/read_write_mutex.o networking/tcp_server.o lobby/lobby.o lobby/game.o lobby/raii_counter.o lobby/lobby_iterator.o lobby/lobby_gamelock.o requesthandler.o networking/nattester.o
BOOST_DIR=C:/boost_1_33_1
BOOST_ASIO_DIR=C:/boost_asio_0_3_7
WARZONE_LIBDIR=../../../lib
WARZONE_LIBDIR=$(top_builddir)/lib
ifeq ($(RELEASE),)
BOOST_THREADS=$(BOOST_DIR)/bin/boost/libs/thread/build/libboost_thread.lib/mingw/debug/threading-multi/libboost_thread-mgw-mt-d-1_33_1.lib

View File

@ -1,9 +1,8 @@
MAKERULES=../makerules
include $(MAKERULES)/configure.mk
include $(top_srcdir)/makerules/configure.mk
ifeq ($(strip $(PLATFORM)),windows)
all: warzone2100.o
endif
clean:
$(RMF) warzone2100.o
$(RM_F) warzone2100.o