|
|
|
@ -6,13 +6,15 @@ CXXFLAGS?= -Wall -g
|
|
|
|
|
DMD=gdmd -version=Posix
|
|
|
|
|
|
|
|
|
|
# Some extra flags for niftool and bsatool
|
|
|
|
|
NIFFLAGS=
|
|
|
|
|
NIFFLAGS=-debug=warnstd -debug=check -debug=statecheck -debug=strict -debug=verbose
|
|
|
|
|
|
|
|
|
|
# Compiler settings for Ogre + OIS. Change as needed.
|
|
|
|
|
OGCC=$(CXX) $(CXXFLAGS) `pkg-config --cflags OGRE OIS`
|
|
|
|
|
CF_OIS=$(shell pkg-config --cflags OGRE OIS)
|
|
|
|
|
OGCC=$(CXX) $(CXXFLAGS) $(CF_OIS)
|
|
|
|
|
|
|
|
|
|
# Compiler settings for ffmpeg. Change as needed.
|
|
|
|
|
AVGCC=$(CXX) $(CXXFLAGS) `pkg-config --cflags libavcodec libavformat`
|
|
|
|
|
CF_FFMPEG=$(shell pkg-config --cflags libavcodec libavformat)
|
|
|
|
|
AVGCC=$(CXX) $(CXXFLAGS) $(CF_FFMPEG)
|
|
|
|
|
|
|
|
|
|
# Ogre C++ files, on the form ogre/cpp_X.cpp. Only the first file is
|
|
|
|
|
# passed to the compiler, the rest are dependencies.
|
|
|
|
@ -22,25 +24,31 @@ ogre_cpp=ogre framelistener interface overlay bsaarchive
|
|
|
|
|
# passed to the compiler, the rest are dependencies.
|
|
|
|
|
avcodec_cpp=avcodec
|
|
|
|
|
|
|
|
|
|
## The rest of this file is automatic ##
|
|
|
|
|
## No modifications should be required below this line. ##
|
|
|
|
|
|
|
|
|
|
ogre_cpp_files=$(ogre_cpp:%=ogre/cpp_%.cpp)
|
|
|
|
|
avcodec_cpp_files=$(avcodec_cpp:%=sound/cpp_%.cpp)
|
|
|
|
|
|
|
|
|
|
d_files=$(wildcard */*.d) $(wildcard monster/util/*.d)
|
|
|
|
|
d_files_nif=$(wildcard nif/*.d) $(wildcard util/*.d) $(wildcard core/memory.d) $(wildcard monster/util/*.d)
|
|
|
|
|
# All object files needed by openmw and esmtool
|
|
|
|
|
src := $(wildcard */*.d)
|
|
|
|
|
src := $(src) $(wildcard monster/util/*.d)
|
|
|
|
|
obj := $(src:%.d=objs/%.o)
|
|
|
|
|
|
|
|
|
|
# The NIF object files for niftool and bsatool are put in a separate
|
|
|
|
|
# directory, since they are built with different flags.
|
|
|
|
|
d_objs=$(d_files:%.d=objs/%.o)
|
|
|
|
|
d_objs_nif=$(d_files_nif:%.d=nifobjs/%.o)
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
.PHONY: cpp all clean makedirs
|
|
|
|
|
.PHONY: cpp all clean
|
|
|
|
|
|
|
|
|
|
# By default, make will only build the Ogre C++ sources.
|
|
|
|
|
cpp: cpp_ogre.o cpp_avcodec.o
|
|
|
|
|
# Build everything. Default when running 'make' directly.
|
|
|
|
|
all: openmw esmtool niftool bsatool bored
|
|
|
|
|
|
|
|
|
|
all: makedirs openmw esmtool niftool bsatool bored
|
|
|
|
|
# Only build C++ sources. Used when building from DSSS.
|
|
|
|
|
cpp: cpp_ogre.o cpp_avcodec.o
|
|
|
|
|
|
|
|
|
|
cpp_ogre.o: $(ogre_cpp_files)
|
|
|
|
|
$(OGCC) -c $<
|
|
|
|
@ -48,41 +56,24 @@ cpp_ogre.o: $(ogre_cpp_files)
|
|
|
|
|
cpp_avcodec.o: $(avcodec_cpp_files)
|
|
|
|
|
$(AVGCC) -c $<
|
|
|
|
|
|
|
|
|
|
objs/%.o: %.d makedirs
|
|
|
|
|
objs/%.o: %.d
|
|
|
|
|
dirname $@ | xargs mkdir -p
|
|
|
|
|
$(DMD) -c $< -of$@
|
|
|
|
|
|
|
|
|
|
nifobjs/%.o: %.d makedirs
|
|
|
|
|
$(DMD) -debug=warnstd -debug=check -debug=statecheck -debug=strict -debug=verbose -c $< -of$@
|
|
|
|
|
|
|
|
|
|
# This is a hack for gdmd (dmd-like frontend to gdc), since it does
|
|
|
|
|
# not automatically create directories as it should.
|
|
|
|
|
makedirs:
|
|
|
|
|
mkdir -p objs/bsa
|
|
|
|
|
mkdir -p objs/core
|
|
|
|
|
mkdir -p objs/esm
|
|
|
|
|
mkdir -p objs/input
|
|
|
|
|
mkdir -p objs/monster/util
|
|
|
|
|
mkdir -p objs/nif
|
|
|
|
|
mkdir -p objs/ogre
|
|
|
|
|
mkdir -p objs/scene
|
|
|
|
|
mkdir -p objs/sound
|
|
|
|
|
mkdir -p objs/util
|
|
|
|
|
mkdir -p nifobjs/nif
|
|
|
|
|
mkdir -p nifobjs/util
|
|
|
|
|
mkdir -p nifobjs/core
|
|
|
|
|
mkdir -p nifobjs/monster/util
|
|
|
|
|
mkdir -p nifobjs/bsa
|
|
|
|
|
|
|
|
|
|
openmw: openmw.d cpp_ogre.o cpp_avcodec.o $(d_objs)
|
|
|
|
|
nifobjs/%.o: %.d
|
|
|
|
|
dirname $@ | xargs mkdir -p
|
|
|
|
|
$(DMD) $(NIFFLAGS) -c $< -of$@
|
|
|
|
|
|
|
|
|
|
openmw: openmw.d cpp_ogre.o cpp_avcodec.o $(obj)
|
|
|
|
|
$(DMD) $^ -of$@ -L-lopenal -L-lOgreMain -L-lOIS -L-lavcodec -L-lavformat
|
|
|
|
|
|
|
|
|
|
esmtool: esmtool.d cpp_ogre.o cpp_avcodec.o $(d_objs)
|
|
|
|
|
esmtool: esmtool.d cpp_ogre.o cpp_avcodec.o $(obj)
|
|
|
|
|
$(DMD) $^ -of$@ -L-lopenal -L-lOgreMain -L-lOIS -L-lavcodec -L-lavformat
|
|
|
|
|
|
|
|
|
|
niftool: niftool.d $(d_objs_nif)
|
|
|
|
|
niftool: niftool.d $(obj_nif)
|
|
|
|
|
$(DMD) $^ -of$@
|
|
|
|
|
|
|
|
|
|
bsatool: bsatool.d $(d_objs_nif) bsa/bsafile.d
|
|
|
|
|
bsatool: bsatool.d $(obj_nif) objs/bsa/bsafile.o
|
|
|
|
|
$(DMD) $^ -of$@
|
|
|
|
|
|
|
|
|
|
bored: bored.d
|
|
|
|
|