annotate mk-dist @ 2988:aca8511e7751

qt.mk: link to correct files in bin directory
author John W. Eaton <jwe@octave.org>
date Thu, 16 May 2013 13:32:57 -0400
parents eb1643bd900c
children 4b450c162e39
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
2957
0c4eab3a7903 mk-dist: --stable option
John W. Eaton <jwe@octave.org>
parents: 2956
diff changeset
7 OCTAVE_TARGET=octave
2987
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
8
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
9 strip=yes
2945
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
10 while [ $# -gt 0 ]; do
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
11 case "$1" in
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
12 --jobs)
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 if [ $# -gt 0 ]; then
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
15 jobs=$1
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
16 shift
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
17 else
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
18 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
19 exit 1
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
20 fi
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
21 ;;
2957
0c4eab3a7903 mk-dist: --stable option
John W. Eaton <jwe@octave.org>
parents: 2956
diff changeset
22 --stable)
0c4eab3a7903 mk-dist: --stable option
John W. Eaton <jwe@octave.org>
parents: 2956
diff changeset
23 OCTAVE_TARGET=stable-octave
0c4eab3a7903 mk-dist: --stable option
John W. Eaton <jwe@octave.org>
parents: 2956
diff changeset
24 shift
0c4eab3a7903 mk-dist: --stable option
John W. Eaton <jwe@octave.org>
parents: 2956
diff changeset
25 ;;
2987
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
26 --no-strip)
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
27 strip=no
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
28 shift
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
29 ;;
2945
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
30 *)
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
31 echo "mk-dist: unrecognized option: $1" 1>&2
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
32 exit 1
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
33 ;;
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
34 esac
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
35 done
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
36
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37 TOPDIR=$(pwd)
2945
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
38 PATH=$TOPDIR/usr/bin:$PATH
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
39 PREFIX=/usr
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
40 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
41 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
42 STRIP=$TARGET-strip
2962
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
43 DATE=$(date +%Y-%m-%d-%H-%M)
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
44 OCTAVE_DIST_DIR=$TOPDIR/dist/$OCTAVE_TARGET-$DATE
2921
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 echo "deleting previous dist directory..."
2962
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
47 rm -rf $TOPDIR/dist
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
48 mkdir -p $OCTAVE_DIST_DIR
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
49
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
50 echo "building octave and dependencies..."
2964
1955438b24dc get notepad++
John W. Eaton <jwe@octave.org>
parents: 2962
diff changeset
51 make $OCTAVE_TARGET msys-base native-gcc native-binutils octave-forge-packages npp JOBS=$jobs
2945
92d86e3e9173 improve mk-dist script
John W. Eaton <jwe@octave.org>
parents: 2930
diff changeset
52
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
53 echo "generating lists of files to exclude..."
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
54
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
55 echo " native files..."
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
56 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
57 ./$TARGET
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
58 ./bin/$TARGET-*.exe
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
59 EOF
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
60
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
61 echo " gcc cross compiler files..."
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
62 cd $TOPDIR/cross-tools/$TOPDIR/$PREFIX/$TARGET
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
63 find . -type f -o -type l | sed "s,./,," > $TOPDIR/excluded-gcc-files
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
64
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
65 echo "copying files..."
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
66
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
67 echo " octave and dependencies..."
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
68 cd $TOPDIR/usr/$TARGET
2962
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
69 tar -c -h -X $TOPDIR/excluded-gcc-files -f - . | ( cd $OCTAVE_DIST_DIR ; tar xpf - )
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
70 cp $TOPDIR/build_packages.m $OCTAVE_DIST_DIR/src
2957
0c4eab3a7903 mk-dist: --stable option
John W. Eaton <jwe@octave.org>
parents: 2956
diff changeset
71
2965
d35eda9fb1f3 octaverc file
John W. Eaton <jwe@octave.org>
parents: 2964
diff changeset
72 echo " octaverc file..."
d35eda9fb1f3 octaverc file
John W. Eaton <jwe@octave.org>
parents: 2964
diff changeset
73 cp $TOPDIR/octaverc $OCTAVE_DIST_DIR/share/octave/site/m/startup/octaverc
d35eda9fb1f3 octaverc file
John W. Eaton <jwe@octave.org>
parents: 2964
diff changeset
74
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
75 echo " native tools..."
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
76 cd $TOPDIR/native-tools/usr
2962
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
77 tar -c -h -X $TOPDIR/excluded-native-files -f - . | ( cd $OCTAVE_DIST_DIR ; tar xpf - )
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
78
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
79 echo " libgcc_s_dw2-1.dll to bin directory"
2962
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
80 cd $OCTAVE_DIST_DIR
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
81 cp lib/gcc/i686-pc-mingw32/libgcc_s_dw2-1.dll bin
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
82
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
83 echo " msys base files..."
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
84 cd $TOPDIR/msys-base
2962
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
85 tar -c -h -f - . | ( cd $OCTAVE_DIST_DIR ; tar xpf - )
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
86
2964
1955438b24dc get notepad++
John W. Eaton <jwe@octave.org>
parents: 2962
diff changeset
87 echo " notepad++..."
1955438b24dc get notepad++
John W. Eaton <jwe@octave.org>
parents: 2962
diff changeset
88 cd $TOPDIR
1955438b24dc get notepad++
John W. Eaton <jwe@octave.org>
parents: 2962
diff changeset
89 tar -c -h -f - notepad++ | ( cd $OCTAVE_DIST_DIR ; tar xpf - )
1955438b24dc get notepad++
John W. Eaton <jwe@octave.org>
parents: 2962
diff changeset
90 cp $TOPDIR/build_packages.m $OCTAVE_DIST_DIR/src
1955438b24dc get notepad++
John W. Eaton <jwe@octave.org>
parents: 2962
diff changeset
91
2930
e7bd76ab0710 mk-dist script tweaks
John W. Eaton <jwe@octave.org>
parents: 2921
diff changeset
92 echo "making all files writable by user..."
2962
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
93 chmod -R u+w $OCTAVE_DIST_DIR
2930
e7bd76ab0710 mk-dist script tweaks
John W. Eaton <jwe@octave.org>
parents: 2921
diff changeset
94
2987
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
95 if [ $strip = "yes" ]; then
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
96 echo "stripping files..."
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
97 cd $OCTAVE_DIST_DIR
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
98 for f in $(find . -name '*.dll' -o -name '*.exe'); do
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
99 echo " $f"
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
100 $STRIP $f
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
101 done
eb1643bd900c mk-dist: new argument, --no-strip
John W. Eaton <jwe@octave.org>
parents: 2965
diff changeset
102 fi
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
103
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
104 #echo "creating tar file..."
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
105 #cd $TOPDIR/dist
2962
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
106 #tar -c -j -f $OCTAVE_TARGET-$DATE.tar.bz2 $OCTAVE_TARGET-$DATE
2956
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
107
dfa81fbfc1f5 msys binary packages
John W. Eaton <jwe@octave.org>
parents: 2954
diff changeset
108 echo "creating zip file..."
2921
f129bd6b8d6b script for building a tar.bz2 file with Octave and dependncies
John W. Eaton <jwe@octave.org>
parents:
diff changeset
109 cd $TOPDIR/dist
2962
486c081fd0b5 mk-dist: create octave file with date info
John W. Eaton <jwe@octave.org>
parents: 2958
diff changeset
110 zip -q -9 -r $OCTAVE_TARGET-$DATE.zip $OCTAVE_TARGET-$DATE