2008-06-22 18:32:58 +00:00
|
|
|
# Designed for GNU Make
|
|
|
|
|
|
|
|
# Compiler settings
|
2009-05-09 16:08:00 +00:00
|
|
|
CXXFLAGS?= -g -Iutil/
|
2008-07-12 09:43:38 +00:00
|
|
|
DMD=gdmd -version=Posix
|
2008-06-22 18:32:58 +00:00
|
|
|
|
2008-07-12 09:43:38 +00:00
|
|
|
# Some extra flags for niftool and bsatool
|
2008-07-20 21:31:01 +00:00
|
|
|
NIFFLAGS=-debug=warnstd -debug=check -debug=statecheck -debug=strict -debug=verbose
|
2008-06-22 18:32:58 +00:00
|
|
|
|
2009-02-01 02:21:08 +00:00
|
|
|
# Compiler settings for Ogre, OIS and MyGUI
|
|
|
|
CF_OIS=$(shell pkg-config --cflags OIS OGRE MyGUI)
|
2008-07-20 21:31:01 +00:00
|
|
|
OGCC=$(CXX) $(CXXFLAGS) $(CF_OIS)
|
2008-06-22 18:32:58 +00:00
|
|
|
|
2008-09-27 13:16:35 +00:00
|
|
|
# Compiler settings for ffmpeg.
|
2008-07-20 21:31:01 +00:00
|
|
|
CF_FFMPEG=$(shell pkg-config --cflags libavcodec libavformat)
|
|
|
|
AVGCC=$(CXX) $(CXXFLAGS) $(CF_FFMPEG)
|
2008-07-13 13:46:45 +00:00
|
|
|
|
2008-09-27 13:16:35 +00:00
|
|
|
# Settings for Bullet
|
|
|
|
CF_BULLET=-Iinclude/bullet
|
|
|
|
BGCC=$(CXX) $(CXXFLAGS) $(CF_BULLET)
|
|
|
|
|
2008-06-22 18:32:58 +00:00
|
|
|
# Ogre C++ files, on the form ogre/cpp_X.cpp. Only the first file is
|
|
|
|
# passed to the compiler, the rest are dependencies.
|
2009-02-01 02:21:08 +00:00
|
|
|
ogre_cpp=ogre framelistener interface bsaarchive mygui
|
2008-06-22 18:32:58 +00:00
|
|
|
|
2008-07-22 13:58:12 +00:00
|
|
|
# FFmpeg files, in the form sound/cpp_X.cpp.
|
2008-07-13 13:46:45 +00:00
|
|
|
avcodec_cpp=avcodec
|
|
|
|
|
2008-09-27 13:16:35 +00:00
|
|
|
# Bullet cpp files
|
2008-10-29 15:41:45 +00:00
|
|
|
bullet_cpp=bullet player scale
|
2008-09-27 13:16:35 +00:00
|
|
|
|
|
|
|
#### No modifications should be required below this line. ####
|
2008-07-12 09:43:38 +00:00
|
|
|
|
2008-06-22 18:32:58 +00:00
|
|
|
ogre_cpp_files=$(ogre_cpp:%=ogre/cpp_%.cpp)
|
2008-07-13 13:46:45 +00:00
|
|
|
avcodec_cpp_files=$(avcodec_cpp:%=sound/cpp_%.cpp)
|
2008-09-27 13:16:35 +00:00
|
|
|
bullet_cpp_files=$(bullet_cpp:%=bullet/cpp_%.cpp)
|
2008-06-22 18:32:58 +00:00
|
|
|
|
2008-07-20 21:31:01 +00:00
|
|
|
# All object files needed by openmw and esmtool
|
2008-10-22 18:39:56 +00:00
|
|
|
src := $(wildcard bsa/*.d) $(wildcard bullet/*.d) $(wildcard core/*.d) \
|
|
|
|
$(wildcard esm/*.d) $(wildcard input/*.d) $(wildcard nif/*.d) $(wildcard ogre/*.d) \
|
2009-05-10 14:02:05 +00:00
|
|
|
$(wildcard scene/*.d) $(wildcard sound/*.d) $(wildcard util/*.d) $(wildcard gui/*.d)
|
2008-11-08 07:59:32 +00:00
|
|
|
src := $(src) $(wildcard mscripts/*.d)
|
|
|
|
src := $(src) monster/monster.d \
|
|
|
|
$(wildcard monster/vm/*.d) \
|
|
|
|
$(wildcard monster/compiler/*.d) \
|
2009-01-14 20:51:17 +00:00
|
|
|
$(wildcard monster/util/*.d) \
|
|
|
|
$(wildcard monster/modules/*.d)
|
2008-07-20 21:31:01 +00:00
|
|
|
obj := $(src:%.d=objs/%.o)
|
2008-07-12 09:43:38 +00:00
|
|
|
|
|
|
|
# The NIF object files for niftool and bsatool are put in a separate
|
|
|
|
# directory, since they are built with different flags.
|
2008-07-20 21:31:01 +00:00
|
|
|
src_nif := $(wildcard nif/*.d)
|
|
|
|
src_nif := $(src_nif) $(wildcard util/*.d)
|
|
|
|
src_nif := $(src_nif) core/memory.d
|
|
|
|
src_nif := $(src_nif) $(wildcard monster/util/*.d)
|
|
|
|
obj_nif := $(src_nif:%.d=nifobjs/%.o)
|
2008-07-12 09:43:38 +00:00
|
|
|
|
2008-07-20 21:31:01 +00:00
|
|
|
.PHONY: cpp all clean
|
2008-07-12 09:43:38 +00:00
|
|
|
|
2008-07-20 21:31:01 +00:00
|
|
|
# Build everything. Default when running 'make' directly.
|
|
|
|
all: openmw esmtool niftool bsatool bored
|
2008-07-12 09:43:38 +00:00
|
|
|
|
2008-07-20 21:31:01 +00:00
|
|
|
# Only build C++ sources. Used when building from DSSS.
|
2008-09-27 13:16:35 +00:00
|
|
|
cpp: cpp_ogre.o cpp_avcodec.o cpp_bullet.o
|
2008-06-22 18:32:58 +00:00
|
|
|
|
|
|
|
cpp_ogre.o: $(ogre_cpp_files)
|
2009-02-08 18:41:03 +00:00
|
|
|
$(OGCC) -o $@ -c $<
|
2008-06-22 18:32:58 +00:00
|
|
|
|
2008-07-13 13:46:45 +00:00
|
|
|
cpp_avcodec.o: $(avcodec_cpp_files)
|
2009-02-08 18:41:03 +00:00
|
|
|
$(AVGCC) -o $@ -c $<
|
2008-07-13 13:46:45 +00:00
|
|
|
|
2008-09-27 13:16:35 +00:00
|
|
|
cpp_bullet.o: $(bullet_cpp_files)
|
2009-02-08 18:41:03 +00:00
|
|
|
$(BGCC) -o $@ -c $<
|
2008-09-27 13:16:35 +00:00
|
|
|
|
2008-07-20 21:31:01 +00:00
|
|
|
objs/%.o: %.d
|
|
|
|
dirname $@ | xargs mkdir -p
|
2008-07-12 09:43:38 +00:00
|
|
|
$(DMD) -c $< -of$@
|
|
|
|
|
2008-07-20 21:31:01 +00:00
|
|
|
nifobjs/%.o: %.d
|
|
|
|
dirname $@ | xargs mkdir -p
|
|
|
|
$(DMD) $(NIFFLAGS) -c $< -of$@
|
|
|
|
|
2008-09-27 13:16:35 +00:00
|
|
|
openmw: openmw.d cpp_ogre.o cpp_avcodec.o cpp_bullet.o $(obj)
|
2009-02-01 02:21:08 +00:00
|
|
|
$(DMD) $^ -of$@ -L-lopenal -L-lOgreMain -L-lOIS -L-lmygui -L-luuid -L-lavcodec -L-lavformat bullet/libbulletdynamics.a bullet/libbulletcollision.a bullet/libbulletmath.a
|
2008-07-12 09:43:38 +00:00
|
|
|
|
2008-10-22 12:49:45 +00:00
|
|
|
esmtool: esmtool.d cpp_ogre.o cpp_avcodec.o cpp_bullet.o $(obj)
|
2009-02-01 02:21:08 +00:00
|
|
|
$(DMD) $^ -of$@ -L-lopenal -L-lOgreMain -L-lOIS -L-lmygui -L-luuid -L-lavcodec -L-lavformat bullet/libbulletdynamics.a bullet/libbulletcollision.a bullet/libbulletmath.a
|
2008-07-12 09:43:38 +00:00
|
|
|
|
2008-07-20 21:31:01 +00:00
|
|
|
niftool: niftool.d $(obj_nif)
|
2008-07-12 09:43:38 +00:00
|
|
|
$(DMD) $^ -of$@
|
|
|
|
|
2008-07-20 21:31:01 +00:00
|
|
|
bsatool: bsatool.d $(obj_nif) objs/bsa/bsafile.o
|
2008-07-12 09:43:38 +00:00
|
|
|
$(DMD) $^ -of$@
|
|
|
|
|
|
|
|
bored: bored.d
|
|
|
|
$(DMD) $^
|
|
|
|
|
|
|
|
clean:
|
2008-07-13 13:46:45 +00:00
|
|
|
-rm -f cpp_ogre.o cpp_avcodec.o bored.o bsafile.o bsatool.o esmtool.o niftool.o openmw.o
|
2008-07-12 19:58:13 +00:00
|
|
|
-rm -f openmw esmtool niftool bsatool bored
|
|
|
|
-rm -rf objs/ nifobjs/ dsss_objs/
|