1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
|
#!/bin/bash
export BASE=`pwd` # .../src/icmake
. buildscripts/try
# show usage if no arguments were used
if [ "$#" == "0" ] ; then
echo "
Usage: build <any argument>
Parser and scanner files generated by bisonc++ and flexc++ must already
be available (which holds true for the standard distribution)
Before calling this script './buildlib x' must have been called.
"
exit 0
fi
# check for the completion of ./prepare
if [ ! -e tmp/INSTALL.sh ] ; then
echo tmp/INSTALL.sh does not exist. Execute ./prepare to create it
exit 1
fi
# define the directory names and the std. variables (AUTHOR etc.)
. tmp/INSTALL.sh
# now BINDIR, SKELDIR, .... etc have been defined
# the @SKELDIR@ etc. names in icmbuild and icmstart are converted by
# ./install, calling scripts/convert
echo "
Constructed files are located under ./tmp
Final files are installed in the directories specified by tmp/INSTALL.sh
but may be stored elsewhere by ./install
"
# build icmake and its support programs
for target in spch multicmp comp dep exec pp un icmake icmbuild modmap
do
cd $target
./build || exit 1
cd ..
done
# icm_comp and other support binaries in tmp/usr/libexec/icmake
# icmbuild in tmp/usr/bin/icmbuild
# icmake in tmp/usr/bin/icmake
# install scripts to ./tmp
echo "./scripts to ./tmp/{icmbuild.in,icmstart.in}
"
# conversions of the .sh and .in files by ./install
cd scripts
cp icmstart.sh ../tmp/icmstart.sh
./catim ib <icmbuild.in >../tmp/icmbuild.in
./catim is <icmstart.in >../tmp/icmstart.in
cd ..
# cp the default skeleton files to tmp/usr/share/icmake
echo "default skeleton files in usr/share/icmake/ to tmp/usr/share/icmake
"
try cp -r usr/share/icmake/* tmp/usr/share/icmake/
# cp the config files in ./etc/icmake to tmp/etc/icmake
echo "configuration files in etc/icmake to tmp/etc/icmake
"
try cp -r etc/icmake/* tmp/etc/icmake/
# manpages: write the man pages in doc/ to tmp/usr/share/man/
cp doc/*.1 tmp/usr/share/man/man1
cp doc/*.7 tmp/usr/share/man/man7
# manpages: "compress the man-pages below tmp/usr/share/man/
echo "compress man-pages .1 in tmp/usr/share/man/man1
"
cd tmp/usr/share/man/man1
for x in *.1 ; do
gzip -9cn $x > $x.gz || exit 1
done
rm -f *.1
echo "compress man-pages .7 in tmp/usr/share/man/man7
"
cd ../man7
for x in *.7 ; do
gzip -9cn $x > $x.gz || exit 1
done
rm -f *.7
cd ${BASE}
# install the doc/icmake files
echo "compress changelog in tmp/usr/share/doc/icmake
"
gzip -9cn changelog > tmp/usr/share/doc/icmake/changelog.gz || exit 1
echo "cp examples files to tmp/usr/share/doc/icmake
"
try cp -r examples tmp/usr/share/doc/icmake
echo "cp rebuild script and friends to tmp/usr/share/doc/icmake/
"
try cp -r rebuild build2nd README.rebuild tmp/usr/share/doc/icmake
echo "cp ./etc files to tmp/etc
"
try cp -r etc tmp/
echo "
Next: call ./install all ***AS ROOT***
"
|