JPRED-2 Add alscript to the Git repository
[jpred.git] / sources / alscript / build
1 #!/bin/csh
2 #  csh script to compile the elements of alscript
3 #  
4 #  type ./build <machine>
5 #
6 #  e.g.  ./build sun  or ./build sgi or ./build gcc
7 #
8 # ./build linux
9 #
10 #  Note that BUILD linux should also work under cygwin, though 
11 #  you will need to add --unix to the make arguments.
12 #  In release 2.07 the cygwin binaries are included in the distribution.
13 #
14 #  This script will create a subdirectory /bin if it does not 
15 #  already exist.  It will then create a subsub directory /bin/machine
16 #  where executables for the architecture will be stored.
17 #
18 #  You should then add this directory to your path, or add links
19 #  from a directory that is on your path (e.g. /usr/local/bin) 
20
21 echo ""
22 echo "Trying to build alscript for $1"
23 echo ""
24 if(! -e bin) then
25   echo "Creating bin directory"
26   mkdir bin
27 endif
28 if(! -e bin/$1) then
29   echo  "Creating subdirectory bin/$1"
30   mkdir bin/$1
31 endif
32 if(-e src/alscript.o) then
33         echo "Deleting old object files"
34         /bin/rm src/*.o
35 endif
36 echo "Copying Makefile"
37 /bin/cp src/makefile.$1 src/makefile
38 echo "Attempting make"
39 make -C src
40 echo ""
41 echo "Moving executables to bin directory"
42 echo ""
43 /bin/mv src/alscript bin/$1
44 /bin/mv src/msf2blc bin/$1
45 /bin/mv src/clus2blc bin/$1
46 /bin/mv src/fast2blc bin/$1
47 /bin/mv src/alsnum bin/$1
48 echo ""
49 echo "Deleting object files"
50 echo ""
51 /bin/rm src/*.o gjutil/*.o
52 echo ""
53 echo " All should be complete!"
54 echo ""