forked from NOAA-EMC/UPP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compile
executable file
·40 lines (36 loc) · 1.13 KB
/
compile
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
#!/bin/bash
# Set current directory for easy navigation
TOPDIR=`pwd`
# The only arguments should be for the NCEP build; if that's the case
# then configure.upp is not necessary and will be ignored if it exists
if [ "$#" -eq 0 ]; then
if [ ! -e configure.upp ]; then
echo "ERR :: No configure.upp file => Do './configure' first"
exit 1
elif [ ! -s configure.upp ]; then
echo "ERR :: Empty configure.upp file => Do './configure' first"
exit 2
fi
echo "**** Compiling UPP and all libs ****"
MAKE=`awk '($1~/^MAKE/) {print substr($0,index($0,"=")+1) }' configure.upp`
MAKE=${MAKE:-make} # If above command returned nothing, set MAKE to "make"
cd $TOPDIR/sorc/comlibs
$MAKE
cd $TOPDIR/sorc/ncep_post.fd
$MAKE -f makefile_dtc
cd $TOPDIR
else
cd $TOPDIR/sorc
./build_ncep_post.sh $1
RETURN=$?
if [ "$RETURN" -ne 0 ]; then
echo "*******************************"
echo " "
echo "Unrecognized compile target $1."
echo " "
echo " For ncep_post, you must provide a valid machine name"
echo " "
echo "*******************************"
exit 1
fi
fi