view build.sh @ 38:ea2d19de8932

Improve package building process.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 13 Oct 2012 16:58:29 +0300
parents fcca32ea1ca8
children 554e3f02ba6f
line wrap: on
line source

#!/bin/sh
. ./build.cfg
CPWD=`pwd`

for build in amd:k8 intel:core2; do
	# Split into platform and march
	platform=`echo "$build"|cut -d ':' -f 1`
	march=`echo "$build"|cut -d ':' -f 2`
	
	# Build Unix binary
	make -f Makefile clean
	make -f Makefile EXTRA_CFLAGS="-march=$march" EXEEXT=".bin" BINPATH="$CPWD/"
	(strip "$CPWD/${CEXE}.bin" && mv "$CPWD/${CEXE}.bin" "$CPWD/${CBINPATH}${CEXE}-${platform}-linux32.bin") || exit 1

	# Build Win32 executable
	make -f Makefile.w32 clean
	make -f Makefile.w32 EXTRA_CFLAGS="-march=$march" EXEEXT=".exe" BINPATH="$CPWD/"
	(mv "$CPWD/${CEXE}.exe" "$CPWD/${CBINPATH}${CEXE}_${platform}_win32.exe") || exit 1
done

(cd "$CPWD" && exec ./build-data.sh) || exit 1

rm -f "$CPWD/$CZIP"

cd "$CPWD/${CBINPATH}" && zip -9 "$CPWD/$CZIP" *