Mercurial > mxe-octave
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 |
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 |
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 | 10 while [ $# -gt 0 ]; do |
11 case "$1" in | |
12 --jobs) | |
13 shift | |
14 if [ $# -gt 0 ]; then | |
15 jobs=$1 | |
16 shift | |
17 else | |
18 echo "mk-dist: expecting argument for --jobs option" 1>&2 | |
19 exit 1 | |
20 fi | |
21 ;; | |
2957 | 22 --stable) |
23 OCTAVE_TARGET=stable-octave | |
24 shift | |
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 | 30 *) |
31 echo "mk-dist: unrecognized option: $1" 1>&2 | |
32 exit 1 | |
33 ;; | |
34 esac | |
35 done | |
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 | 38 PATH=$TOPDIR/usr/bin:$PATH |
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 | 51 make $OCTAVE_TARGET msys-base native-gcc native-binutils octave-forge-packages npp JOBS=$jobs |
2945 | 52 |
2956 | 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 | 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 | 61 echo " gcc cross compiler files..." |
62 cd $TOPDIR/cross-tools/$TOPDIR/$PREFIX/$TARGET | |
63 find . -type f -o -type l | sed "s,./,," > $TOPDIR/excluded-gcc-files | |
64 | |
65 echo "copying files..." | |
66 | |
67 echo " octave and dependencies..." | |
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 | 71 |
2965 | 72 echo " octaverc file..." |
73 cp $TOPDIR/octaverc $OCTAVE_DIST_DIR/share/octave/site/m/startup/octaverc | |
74 | |
2956 | 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 | 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 | 81 cp lib/gcc/i686-pc-mingw32/libgcc_s_dw2-1.dll bin |
82 | |
83 echo " msys base files..." | |
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 | 86 |
2964 | 87 echo " notepad++..." |
88 cd $TOPDIR | |
89 tar -c -h -f - notepad++ | ( cd $OCTAVE_DIST_DIR ; tar xpf - ) | |
90 cp $TOPDIR/build_packages.m $OCTAVE_DIST_DIR/src | |
91 | |
2930 | 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 | 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 | 104 #echo "creating tar file..." |
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 | 107 |
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 |