1
1
#! /bin/bash
2
2
3
3
#
4
- # Build the json-fortran library and unit tests.
4
+ # NAME
5
+ # build.sh
5
6
#
6
- # Requires:
7
+ # DESCRIPTION
8
+ # Build the json-fortran library and unit tests.
9
+ #
10
+ # USAGE
11
+ # build.sh : build using gfortran
12
+ # build.sh -ifort : build using ifort
13
+ #
14
+ # REQUIRES
7
15
# FoBiS.py : https://github.com/szaghi/FoBiS [version 1.2.5 or later required]
8
16
# RoboDoc : http://rfsber.home.xs4all.nl/Robo/ [version 4.99.38 is the one tested]
9
17
#
10
- # Jacob Williams : 12/27/2014
18
+ # AUTHOR
19
+ # Jacob Williams : 12/27/2014
11
20
#
12
21
13
- # Set to 1 to use ifort, otherwise use gfortran
14
22
set -e
15
- use_ifort=0
16
23
17
24
PROJECTNAME=' jsonfortran' # project name for robodoc (example: jsonfortran_2.0.0)
18
25
DOCDIR=' ./documentation/' # build directory for documentation
@@ -23,8 +30,7 @@ LIBDIR='./lib/' # build directory for library
23
30
MODCODE=' json_module.f90' # json module file name
24
31
LIBOUT=' libjsonfortran.a' # name of json library
25
32
26
- if [ $use_ifort -eq 1 ]
27
- then
33
+ if [ " $1 " == " -ifort" ]; then
28
34
# Intel compiler
29
35
30
36
FCOMPILER=' Intel'
67
73
echo " Skip building the unit tests since \$ JF_SKIP_TESTS has been set to 'true'."
68
74
fi
69
75
70
- # build the documentation with RoboDoc:
71
- echo " "
72
- echo " Building documentation..."
73
- robodoc --rc ./robodoc.rc --src ${SRCDIR} --doc ${DOCDIR} --documenttitle ${PROJECTNAME}
76
+ # build the documentation with RoboDoc (if present):
74
77
echo " "
78
+ if hash robodoc 2> /dev/null; then
79
+ echo " Building documentation..."
80
+ robodoc --rc ./robodoc.rc --src ${SRCDIR} --doc ${DOCDIR} --documenttitle ${PROJECTNAME}
81
+ else
82
+ echo " ROBODoc not found! Cannot build documentation. ROBODoc can be installed from: http://www.xs4all.nl/~rfsber/Robo/"
83
+ fi
75
84
76
85
# Run all the tests unless $JF_SKIP_TESTS
77
- if [[ $JF_SKIP_TESTS != [yY]* ]]; then
86
+ echo " "
87
+ if [[ $JF_SKIP_TESTS != [yY]* ]] ; then
88
+ echo " Running tests..."
78
89
cd " $BINDIR "
79
90
rm jf_test* .o jf_test* .mod || true
80
91
OLD_IGNORES=" $GLOBIGNORE "
0 commit comments