Re: problems with recursive make target
Hello John, * johnwohlb...@gmail.com 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: make[2]: Leaving directory `/users/wohlbier/MPMC/pika/build/lib/pika_comm' /bin/sh: line 1: cd: pika_utilities: No such file or directory make[1]: *** [tests] Error 1 Cheers, Ralf
Re: Re: problems with recursive make target
On Jun 29, 2009 1:44pm, Ralf Wildenhues ralf.wildenh...@gmx.de wrote: Hello John, * johnwohlb...@gmail.com 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: make[2]: Leaving directory `/users/wohlbier/MPMC/pika/build/lib/pika_comm' /bin/sh: line 1: cd: pika_utilities: No such file or directory make[1]: *** [tests] Error 1 Cheers, Ralf Thanks Ralf. I feel pretty dumb. You know I suspected that was the problem, and was trying to cd ../. But now I realize I was putting the cd ../ in the wrong place. After my wrongly placed cd ../ didn't work (which I thought was rightly placed) I thought maybe that the example code at http://www.freesoftwaremagazine.com/books/agaal/catalog_of_reusable_solutions was correct and make would handle the cd'ing for me. Maybe I should file a documentation bug report with John Calcote! jgw
Re: problems with recursive make target
Hi John, On 6/29/2009 1:44 PM, Ralf Wildenhues wrote: Hello John, * johnwohlb...@gmail.com 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
Re: problems with recursive make target
John, On 6/29/2009 2:00 PM, johnwohlb...@gmail.com wrote: On Jun 29, 2009 1:44pm, Ralf Wildenhues ralf.wildenh...@gmx.de wrote: Hello John, Thanks Ralf. I feel pretty dumb. You know I suspected that was the problem, and was trying to cd ../. But now I realize I was putting the cd ../ in the wrong place. After my wrongly placed cd ../ didn't work (which I thought was rightly placed) I thought maybe that the example code at http://www.freesoftwaremagazine.com/books/agaal/catalog_of_reusable_solutions was correct and make would handle the cd'ing for me. Maybe I should file a documentation bug report with John Calcote! Fixed! Thanks! John