[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: make distcheck failing with included file from another directory.
From: |
Stepan Kasal |
Subject: |
Re: make distcheck failing with included file from another directory. |
Date: |
Thu, 18 Aug 2005 19:43:45 +0200 |
User-agent: |
Mutt/1.4.1i |
Hello,
On Thu, Aug 18, 2005 at 12:44:26PM -0400, Joshua Moore-Oliva wrote:
> One of my test programs (which is in a test directory) relies on
> a header from another directory (the src directory).
If the header is $(top_srcdir)/subdir/Action.h, you have two possibilities:
a) either use
#include <subdir/Action.h>
and
INCLUDES = $(top_srcdir)
b) or use
#include <Action.h>
and add
INCLUDES = $(top_srcdir)/subdir
It seems you prefer the latter, so you need:
INCLUDES = $(top_srcdir)/src
Two more comments:
1) INCLUDES is considered obsolete, you should use AM_CPPFLAGS.
But you also use test001_CPPFLAGS, so you need to replace these two lines:
> INCLUDES = -I$(top_builddir) -I$(top_srcdir)
> test001_CPPFLAGS = -Da_p=a_confirm
with
AM_CPPFLAGS = -I$(top_srcdir)/src
test001_CPPFLAGS = $(AM_CPPFLAGS) -Da_p=a_confirm
For a detailed explanation, see
http://sources.redhat.com/automake/automake.html#Flag-Variables-Ordering
2)
It was pure luck that the non-VPATH build worked. (I won't go into details.)
If you want to use headers from other subdirs, you have to add
$(top_srcdir)/subdir/subsubdir
to AM_CPPFLAGS.
HTH,
Stepan Kasal