annotate mk-dist @ 2954:f0fe5698ee67

also strip exe files
author John W. Eaton <jwe@octave.org>
date Fri, 11 Jan 2013 12:57:08 -0500
parents 1afd21db3bf1
children dfa81fbfc1f5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 #! /bin/bash
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
3 set -e
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
4
2945
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
5 jobs=9
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
6
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
7 while [ $# -gt 0 ]; do
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
8 case "$1" in
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
9 --jobs)
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
10 shift
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
11 if [ $# -gt 0 ]; then
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
12 jobs=$1
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
13 shift
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
14 else
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
15 echo "mk-dist: expecting argument for --jobs option" 1>&2
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
16 exit 1
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
17 fi
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
18 ;;
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
19 *)
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
20 echo "mk-dist: unrecognized option: $1" 1>&2
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
21 exit 1
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
22 ;;
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
23 esac
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
24 done
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
25
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26 TOPDIR=$(pwd)
2945
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
27 PATH=$TOPDIR/usr/bin:$PATH
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
28 PREFIX=/usr
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29 TARGET=i686-pc-mingw32
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
30 BUILD=x86_64-unwknown-linux-gnu
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31 STRIP=$TARGET-strip
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33 echo "deleting previous dist directory..."
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 rm -rf dist
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35 mkdir -p dist/octave
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37 echo "building octave and dependencies..."
2945
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
38 make octave native-gcc native-binutils JOBS=$jobs
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
39
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
40 echo "copying files..."
2945
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
41 cd $TOPDIR/cross-tools/$TOPDIR/$PREFIX/$TARGET
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
42 find . -type f -o -type l | sed "s,./,," > $TOPDIR/excluded-gcc-files
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43 cd $TOPDIR/usr/$TARGET
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
44 tar -c -h -X $TOPDIR/excluded-gcc-files -f - . | ( cd $TOPDIR/dist/octave ; tar xpf - )
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
45
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
46 cat > $TOPDIR/excluded-native-files << EOF
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
47 ./$TARGET
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
48 ./bin/$TARGET-*.exe
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
49 EOF
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
50
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51 cd $TOPDIR/native-tools/usr
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
52 tar -c -h -X $TOPDIR/excluded-native-files -f - . | ( cd $TOPDIR/dist/octave ; tar xpf - )
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
53
2930
e7bd76ab0710 mk-dist script tweaks
John W. Eaton <jwe@octave.org>
parents: 2921
diff changeset
54 echo "making all files writable by user..."
e7bd76ab0710 mk-dist script tweaks
John W. Eaton <jwe@octave.org>
parents: 2921
diff changeset
55 chmod -R u+w $TOPDIR/dist/octave
e7bd76ab0710 mk-dist script tweaks
John W. Eaton <jwe@octave.org>
parents: 2921
diff changeset
56
e7bd76ab0710 mk-dist script tweaks
John W. Eaton <jwe@octave.org>
parents: 2921
diff changeset
57 echo "stripping files..."
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
58 cd $TOPDIR/dist/octave
2954
f0fe5698ee67 also strip exe files
John W. Eaton <jwe@octave.org>
parents: 2946
diff changeset
59 for f in $(find . -name '*.dll' -o -name '*.exe'); do
2930
e7bd76ab0710 mk-dist script tweaks
John W. Eaton <jwe@octave.org>
parents: 2921
diff changeset
60 echo " $f"
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
61 $STRIP $f
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
62 done
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
63
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
64 echo "creating tar file..."
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
65 cd $TOPDIR/dist
2954
f0fe5698ee67 also strip exe files
John W. Eaton <jwe@octave.org>
parents: 2946
diff changeset
66 #tar -c -j -f octave.tar.bz2 octave
f0fe5698ee67 also strip exe files
John W. Eaton <jwe@octave.org>
parents: 2946
diff changeset
67 zip -q -9 -r octave.zip octave