[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: "No rule to make target" in a BUILT_SOURCES, non-recursive, multi-d
From: |
Daily, Jeff A |
Subject: |
RE: "No rule to make target" in a BUILT_SOURCES, non-recursive, multi-directory project |
Date: |
Tue, 10 Aug 2010 12:45:43 -0700 |
> > #*snip*
> > BUILT_SOURCES =
> > lib_LTLIBRARIES = libfoo.la
> > libfoo_la_SOURCES =
> > #*snip*
> > If HAVE_PYTHON
> > BUILT_SOURCES += foo/bar/wapi.c
> > foo/bar/wapi.c: foo/bar/papi.h $(top_srcdir)/build-aux/wapi.py
> > -rm -f foo/bar/wapi.c && \
> > $(PYTHON) $(top_srcdir)/build-aux/wapi.py $< > foo/bar/wapi.c
> > libfoo_la_SOURCES += foo/bar/wapi.c
> > endif
> > #*snip*
> >
> > It turns out that $(PYTHON) is located by configure such that
> > HAVE_PYTHON is true. When I configure and build from a subdirectory
> > within my source tree e.g. "mkdir bld; cd bld; ../configure" the build
> > fails because make is looking for the target "../foo/bar/wapi.c" which
> > doesn't exist,
>
> Which make version and implementation, which Automake version?
I'm using autoconf 2.67, automake 1.11.1.
> Do you somehow ensure foo/bar exists in the build tree beforehand?
Not explicitly, no. But foo/bar does exist beforehand, perhaps because foo/bar
contains other source files and the build directory constructs the hidden
dependency directories before I ever run make the first time.
> Does the file foo/bar/papi.h exist in the source or in the build tree?
foo/bar/papi.h exists in the source tree.
>
> The above works for me; but VPATH target lookup is tricky across
> make implementations, see 'info Autoconf "VPATH and Make"' and
> the last node referenced therein.
"...never rely on VPATH searches for targets. In other words, VPATH should be
reserved to unbuilt sources."
I'm not sure how to apply that information.
>
> Using $< in non-inference rules is not portable to non-GNU make.
I'll replace it with $(top_srcdir)/path/to/dependency then? Thanks the tip.
Still no luck. I replaced $< appropriately first, but that didn't change
anything.
Next I tried replacing
libfoo_la_SOURCES += foo/bar/wapi.c with
libfoo_la_SOURCES += $(top_build_prefix)foo/bar/wapi.c
But that produces warnings at make time of "overriding commands for target
`foo/bar/.dirstamp' and "overriding commands for target
`foo/bar/.deps/.dirstamp'
I also tried distilling the problem down to a simpler Makefile.am, but I
couldn't reproduce the problem either. Thanks so far, but any other ideas?
- "No rule to make target" in a BUILT_SOURCES, non-recursive, multi-directory project, Daily, Jeff A, 2010/08/10
- Re: "No rule to make target" in a BUILT_SOURCES, non-recursive, multi-directory project, Ralf Wildenhues, 2010/08/10
- RE: "No rule to make target" in a BUILT_SOURCES, non-recursive, multi-directory project,
Daily, Jeff A <=
- Re: "No rule to make target" in a BUILT_SOURCES, non-recursive, multi-directory project, Ralf Wildenhues, 2010/08/10
- RE: "No rule to make target" in a BUILT_SOURCES, non-recursive, multi-directory project, Daily, Jeff A, 2010/08/10
- Re: "No rule to make target" in a BUILT_SOURCES, non-recursive, multi-directory project, Ralf Wildenhues, 2010/08/11
- RE: "No rule to make target" in a BUILT_SOURCES, non-recursive, multi-directory project, Daily, Jeff A, 2010/08/11