help-make
[Top][All Lists]
Advanced

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

Recursive make


From: Grumble
Subject: Recursive make
Date: Wed, 30 Mar 2005 10:18:37 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040916

Hello everyone,

AFAIU, there are several things wrong with the following Makefile:


SUBDIRS = (a list of subdirectories)

default clobber clean debug:
        for dir in $(SUBDIRS); do make -C $$dir $@; done


1) One shouldn't call make explicitely.
=> Instead, one should call $(MAKE) or prefix the whole command with +

2) The 'for' loop ignores errors, and runs to completion.
=> The manual suggests using .PHONY targets.

I don't see how I can use .PHONY targets to get rid of the loop.

For example, if I run 'make debug', make should recursively run
'make debug' within every subdirectory. Is there a simple way to
do that?

--
Regards, Grumble




reply via email to

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