Hi,

I have a problem which I figure must be fairly common, although I found no 
reference to it anywhere. I think it must be common because the SCons manual 
says they fixed it. [1] Anyway...

Let's say I have two directories, "src" and "include". I place main.c in src 
and inc.h in include. main.c includes inc.h this way:

#include "../include/inc.h"

and inc.h includes built.h this way:

#include "built.h"

Now, my src/Makefile.am contains something like this:

BUILT_SOURCES = ../include/built.h
../include/built.h:
        mkdir -p $(@D)
        touch $@

Everything works fine as long as I am building in the source directory. If I 
make a build directory and invoke configure and make from that directory, 
inc.h can't find built.h. And that's normal, since built.h is in 
build/include instead of include. Because it is not in the same directory as 
inc.h, including it using double quotes can't work.

The quick fix is to add the location of inc.h, prefixed with $(top_builddir). 
However, in my real project I have hundreds of such files with hundreds of 
such locations. I would quickly hit the limit on command-line arguments.

How should I fix this problem?

Thanks!

[1] http://www.scons.org/doc/HTML/scons-user/x1948.html


Reply via email to