(Partial?) fix for building outside the source tree.
[cake.git] / scripts / makedist
blob72b81d40199a0a2ea95bd6b384c002d0bab997f9
1 #!/bin/bash
2 # be verbose:
3 # set -x
4 # Create a source archive plus binaries.
6 # Install:
7 # > mkdir .../dist
8 # > cvs -d ... checkout AROS
9 # > mv AROS AROS.source
10 # > ln -s AROS.source/scripts/makedist .
12 # Usage:
13 # - Update AROS.source if necessary:
14 # > cd .../dist/AROS.source ; cvs -z3 upd -dP
15 # > cd .../dist
16 # > ./makedist
17 # - Copy the files to some public place
20 rel=${rel-`date '+%Y%m%d'`}
21 fail=0
23 if [ -z "$dstdir" ]; then
24 dstdir=snapshots
26 if [ ! -d "$dstdir" ]; then
27 mkdir -p "$dstdir" || exit 1
30 if [ ! -f "$dstdir/AROS-source-$rel.tgz" ]; then
31 # Create source dist
32 rm -rf AROS
33 cp -a AROS.source AROS
34 find AROS -name CVS -prune -print0 | xargs -0 rm -r
35 tar cz --exclude="AROS/contrib*" -f "$dstdir/AROS-source-$rel.tgz" AROS
36 tar cz -f "$dstdir/AROS-contrib-$rel.tgz" AROS/contrib
39 if [ ! -f "$dstdir/AROS-lx86-bin-$rel.tgz" ]; then
40 # Build Linux/i386
41 rm -rf AROS
42 cp -a AROS.source AROS
44 cd AROS && \
45 autoconf && \
46 ./configure && \
47 make
48 ) >& "$dstdir/AROS-lx86-bin-$rel.log"
49 if [ $? -ne 0 ]; then
51 echo "Building Linux/i386 failed. See the complete log at"
52 echo "ftp://www.aros.org/pub/aros/snapshots/AROS-lx86-bin-$rel.log"
53 echo "..."
54 tail -50 "$dstdir/AROS-lx86-bin-$rel.log"
55 echo
56 echo
57 ) 1>&2
58 fail=1
59 else
60 tar czf "$dstdir/AROS-lx86-bin-$rel.tgz" AROS/bin/linux-i386/AROS
64 if [ ! -f "$dstdir/AROS-ibmpc-bin-$rel.tgz" ]; then
65 # Build Native/i386
66 rm -rf AROS
67 cp -a AROS.source AROS
69 #sed 's/ = yes/ = no/' make.defaults > make.opts
71 cd AROS && \
72 autoconf && \
73 ./configure --target=pc-i386 && \
74 make
75 ) >& "$dstdir/AROS-ibmpc-bin-$rel.log"
76 if [ $? -ne 0 ]; then
78 echo "Building Native/i386 failed. See the complete log at"
79 echo "ftp://www.aros.org/pub/aros/snapshots/AROS-ibmpc-bin-$rel.log"
80 echo "..."
81 tail -50 "$dstdir/AROS-ibmpc-bin-$rel.log"
82 echo
83 echo
84 ) 1>&2
85 fail=1
86 else
87 mv AROS/bin/pc-i386/AROS AROS/bin/pc-i386/AROS.bak
88 mkdir -p AROS/bin/pc-i386/AROS
89 cp AROS/bin/pc-i386/gen/rom/boot/aros-pc-i386.bin AROS/bin/pc-i386/AROS/Image
90 cp AROS/bin/pc-i386/gen/rom/boot/aros.map AROS/bin/pc-i386/AROS/Image.map
91 cp AROS/docs/README.native-i386 AROS/bin/pc-i386/AROS/
92 tar czf "$dstdir/AROS-ibmpc-bin-$rel.tgz" AROS/bin/pc-i386/AROS
93 rm -rf AROS/bin/pc-i386/AROS
94 mv AROS/bin/pc-i386/AROS.bak AROS/bin/pc-i386/AROS
98 if [ ! -f "$dstdir/AROS-DiskImage-$rel.log" ]; then
99 # Build Native/i386
101 #sed 's/ = yes/ = no/' make.defaults > make.opts
103 cd AROS && \
104 make contrib-disks
105 ) >& "$dstdir/AROS-DiskImage-$rel.log"
106 if [ $? -ne 0 ]; then
108 echo "Building DiskImages for Native/i386 failed. See the complete log at"
109 echo "ftp://www.aros.org/pub/aros/snapshots/AROS-DiskImage-$rel.log"
110 echo "..."
111 tail -50 "$dstdir/AROS-DiskImage-$rel.log"
112 echo
113 echo
114 ) 1>&2
115 fail=1
116 else
117 cp bin/pc-i386/gen/contrib-disks/*.img "$dstdir"
121 if [ $fail -eq 0 ]; then
122 echo "Whopee !! All builds were ok !"
125 exit $fail