osxbuild.sh: new "tools" parameter builds the Build tools in addition to the full binaries

Makefiles: new features to facilitate above:
 - buildtools: "make printutils" is a phony which simply lists all the tools
 - $(EXESUFFIX_OVERRIDE)

git-svn-id: https://svn.eduke32.com/eduke32@2476 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2012-03-14 06:27:45 +00:00
parent 7b76865aaa
commit 5e19a48754
4 changed files with 119 additions and 1 deletions

View file

@ -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

View file

@ -315,6 +315,9 @@ clean:
cleanutils:
-rm -f $(UTILS) $(UTILOBJS) $(UTILADDOBJS)
printutils:
echo "$(UTILS)"
veryclean: clean cleanutils
-rm -f $(ENGINELIB) $(EDITORLIB)

View file

@ -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"

View file

@ -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,}