11#! /bin/bash
22
33#
4- # Build the json-fortran library and unit tests.
4+ # NAME
5+ # build.sh
56#
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
715# FoBiS.py : https://github.com/szaghi/FoBiS [version 1.2.5 or later required]
816# RoboDoc : http://rfsber.home.xs4all.nl/Robo/ [version 4.99.38 is the one tested]
917#
10- # Jacob Williams : 12/27/2014
18+ # AUTHOR
19+ # Jacob Williams : 12/27/2014
1120#
1221
13- # Set to 1 to use ifort, otherwise use gfortran
1422set -e
15- use_ifort=0
1623
1724PROJECTNAME=' jsonfortran' # project name for robodoc (example: jsonfortran_2.0.0)
1825DOCDIR=' ./documentation/' # build directory for documentation
@@ -23,8 +30,7 @@ LIBDIR='./lib/' # build directory for library
2330MODCODE=' json_module.f90' # json module file name
2431LIBOUT=' libjsonfortran.a' # name of json library
2532
26- if [ $use_ifort -eq 1 ]
27- then
33+ if [ " $1 " == " -ifort" ]; then
2834 # Intel compiler
2935
3036 FCOMPILER=' Intel'
6773 echo " Skip building the unit tests since \$ JF_SKIP_TESTS has been set to 'true'."
6874fi
6975
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):
7477echo " "
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
7584
7685# 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..."
7889 cd " $BINDIR "
7990 rm jf_test* .o jf_test* .mod || true
8091 OLD_IGNORES=" $GLOBIGNORE "
0 commit comments