bug-automake
[Top][All Lists]
Advanced

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

Re: Using headers that install in other subdirs.


From: Jeff Bailey
Subject: Re: Using headers that install in other subdirs.
Date: 19 Dec 2002 09:41:32 -0500

On Mon, 2002-12-16 at 06:30, Alexandre Duret-Lutz wrote:
> [You'd better send such questions to address@hidden, 
> there are really few people reading the bug list.]

Thanks - I've sent my next question there. ;)

>  Jeff> Currently the Hurd sources set a bunch of variables and
>  Jeff> then generate stub header files in $(top_builddir)/hurd
>  Jeff> based on those, but it seems like there must be a better
>  Jeff> way.

> This doesn't look like a bad idea.  Has this caused any issue?
> (Usually people are leery of changing something that works.)

Nope - Just that since we're looking at switching to Automake to clean
up the build environment, I'm trying to do things using
automake-friendly ways as much as possible.  It's the first time I've
needed this so I wasn't sure if there was special automake machinery for
it.

I wound up implementing it like this:

In the Makefile.am, I put:
fakeinclude = hurd/someFileInTheLocalDir.h

And my included Makeconf has:

hurdincludedir = ${includedir}/hurd
fakeincludedir = $(top_builddir)/include

AM_CPPFLAGS += -I$(hurdincludedir)

fakeincludedep = ${addprefix $(fakeincludedir)/, ${fakeinclude}}

BUILT_SOURCES += ${fakeincludedep}

${fakeincludedep}: $(notdir $@)
        mkdir -p $(dir $@)
# Handle srcdir != builddir case
        if test -f "$(srcdir)/$(notdir $@)"; then                      \
          echo '#include "$(CURDIR)/$(srcdir)/$(notdir $@)"' > $@;     \
        else                                                           \
          echo '#include "$(CURDIR)/$(notdir $@)"' > $@;               \
        fi


Thanks!

-- 
When you get to the heart,
use a knife and fork.
 - From instructions on how to eat an artichoke.

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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