I use waf (http://code.google.com/p/waf/) to build a fortran library (which also uses some c-code).
The corresponding wscript looks like this:
def build(bld):
bld(
features = 'fc',
source = 'fortran_interface.f90',
target = 'fortran_interface.o')
#install_path = '${PREFIX}/mod')
#bld.install_files('${PREFIX}/mod','fortran_interface.mod')
bld(
features = 'c',
includes = '../../include',
source = 'init_wrapper.c',
target = 'init_wrapper.o')
bld(
features = 'fc fcstlib',
use = 'init_wrapper.o fortran_interface.o',
target = 'fortran_interface',
install_path = '${PREFIX}/lib')
The call waf produces looks like this:
fc: src/fortran/fortran_interface.f90 ->
build/src/fortran/fortran_interface.f90.1.o
build/fortran_interface.mod
I want to be able to install the .mod file to ${PREFIX}/mod.
I tried install_path which has no effect in this case, or install_files which does not work because a) it doesn’t look inside the build/ directory and b) because it complains before the building if a file is not present.3
As to this thread (http://groups.google.com/group/waf-users/browse_thread/thread/c771a2f4fedd4e3?pli=1) the answer was to create
a separate build group
bld.add_group()and to use
bld.srcnode.find_or_declare(<filename>.mod)to make waf look in the build directory for the .mod file.