automake
[Top][All Lists]
Advanced

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

Cannot use $(addprefix) in _SOURCES?


From: Ross Burton
Subject: Cannot use $(addprefix) in _SOURCES?
Date: 07 Aug 2002 12:32:46 +0100

Hi,

I am trying to use automake in a program I am writing. It largely
consists of C code which is generated from .gob files.  I have a list of
these .gob files (minus the extension) in a variable GOBS which I can
use $(addprefix) on to generate various lists:

---
bin_PROGRAMS = devilspie

devilspie_GOBS = \
        devilspie-matcher \
        devilspie-matcher-windowname \
        devilspie-matcher-always

# foo.gob file generates foo.c, foo.h, and possible foo-private.h
BUILT_SOURCES = \
        $(addsuffix .c, ${devilspie_GOBS}) \
        $(addsuffix .h, ${devilspie_GOBS}) \
        $(addsuffix -private.h, ${devilspie_GOBS})

devilspie_SOURCES = \
        ${BUILT_SOURCES} \
        config.c \
        devilspie.c

# Rule to call GOB
%.c %.h %-private.h: %.gob
        @GOB2@ $<
---

However, when I make 'devilspie' only config.o and devilspie.o are
linked, which results in link-time errors as the other generated .c
files need to be compiled and linked too.  Checking the Makefile reveals
that:

am__objects_1 =
am_devilspie_OBJECTS = $(am__objects_1) config.$(OBJEXT) \
        devilspie.$(OBJEXT)

i.e. automake has ignored the $(addprefix) rule.

I guess this is because it does not end in .c at the time when automake
parses the file... is there a way around this or do I have to list every
file explicity?

Regards,
Ross
-- 
Ross Burton                     Software Engineer
OneEighty Software Ltd          Tel: +44 20 8680 8712
Cygnet House                    Fax: +44 20 8680 8453
12-14 Sydenham Road             address@hidden
Croydon, Surrey CR9 2ET, UK     http://www.180sw.com./
====================================================================
Under the Regulation of Investigatory Powers (RIP) Act 2000 together
with any and all Regulations in force pursuant to the Act OneEighty
Software Ltd reserves the right to monitor any or all incoming or
outgoing communications as provided for under the Act




reply via email to

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