diff --git a/polymer/eduke32/Makefile.common b/polymer/eduke32/Makefile.common index f43aa8588..78c76b89b 100644 --- a/polymer/eduke32/Makefile.common +++ b/polymer/eduke32/Makefile.common @@ -5,6 +5,9 @@ # Use colored output PRETTY_OUTPUT ?= 1 +# Binary suffix override: +EXESUFFIX_OVERRIDE ?= + # DirectX SDK location - if nonempty, overrides the DXROOTs of the individual # Makefiles. Should be set to an absolute path since this Makefile is included # at different directory levels diff --git a/polymer/eduke32/build/Makefile b/polymer/eduke32/build/Makefile index 2d8a294a6..f3b92f158 100644 --- a/polymer/eduke32/build/Makefile +++ b/polymer/eduke32/build/Makefile @@ -315,6 +315,9 @@ clean: cleanutils: -rm -f $(UTILS) $(UTILOBJS) $(UTILADDOBJS) +printutils: + echo "$(UTILS)" + veryclean: clean cleanutils -rm -f $(ENGINELIB) $(EDITORLIB) diff --git a/polymer/eduke32/build/Makefile.shared b/polymer/eduke32/build/Makefile.shared index d3922c10e..a330b453c 100644 --- a/polymer/eduke32/build/Makefile.shared +++ b/polymer/eduke32/build/Makefile.shared @@ -230,6 +230,10 @@ ifneq (0,$(NEDMALLOC)) BUILDCFLAGS+= -DNEDMALLOC endif +ifneq ($(EXESUFFIX_OVERRIDE),) + EXESUFFIX=$(EXESUFFIX_OVERRIDE) +endif + ifeq ($(PRETTY_OUTPUT),1) BUILD_STARTED = printf "\033[K\033[1;36mBuild started using \"$(CC) $(OURCFLAGS) $(OURCONLYFLAGS) $(OURCXXFLAGS)\"\033[0m\n" BUILD_ECHOFLAGS = printf "\033[K\033[1;36mEnded compilation in this directory using \"$(CC) $(OURCFLAGS) $(OURCONLYFLAGS) $(OURCXXFLAGS)\"\033[0m\n" diff --git a/polymer/eduke32/osxbuild.sh b/polymer/eduke32/osxbuild.sh index d86aeabfe..a05e654a1 100755 --- a/polymer/eduke32/osxbuild.sh +++ b/polymer/eduke32/osxbuild.sh @@ -6,6 +6,7 @@ buildppc=1 build86=1 build64=1 +buildtools=0 builddebug=0 onlyzip=0 @@ -44,12 +45,16 @@ for i in $*; do build64=0 ;; + tools) + buildtools=1 + ;; + --debug=*) builddebug=${i#*=} ;; *) - echo usage: osxbuild [onlyzip] [noppc] [no86] [no64] [--debug=\<0\|1\>] + echo usage: osxbuild [onlyzip] [noppc] [no86] [no64] [tools] [--debug=\<0\|1\>] exit 1 ;; esac @@ -71,6 +76,109 @@ else vc=none fi +# Building the buildtools: +if [ $buildtools -eq 1 ] && [ -d "build" ]; then + cd build + + rm -f *{.x86,.x64,.ppc} + make veryclean + EXESUFFIX_OVERRIDE=.debug make veryclean + + if [ $build64 == 1 ]; then + if [ $builddebug == 1 ]; then + make veryclean + ARCH='-arch x86_64' EXESUFFIX_OVERRIDE=.debug.x64 OSX_STARTUPWINDOW=1 WITHOUT_GTK=1 RELEASE=0 BUILD32_ON_64=0 USE_LIBVPX=1 make -j 3 utils + if [ $? ]; then + echo buildtools: x86_64 debug build succeeded. + else + echo buildtools: x86_64 debug build failed. + fi + fi + + make veryclean + ARCH='-arch x86_64' EXESUFFIX_OVERRIDE=.x64 OSX_STARTUPWINDOW=1 WITHOUT_GTK=1 RELEASE=1 BUILD32_ON_64=0 USE_LIBVPX=1 make -j 3 utils + if [ $? ]; then + echo buildtools: x86_64 release build succeeded. + else + echo buildtools: x86_64 release build failed. + fi + fi + + if [ $build86 == 1 ]; then + if [ $builddebug == 1 ]; then + make veryclean + EXESUFFIX_OVERRIDE=.debug.x86 OSX_STARTUPWINDOW=1 WITHOUT_GTK=1 RELEASE=0 BUILD32_ON_64=1 USE_LIBVPX=0 make -j 3 utils + if [ $? ]; then + echo buildtools: x86 debug build succeeded. + else + echo buildtools: x86 debug build failed. + fi + fi + + make veryclean + EXESUFFIX_OVERRIDE=.x86 OSX_STARTUPWINDOW=1 WITHOUT_GTK=1 RELEASE=1 BUILD32_ON_64=1 USE_LIBVPX=0 make -j 3 utils + if [ $? ]; then + echo buildtools: x86 release build succeeded. + else + echo buildtools: x86 release build failed. + fi + fi + + if [ $buildppc == 1 ]; then + if [ $builddebug == 1 ]; then + make veryclean + ARCH='-arch ppc' EXESUFFIX_OVERRIDE=.debug.ppc OSX_STARTUPWINDOW=1 WITHOUT_GTK=1 RELEASE=0 BUILD32_ON_64=0 USE_LIBVPX=0 make -j 3 utils + if [ $? ]; then + echo buildtools: PowerPC debug build succeeded. + else + echo buildtools: PowerPC debug build failed. + fi + fi + + make veryclean + ARCH='-arch ppc' EXESUFFIX_OVERRIDE=.ppc OSX_STARTUPWINDOW=1 WITHOUT_GTK=1 RELEASE=1 BUILD32_ON_64=0 USE_LIBVPX=0 make -j 3 utils + if [ $? ]; then + echo buildtools: PowerPC release build succeeded. + else + echo buildtools: PowerPC release build failed. + fi + fi + + echo buildtools: Creating fat binaries. + utils=`make printutils` `EXESUFFIX_OVERRIDE=.debug make printutils` + for i in $utils; do + binaries= + for j in ${i}.{x86,x64,ppc}; do + if [ -f "$j" ]; then + binaries="$binaries $j" + fi + done + if [ -n "$binaries" ]; then + lipo -create $binaries -output $i + fi + done + + if [ -d "/opt/local/bin" ]; then + echo buildtools: Installing to MacPorts search path. + for i in $utils; do + if [ -f "$i" ]; then + cp -f "$i" "/opt/local/bin/" + fi + done + fi + + if [ -d "/usr/local/bin" ]; then + echo buildtools: Installing to Homebrew search path. + for i in $utils; do + if [ -f "$i" ]; then + cp -f "$i" "/usr/local/bin/" + fi + done + fi + + cd .. +fi + # The build process itself: if [ $onlyzip -eq 0 ]; then rm -f {eduke32,mapster32}{.debug,}{.x86,.x64,.ppc,}