automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make test with fortran program


From: Ralf Wildenhues
Subject: Re: make test with fortran program
Date: Fri, 28 Jan 2011 20:42:59 +0100
User-agent: Mutt/1.5.20 (2010-08-04)

* Eve-Marie Devaliere wrote on Fri, Jan 28, 2011 at 08:29:31PM CET:
> TESTS = Example1_Simple
> check_PROGRAMS = Example1_Simple
> Example1_Simple_SOURCES = Example1_Simple.f90
> Example1_Simple_FCLAGS =

There's a typo here, should be _FCFLAGS not _FCLAGS.

> -I/home/pub/evemarie/projects/CRTM/autoconf/play/CRTM/libsrc/
> Example1_Simple_LDADD =
> /home/pub/evemarie/projects/CRTM/autoconf/play/CRTM/libsrc/.libs/libCRTM.la
> AM_FCFLAGS = $(Example1_Simple_FCLAGS)# not sure if
> Example1_Simple_FCLAGS is useful, definitely need the AM_FCFLAGS to have
> my include line...
> 
> Of course I will get rid of the hardcoding now that I got it to work...

The above should be simplifiable to something like below.
Please note that you should reference .la files outside the .libs
directory (so that dependencies on them will be produced correctly)
and you should use relative path names to things that are inside your
build tree (but you can use $(top_builddir) or similar).

So if all programs in this Makefile.am are built similarly, it should
work to something like this:

TESTS = $(check_PROGRAMS)
check_PROGRAMS = Example1_Simple
Example1_Simple_SOURCES = Example1_Simple.f90
AM_FCFLAGS = -I../../../play/CRTM/libsrc
LDADD = ../../../play/CRTM/libsrc/libCRTM.la


and if you can afford to require Automake 1.11 or newer, then
you wouldn't need a *_SOURCES line per test but could use

AUTOMAKE_OPTIONS = 1.11
AM_DEFAULT_SOURCE_EXT = .f90

instead.

Cheers,
Ralf



reply via email to

[Prev in Thread] Current Thread [Next in Thread]