Commits

Harald Klimach committed 62df648

Let doxygen run in waf

Comments (0)

Files changed (5)

 # If a relative path is entered, it will be relative to the location 
 # where doxygen was started. If left blank the current directory will be used.
 
-OUTPUT_DIRECTORY       = Documentation
+# Use "./waf doxy" to build the documentation, in this case, the output
+# directory will be set by waf!
+#OUTPUT_DIRECTORY       = Documentation
 
 # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
 # 4096 sub-directories (in 2 levels) under the output directory of each output 

README

-= AOTUS =
-The AOTUS library provides a wrapper around the
-C-API of the Lua scripting language, allowing a
-convenient usage of Lua scripts as
-configuration files in Fortran applications.
-Please have look at the Wiki at
-https://bitbucket.org/haraldkl/aotus/wiki/Home
-for usage informations.
-
-This library is released under a simplified MIT
-licence, please have look at the COPYRIGHT file
-for details.
-
-= How To Build =
-Run
-
-./waf configure build
-
-to build the aotus library.
-If you want to select a specific Fortran compiler,
-set the environment variable FC.
-And for a specific C compiler the environment
-variable CC.
-
-
-= What is Built =
-For your convenience the lua library is included in
-version 5.2.0 (released 2011-12-16),
-its objects are completely gathered into the final
-libaotus library, so it is only necessary to link
-against this single static library to gain the
-configuration features of aotus in your Fortran
-application.
-
-= Example =
-There is an example program built, called aotus_test,
-which you will find in the "build" directory, and
-use with the provided config.lua in the "test"
-directory, where also the source is found.
-
-= Related Projects =
-Some projects with similar goals or related information:
-* f2k3-lua at https://github.com/MaikBeckmann/f2k3-lua/tree/simple
-* FortLua at https://github.com/adolgert/FortLua
 If you want to select a specific Fortran compiler, set the environment variable
 *FC*.
 And for a specific C compiler, set the environment variable *CC*.
+The Fortran compiler flags are set with the help of fc_flags, which provide
+a set of compiler flag combinations for various compilers.
+They are found in the waflib/extras directory, and the waflib directory is
+created upon execution of waf in a::
+
+.waf-*
+
+directory, if you need to have a look at them.
 
 
 What is Built
 Its objects are completely gathered into the final *libaotus* library, so it is
 only necessary to link against this single static library to gain the
 configuration features of aotus in your Fortran application.
+Due to the compiler specific module informations required by any application
+using the libaotus, the suggested approach to incorporate libaotus is to include
+its building in the build process of the final application. This is straight
+forward if waf is used for the complete project. But also in other build
+environments it should not be too hard to make use of the generated *build*
+directory.
+Yet if you would rather install the *libaotus.a* and the module files into a
+*$PREFIX* directory, you can make use of::
+
+./waf install
+
+The doxygen documentation can be built by running::
+
+./waf doxy
+
+This will build a html directory in the build directory with the resulting
+documentation. Note, that this requires an installed doxygen.
 
 Example
 -------
 
-There is an example program built, called aotus_test, which you will find in the
-*build* directory.
+There is an example program built, called aotus_sample, which you will find in
+the *build* directory.
 It can be used with the provided *config.lua* in the *test* directory, where
 also the source of this small program is found.
 

source/aotus_module.f90

-!> This module provides high level Fortran interfaces
-!! to retrieve values from a Lua script.
+!> This module provides high level Fortran interfaces to retrieve values from a
+!! Lua script.
+!!
+!! Its central interface is aot_get_val, which is a generic interface that
+!! allows access to scalars and vectors in global Lua variables as well as
+!! nested tables.
 module aotus_module
   use flu_binding
   use aot_kinds_module, only: double_k, single_k, long_k
     opt.load('compiler_c')
 
 def configure(conf):
+    from waflib import Logs
     # The fcopts provide some sane flag combinations
     # for different variants in the various compilers.
     # They are found in apes/sys_env, and included in
     # Load the compiler informations
     conf.load('compiler_fc')
     conf.load('compiler_c')
+    conf.env.stash()
+    try:
+        conf.load('doxygen')
+    except conf.errors.ConfigurationError, e:
+        Logs.debug('doxygen: %r' % e)
+        conf.env.revert()
+
     conf.env['FCSTLIB_MARKER'] = ''
     conf.env['FCSHLIB_MARKER'] = ''
-    # Recompilation if any of these change:
-    conf.vars = ['FC_NAME', 'FC_VERSION', 'FCFLAGS']
+
     conf.check_fortran()
     subconf(conf)
 
                 use = 'aotus',
                 target = utest.change_ext(''))
 
+    if bld.cmd == 'doxy':
+        bld(features = 'doxygen',
+            doxyfile = 'Doxyfile')
+
+    bld.install_files('${PREFIX}/include', bld.path.get_bld().ant_glob('*.mod'))
+    bld.install_files('${PREFIX}/lib', 'libaotus.a')
+
 ### Building the lua interpreter, usually not needed.
 #    bld(
 #        features = 'c cprogram',
     variant = 'debug'
 
 class test(BuildContext):
-    "Tests"
+    "Unit Tests"
     cmd = 'test'
+
+class doxy(BuildContext):
+    "Doxygen documentation"
+    cmd = 'doxy'