[Top][All Lists]

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

"No rule to make target" in a BUILT_SOURCES, non-recursive, multi-direc

From: Daily, Jeff A
Subject: "No rule to make target" in a BUILT_SOURCES, non-recursive, multi-directory project
Date: Tue, 10 Aug 2010 11:54:53 -0700

I have almost the same situation as a post many years ago.  The solution didn't 
seem to apply, however,

I am using subdir-objects and I have a single, top-level

libfoo_la_SOURCES =
BUILT_SOURCES += foo/bar/wapi.c
foo/bar/wapi.c: foo/bar/papi.h $(top_srcdir)/build-aux/
        -rm -f foo/bar/wapi.c && \
        $(PYTHON) $(top_srcdir)/build-aux/ $< > foo/bar/wapi.c
libfoo_la_SOURCES += foo/bar/wapi.c

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, and never will, since 
it is located in the build tree instead of the source tree (it is a 
BUILT_SOURCE, after all, and belongs in the build tree).  Further, I require 
that the built source be placed in the appropriate subdirectory within my build 
tree just like subdir-objects would do (I am using subdir-objects so this makes 
sense).  I use this strategy for building headers, and then adding 
-I$(top_build_prefix)foo to my CPPFLAGS.  But this is the only built source 
file (*.c) and it fails as I've mentioned:

Make: *** No rule to make target `../foo/bar/wapi.c', needed by 
'foo/bar/wapi.lo'.  Stop.

What am I doing wrong?  Thanks.
Jeff Daily
Pacific Northwest National Laboratory

reply via email to

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