From d6c873d91dfacc6b597a7450a464f933ce7452e9 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Mon, 15 Jun 2015 16:22:28 -0400 Subject: [PATCH 1/4] Add makefile outputs to gitignore --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index fc14d263..2eed034d 100644 --- a/.gitignore +++ b/.gitignore @@ -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 From 76af8ecc19ded8fc2d2b7a944e0371cc232b409b Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Mon, 15 Jun 2015 19:28:33 -0400 Subject: [PATCH 2/4] Add platform flag to makefile and code for compiling xibs --- build.sh | 4 +++- macosx.make | 10 ++++++++++ makefile | 8 +++++--- 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 macosx.make diff --git a/build.sh b/build.sh index 188a3e29..5a4c0cc9 100755 --- a/build.sh +++ b/build.sh @@ -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]" } @@ -50,7 +52,7 @@ function build { mkdir -p 'exe/Blades of Exile/Blades of Exile Scenarios/' mkdir -p 'exe/Blades of Exile/Scenario Editor/Blades of Exile Base' 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 } diff --git a/macosx.make b/macosx.make new file mode 100644 index 00000000..220824f1 --- /dev/null +++ b/macosx.make @@ -0,0 +1,10 @@ + +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 + diff --git a/makefile b/makefile index a733c435..4c9e87be 100644 --- a/makefile +++ b/makefile @@ -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-menus -pced: exe/bin/pced resources +pced: exe/bin/pced resources pc-menus -scened: exe/bin/scened resources +scened: exe/bin/scened resources scen-menus resources: sounds.exa graphics.exd strings dialogs fonts scenarios shaders From 4d9ec53b8b0b6d457617c776898d89fc5844c750 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Mon, 15 Jun 2015 19:54:16 -0400 Subject: [PATCH 3/4] Separate Blades of Exile Base from the scenarios target, as it's not needed for anything other than the scenario editor --- build.sh | 2 +- makefile | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 5a4c0cc9..5f4e485e 100755 --- a/build.sh +++ b/build.sh @@ -50,7 +50,7 @@ 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 PLATFORM make all diff --git a/makefile b/makefile index 4c9e87be..08f16958 100644 --- a/makefile +++ b/makefile @@ -72,7 +72,7 @@ game: exe/bin/boe resources game-menus pced: exe/bin/pced resources pc-menus -scened: exe/bin/scened resources scen-menus +scened: exe/bin/scened resources scen-menus bases resources: sounds.exa graphics.exd strings dialogs fonts scenarios shaders @@ -98,6 +98,9 @@ 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: From 24c124c79fa63766f021973ac81d29c1697e7d6a Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Wed, 17 Jun 2015 16:54:15 -0400 Subject: [PATCH 4/4] Add bundling stage to makefile --- macosx.make | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++ makefile | 12 ++++++----- 2 files changed, 68 insertions(+), 5 deletions(-) diff --git a/macosx.make b/macosx.make index 220824f1..d6fbbcbe 100644 --- a/macosx.make +++ b/macosx.make @@ -1,4 +1,8 @@ +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 $@ $< @@ -8,3 +12,60 @@ 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/ diff --git a/makefile b/makefile index 08f16958..06adaa3e 100644 --- a/makefile +++ b/makefile @@ -68,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-menus +game: exe/bin/boe resources game-bundle -pced: exe/bin/pced resources pc-menus +pced: exe/bin/pced resources pc-bundle -scened: exe/bin/scened resources scen-menus bases +scened: exe/bin/scened resources scen-bundle bases resources: sounds.exa graphics.exd strings dialogs fonts scenarios shaders @@ -87,14 +87,16 @@ 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/'