summaryrefslogtreecommitdiffstats
path: root/buildall.sh
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-10-27 19:51:19 +0000
committerH. Peter Anvin <hpa@zytor.com>2007-10-27 19:51:19 +0000
commit975e0c360f5ff154f3aefd82acf8f30e6e6f6476 (patch)
tree2792e4a72b4d81d9a1e304371f9a8c0f32feea9d /buildall.sh
downloadnasmbuild-975e0c360f5ff154f3aefd82acf8f30e6e6f6476.tar.gz
nasmbuild-975e0c360f5ff154f3aefd82acf8f30e6e6f6476.tar.xz
nasmbuild-975e0c360f5ff154f3aefd82acf8f30e6e6f6476.zip
Initial revision
Diffstat (limited to 'buildall.sh')
-rwxr-xr-xbuildall.sh129
1 files changed, 129 insertions, 0 deletions
diff --git a/buildall.sh b/buildall.sh
new file mode 100755
index 0000000..3bb6ebf
--- /dev/null
+++ b/buildall.sh
@@ -0,0 +1,129 @@
+#!/bin/bash -xe
+
+here=/home/nasmbuild/work
+snapdir=/pub/nasm/snapshots
+reldir=/pub/nasm/releasebuilds
+repo=/pub/git/nasm/nasm.git
+
+DOS4GW=/usr/share/openwatcom/binw/dos4gw.exe
+CWSDPMI=/home/nasmbuild/cwsdpmi
+READMES=/home/nasmbuild/readmes
+
+export PATH=/home/nasmbuild/bin:/bin:/usr/bin:/usr/local/bin
+
+cd $here
+
+build () {
+ version="$1"
+ outdir="$2"
+ gitdir="$3"
+ rev="$4"
+
+ cpus=$(grep '^processor' < /proc/cpuinfo | wc -l)
+ jobs=$((cpus+2))
+ makej="make -j$jobs"
+
+ rm -rf nasm-* win32 dos os2 rpmbuild
+ mkdir -p rpmbuild/{BUILD,RPMS,SRPMS,SPECS,SOURCES}
+
+ ( cd "$gitdir" && ./misc/release $version $here )
+ do32 rpmbuild --target i386 -ta nasm-$version.tar.bz2
+ rpmbuild --target x86_64 -ta nasm-$version.tar.bz2
+
+ tar xfj nasm-$version.tar.bz2
+ tar xfj nasm-$version-xdoc.tar.bz2
+
+ mkdir -p win32
+ cp -a nasm-$version win32
+ cd win32/nasm-$version
+ LDFLAGS='-s' ./configure --host=i386-mingw32
+ $makej
+ cd ..
+ zip -9Dl ../nasm-$version-win32.zip nasm-$version/COPYING
+ zip -9Drg ../nasm-$version-win32.zip nasm-$version -i \*.exe
+ cd ..
+
+ mkdir -p dos
+ cp -a nasm-$version dos
+ cd dos/nasm-$version
+ LDFLAGS='-s' ./configure --host=i586-pc-msdosdjgpp
+ $makej
+ find . -name \*.exe -type f -print0 | xargs -0r time upx -q --ultra-brute
+ mv doc/nasmdoc.txt .
+ cp $READMES/dos README
+ cp $CWSDPMI/bin/cwsdpmi.{exe,doc} .
+ cd ..
+ zip -9Dl ../nasm-$version-dos.zip nasm-$version/{COPYING,README,nasmdoc.txt,cwsdpmi.doc}
+ zip -9Drg ../nasm-$version-dos.zip nasm-$version -i \*.exe
+ cd ..
+
+ mkdir -p os2
+ cp -a nasm-$version os2
+ cd os2/nasm-$version
+ make -f Mkfiles/owlinux.mak os2
+ cd ..
+ zip -9Dl ../nasm-$version-os2.zip nasm-$version/COPYING
+ zip -9Drg ../nasm-$version-os2.zip nasm-$version -i \*.exe
+ cd ..
+
+ rm -rf "$gitdir" nasm-$version
+
+ mkdir -p "$outdir"
+ echo "$rev" > "$outdir"/git.id
+ mv -f nasm-${version}*.tar.* nasm-${version}*.zip "$outdir"
+ find rpmbuild -name \*.rpm -exec mv -f '{}' "$outdir" \;
+
+ echo "$version" "$rev" >> build-ids
+}
+
+rm -rf git git-rel
+
+today=$(date +%Y%m%d)
+
+git clone -s -l $repo git
+HEAD=$(cd git && git rev-parse HEAD)
+
+#
+# Test run?
+#
+if [ x"$1" = xtest ]; then
+ rm -rf /var/tmp/nasmtest
+ build $(cat git/version)-test /var/tmp/nasmtest git "$HEAD"
+ exit 0
+fi
+
+#
+# Tagged releases...
+#
+(cd git && git tag) | while read tag; do
+ : $tag
+ case "$tag" in
+ nasm-0.99.0[5-9]|nasm-0.99.[1-9]*|nasm-[1-9]*)
+ rel_version=$(echo "$tag" | sed -e 's/^nasm-//')
+ if [ ! -d "$reldir"/"$rel_version" ]; then
+ git clone -s -l -n git git-rel
+ ( cd git-rel && git checkout "$tag" )
+ tagref=$(cd git-rel && git rev-parse "$tag")
+ build "$rel_version" "$reldir"/"$rel_version" git-rel "$tagref"
+ fi
+ ;;
+ esac
+done
+
+#
+# Daily snapshot...
+#
+if [ x$HEAD = x$(cat LAST_HEAD) ]; then
+ exit 0
+fi
+if [ -d "$snapdir"/$today ]; then
+ # We already did a build today...
+ exit 0
+fi
+
+snap_version=$(cat git/version)-$today
+build "$snap_version" "$snapdir"/$today git "$HEAD"
+
+echo "$HEAD" > LAST_HEAD
+
+( cd $snapdir && rm -f latest && ln -s $today latest )