Skip to content

Commit 9d264a2

Browse files
committed
added documentation build to sh script
1 parent b7444ac commit 9d264a2

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

build.sh

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
#
4-
# This is just a simple script to
5-
# build the json-fortran library and
6-
# example program on Linux and Mac.
4+
# This is just a simple script to build the json-fortran library and example program on Linux and Mac.
5+
#
6+
# It also builds the documentation using RoboDoc
77
#
88
# Jacob Williams : 2/8/2014
99
#
@@ -14,6 +14,7 @@
1414
SRCDIR='src/'
1515
BUILDDIR='lib/'
1616
BINDIR='bin/'
17+
DOCDIR='documentation/'
1718

1819
# Intel compiler
1920
FCOMPILER='ifort'
@@ -27,6 +28,7 @@ FCOMPILERFLAGS='-O2 -warn -stand f08 -diag-disable 7601 -traceback'
2728
FCMODULEPATHFLAG='-module '
2829

2930
# GFortran (must be >= 4.9)
31+
#FCOMPILER='gfortran'
3032
#FCOMPILER='/opt/local/bin/gfortran-mp-4.9'
3133
#FCOMPILERFLAGS='-O2 -fbacktrace -Wall -Wextra -Wno-maybe-uninitialized -pedantic -std=f2008'
3234
#FCMODULEPATHFLAG='-J'
@@ -46,19 +48,37 @@ EXEOUT='json'
4648
MODCODE='json_module'
4749
EXAMPLECODE='json_example'
4850

51+
ROBODOC='robodoc'
52+
ROBOFLAGS="--src ${SRCDIR} --doc ${DOCDIR} --multidoc --html --ignore_case_when_linking --syntaxcolors --source_line_numbers --index --tabsize 4"
53+
4954
#output directories:
5055
mkdir -p $BUILDDIR
5156
mkdir -p $BINDIR
57+
mkdir -p $DOCDIR
5258

5359
#clean build:
5460
rm -f $BUILDDIR$WC$OBJEXT
5561
rm -f $BUILDDIR$WC$MODEXT
5662
rm -f $BUILDDIR$WC$LIBEXT
63+
rm -rf $DOCDIR$WC
64+
65+
#
66+
# build library:
67+
#
5768

58-
#build library:
5969
$FCOMPILER $FCOMPILERFLAGS -c $SRCDIR$MODCODE$FEXT $FCMODULEPATHFLAG$BUILDDIR
6070
mv $MODCODE$OBJEXT $BUILDDIR
6171
$ARCHIVER $ARCHIVERFLAGS $BUILDDIR$LIBOUT$LIBEXT $BUILDDIR$MODCODE$OBJEXT
6272

63-
#build example:
73+
#
74+
# build example:
75+
#
76+
6477
$FCOMPILER $FCOMPILERFLAGS -o $BINDIR$EXEOUT $FCMODULEPATHFLAG$BUILDDIR $SRCDIR$EXAMPLECODE$FEXT $BUILDDIR$LIBOUT$LIBEXT
78+
79+
#
80+
# build documentation:
81+
#
82+
83+
$ROBODOC $ROBOFLAGS
84+

0 commit comments

Comments
 (0)