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