Makefile cleaup
[thunix.git] / release.sh
blob0f4df39b63413eb42776fabc1d53da90012080bc
1 #!/bin/sh
4 # make release package
7 repo_dir=`pwd`
8 tmp_dir=`mktemp -d`
10 if ! (cd $repo_dir; git diff >/dev/null 2>&1); then
11 echo "Please run this script inside the thunix git repo" 1>&2
12 exit 1
15 version=`cat version`
17 function build_clean()
19 make && make clean
24 cd $tmp_dir
25 git clone $repo_dir
26 echo -n "build for release... "
27 (cd ${repo_dir##*/}; build_clean >/dev/null 2>&1 && mv *.img image/)
28 echo "[ DONE ]"
29 echo -n "creating release tar package... "
30 tar --exclude-vcs -cjf thunix-$version.tar.bz2 thunix
31 tar --exclude-vcs -cf thunix-$version.tar.gz thunix
32 echo "[ DONE ]"
35 [ ! -d release ] && rm -rf release && mkdir release
36 cp ${tmp_dir}/{*.bz2,*.gz} release/
37 rm -rf $tmp_dir