Merge branch 'makefile'

This commit is contained in:
2015-06-26 12:31:55 -04:00
4 changed files with 91 additions and 8 deletions

5
.gitignore vendored
View File

@@ -26,7 +26,10 @@ Win32/*/obj
*.depend
*blades.ini
.config.vars
# build.sh output directories and files
obj/
exe/
configvars.make
# XCode Junk Files
src/*.xcodeproj/**/xcuserdata

View File

@@ -28,6 +28,8 @@ BOE_SRC=`echo $BOE_SRC src/pcedit/pc.editors.cpp`
ED_SRC=`echo $ED_SRC`
PC_SRC=`echo $PC_SRC`
PLATFORM=macosx
function usage {
echo "usage: $0 [-chrw]"
}
@@ -48,9 +50,9 @@ function clean {
function build {
mkdir -p obj exe/bin 'exe/Blades of Exile/data'
mkdir -p 'exe/Blades of Exile/Blades of Exile Scenarios/'
mkdir -p 'exe/Blades of Exile/Scenario Editor/Blades of Exile Base'
mkdir -p 'exe/Blades of Exile/Scenario Editor/'
echo "$COMMON_SRC" > test.txt
export COMMON_SRC BOE_SRC ED_SRC PC_SRC
export COMMON_SRC BOE_SRC ED_SRC PC_SRC PLATFORM
make all
}

71
macosx.make Normal file
View File

@@ -0,0 +1,71 @@
BOE_CONTENT='exe/Blades of Exile/Blades of Exile.app/Contents'
PC_CONTENT='exe/Blades of Exile/Scenario Editor/Blades of Exile Character Editor.app/Contents'
SCEN_CONTENT='exe/Blades of Exile/Scenario Editor/BoE Scenario Editor.app/Contents'
exe/bin/%.nib: rsrc/menus/%.xib
ibtool --compile $@ $<
game-menus: exe/bin/game.nib
pc-menus: exe/bin/pcedit.nib
scen-menus: exe/bin/scenedit.nib
frameworks:
rm -rf exe/fwk # Because otherwise cp complains "can't replace dir with non-dir"
mkdir -p exe/fwk
cp -Rfp /Library/Frameworks/sfml-{audio,graphics,system,window}.framework exe/fwk
cp -Rfp /Library/Frameworks/{ogg,FLAC,freetype}.framework exe/fwk
cp -Rfp /Library/Frameworks/vorbis{,enc,file}.framework exe/fwk
cp -Rfp /usr/local/lib/libboost_{system,filesystem,thread}.dylib exe/fwk
game-bundle: game-menus frameworks src/BoE-Info.plist
mkdir -p $(BOE_CONTENT)/MacOS
mkdir -p $(BOE_CONTENT)/Contents
mkdir -p $(BOE_CONTENT)/Resources
rm -rf $(BOE_CONTENT)/Frameworks
mkdir -p $(BOE_CONTENT)/Frameworks
cp -fp exe/bin/boe $(BOE_CONTENT)/MacOS/'Blades of Exile'
cp -fp src/BoE-Info.plist $(BOE_CONTENT)/Info.plist
sed -Ei -e 's/\$$\{EXECUTABLE_NAME\}/Blades of Exile/' $(BOE_CONTENT)/Info.plist
rm -f $(BOE_CONTENT)/PkgInfo
echo 'APPLblx!' > $(BOE_CONTENT)/PkgInfo
cp -fp rsrc/icons/mac/BoE.icns $(BOE_CONTENT)/Resources/
cp -fp rsrc/icons/mac/boegraphics.icns $(BOE_CONTENT)/Resources/
cp -fp rsrc/icons/mac/boeresources.icns $(BOE_CONTENT)/Resources/
cp -fp rsrc/icons/mac/boesave.icns $(BOE_CONTENT)/Resources/
cp -fp rsrc/icons/mac/boesounds.icns $(BOE_CONTENT)/Resources/
cp -fp exe/bin/game.nib $(BOE_CONTENT)/Resources/
cp -Rfp exe/fwk/ $(BOE_CONTENT)/Frameworks/
pc-bundle: pc-menus frameworks src/pcedit/BoECharEd-Info.plist
mkdir -p $(PC_CONTENT)/MacOS
mkdir -p $(PC_CONTENT)/Contents
mkdir -p $(PC_CONTENT)/Resources
rm -rf $(PC_CONTENT)/Frameworks
mkdir -p $(PC_CONTENT)/Frameworks
cp -fp exe/bin/pced $(PC_CONTENT)/MacOS/'Blades of Exile Character Editor'
cp -fp src/pcedit/BoECharEd-Info.plist $(PC_CONTENT)/Info.plist
sed -Ei -e 's/\$$\{EXECUTABLE_NAME\}/Blades of Exile Character Editor/' $(PC_CONTENT)/Info.plist
rm -f $(PC_CONTENT)/PkgInfo
echo 'APPLblxe' > $(PC_CONTENT)/PkgInfo
cp -fp rsrc/icons/mac/BoECharEd.icns $(PC_CONTENT)/Resources/
cp -fp exe/bin/pcedit.nib $(PC_CONTENT)/Resources/
cp -Rfp exe/fwk/* $(PC_CONTENT)/Frameworks/
scen-bundle: scen-menus frameworks src/scenedit/BoEScenEd-Info.plist
mkdir -p $(SCEN_CONTENT)/MacOS
mkdir -p $(SCEN_CONTENT)/Contents
mkdir -p $(SCEN_CONTENT)/Resources
rm -rf $(SCEN_CONTENT)/Frameworks
mkdir -p $(SCEN_CONTENT)/Frameworks
cp -fp exe/bin/scened $(SCEN_CONTENT)/MacOS/'BoE Scenario Editor'
cp -fp src/scenedit/BoEScenEd-Info.plist $(SCEN_CONTENT)/Info.plist
sed -Ei -e 's/\$$\{EXECUTABLE_NAME\}/BoE Scenario Editor/' $(SCEN_CONTENT)/Info.plist
rm -f $(Scen_CONTENT)/PkgInfo
echo 'APPLBlEd' > $(SCEN_CONTENT)/PkgInfo
cp -fp rsrc/icons/mac/BoEScenEd.icns $(SCEN_CONTENT)/Resources/
cp -fp rsrc/icons/mac/boescenario.icns $(SCEN_CONTENT)/Resources/
cp -fp exe/bin/scenedit.nib $(SCEN_CONTENT)/Resources/
cp -Rfp exe/fwk/* $(SCEN_CONTENT)/Frameworks/

View File

@@ -10,6 +10,8 @@ LIB=/usr/local/lib
boost_lib=-lboost_filesystem -lboost_system -L$LIB
boost_include=-I/usr/local/include/boost
include $(PLATFORM).make
all: game pced scened
obj/gzstream.o: src/tools/gzstream/gzstream.cpp src/tools/gzstream/gzstream.h
@@ -66,11 +68,11 @@ exe/bin/pced: obj/common.o $(PC_SRC)
exe/bin/scened: obj/common.o $(ED_SRC)
$(CC) $(CFLAGS) $(CINCLUDES) $^ -o exe/bin/scened $(LIBFLAGS)
game: exe/bin/boe resources
game: exe/bin/boe resources game-bundle
pced: exe/bin/pced resources
pced: exe/bin/pced resources pc-bundle
scened: exe/bin/scened resources
scened: exe/bin/scened resources scen-bundle bases
resources: sounds.exa graphics.exd strings dialogs fonts scenarios shaders
@@ -85,17 +87,22 @@ graphics.exd:
cp -Rfp rsrc/graphics.exd 'exe/Blades of Exile/Scenario Editor/'
strings:
cp -Rfp rsrc/strings/ 'exe/Blades of Exile/data/'
mkdir -p 'exe/Blades of Exile/data/strings'
cp -fp rsrc/strings/*.txt 'exe/Blades of Exile/data/strings/'
dialogs:
mkdir -p 'exe/Blades of Exile/data/dialogs'
cp -fp rsrc/dialogs/*.xml 'exe/Blades of Exile/data/dialogs/'
fonts:
cp -Rfp rsrc/fonts/ 'exe/Blades of Exile/data/'
mkdir -p 'exe/Blades of Exile/data/fonts/'
cp -fp rsrc/fonts/*.ttf 'exe/Blades of Exile/data/fonts/'
scenarios:
cp -fp 'rsrc/Blades of Exile Scenarios'/*.{exs,meg} 'exe/Blades of Exile/Blades of Exile Scenarios/'
bases:
mkdir -p 'exe/Blades of Exile/Scenario Editor/Blades of Exile Base'
cp -fp 'rsrc/Blades of Exile Bases'/*.exs 'exe/Blades of Exile/Scenario Editor/Blades of Exile Base'
clean: