From 5bac93f5b37f6ae091e63aefd0f2da4def0dfd49 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 28 Sep 2009 16:26:07 +0200 Subject: Start tracking XSD dependency information with git --- build.sh | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100755 build.sh (limited to 'build.sh') diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..cdc1bd2 --- /dev/null +++ b/build.sh @@ -0,0 +1,117 @@ +#! /usr/bin/env bash + +trap 'exit 1' ERR + +build=build +libcult=libcult +libfe=libfrontend-elements +libbe=libbackend-elements +libxsd_fe=libxsd-frontend +xsd=xsd + +pwd=`pwd` + +MAKEFLAGS="-I$pwd/stage/include $MAKEFLAGS" + +target=$1 + +if [ "$target" = "install" ]; then + # Since we only want to install XSD, we will handle + # this target at the end. + target= +fi + + +# build +# +if [ ! -d $pwd/stage/include/build-* ]; then + make -C $build install_prefix=$pwd/stage install +fi + + +# libcult +# +make $MAKEFLAGS -C $libcult/cult $target + +if [ "$target" = "clean" ]; then + rm -f $pwd/stage/include/cult + rm -f $pwd/stage/lib/libcult.a + rm -f $libcult/build/system/configuration-dynamic.make +else + if [ ! -d $pwd/stage/include/cult ]; then + ln -s ../../$libcult/cult stage/include/ + ln -s ../../$libcult/cult/libcult.a stage/lib/ + fi +fi + + +# libfrontend-elements +# +make $MAKEFLAGS -C $libfe/frontend-elements $target + +if [ "$target" = "clean" ]; then + rm -f $pwd/stage/include/frontend-elements + rm -f $pwd/stage/lib/libfrontend-elements.a +else + if [ ! -d $pwd/stage/include/frontend-elements ]; then + ln -s ../../$libfe/frontend-elements stage/include/ + ln -s ../../$libfe/frontend-elements/libfrontend-elements.a stage/lib/ + fi +fi + + +# libbackend-elements +# +make $MAKEFLAGS -C $libbe/backend-elements $target + +if [ "$target" = "clean" ]; then + rm -f $pwd/stage/include/backend-elements +else + if [ ! -d $pwd/stage/include/backend-elements ]; then + ln -s ../../$libbe/backend-elements stage/include/ + fi +fi + + +# libxsd-frontend +# +make $MAKEFLAGS -C $libxsd_fe/xsd-frontend $target + +if [ "$target" = "clean" ]; then + rm -f $pwd/stage/include/xsd-frontend + rm -f $pwd/stage/lib/libxsd-frontend.a +else + if [ ! -d $pwd/stage/include/xsd-frontend ]; then + ln -s ../../$libxsd_fe/xsd-frontend stage/include/ + ln -s ../../$libxsd_fe/xsd-frontend/libxsd-frontend.a stage/lib/ + fi +fi + + +# xsd +# +if [ "$target" = "clean" ]; then + make $MAKEFLAGS -C $xsd clean +else + make $MAKEFLAGS -C $xsd/xsd $target +fi + +if [ "$target" = "clean" ]; then + rm -f $pwd/stage/include/xsd + rm -f $pwd/stage/bin/xsd +else + if [ ! -d $pwd/stage/include/xsd ]; then + ln -s ../../$xsd/libxsd/xsd stage/include/ + ln -s ../../$xsd/xsd/xsd stage/bin/ + fi +fi + +if [ "$1" = "install" ]; then +make $MAKEFLAGS -C $xsd install +fi + +# build (clean) +# +if [ "$target" = "clean" ]; then + rm -rf $pwd/stage/include/build-* +fi -- cgit v1.1