automake
[Top][All Lists]
Advanced

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

Re: problems with recursive make target


From: John Calcote
Subject: Re: problems with recursive make target
Date: Mon, 29 Jun 2009 14:11:15 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1b3pre) Gecko/20090223 Thunderbird/3.0b2

Hi John,

On 6/29/2009 1:44 PM, Ralf Wildenhues wrote:
Hello John,

* address@hidden wrote on Mon, Jun 29, 2009 at 09:36:09PM CEST:
in top/lib/Makefile.am
SUBDIRS = pika_comm pika_utilities
# provide a separate recursive target for making tests
tests : all
echo `pwd`;
for dir in $(SUBDIRS); do \
cd $$dir&&  $(MAKE) $(AM_MAKEFLAGS) $@ || exit 1; \
done
echo `pwd`;
.PHONY : tests

You don't ever 'cd' back out of the first subdirectory, so you can't
find the second:
Ralf is correct, of course. In my online catalog of solutions, I'd copied and modified this code from an Automake-generated Makefile. But I inadvertently left the parentheses off the cd command line, which would have invoked the entire line in a sub-shell:

for dir in $(SUBDIRS); do \
  (cd $$dir&&  $(MAKE) $(AM_MAKEFLAGS) $@ || exit 1) \
done


Sorry for the confusion.

John



reply via email to

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