[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tracking dependencies of built sources
From: |
Ralf Wildenhues |
Subject: |
Re: tracking dependencies of built sources |
Date: |
Wed, 1 Apr 2009 19:45:39 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
Hello,
* address@hidden wrote on Tue, Mar 31, 2009 at 06:00:37PM CEST:
> I'm using Qt 4's moc to generate source files in an autotools project.
>
> The pattern looks something like
>
> cat <<_EOF > Makefile.am
> # Makefile fragment
> bin_PROGRAMS=test
> test_SOURCES=a.cpp b.cpp
> test_META=a.hpp b.hpp
> test_SOURCES+=$(test_META)
> test_LDADD = $(test_META:%.hpp=%_moc.$(OBJEXT))
>
> %_moc.cpp : %.hpp
> $(QT_MOC) -o $@ $<
> _EOF
>
> This all works fine for building the project, but it doesn't track
> dependencies for the moc source files properly. The dependencies are
> getting dropped in $(DEPDIR)/*_moc.Po, but the Makefile doesn't have any
> lines which actually include them.
FWIW, here's what we do, and it's been working well.
Have manually written *.cpp files which contain as last line
#include "file.moc"
with this in Makefile.am:
bin_PROGRAMS = foo
foo_SOURCES = $(sources) $(headers)
nodist_foo_SOURCES = $(moc_sources)
BUILT_SOURCES = $(moc_sources)
CLEANFILES = $(moc_sources)
SUFFIXES = .cpp .moc .h
.h.moc:
$(MOC) -i $< -o $@
moc_sources = $(headers:.h=.moc)
headers = ...
sources = ...
Cheers,
Ralf