help-make
[Top][All Lists]
Advanced

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

Re: A newbie question


From: Barry D Benowitz
Subject: Re: A newbie question
Date: Wed, 9 May 2001 16:35:29 -0400

I already have a rule similar to this (no clean) because in the normal case, 
I want to descend the directories and run straight make. What I'd like to do 
is give a target, say cleanup, that descends, cleans in the descended 
directory, then cleans in the current directory. Thats where the complication 
comes in.

> $(SUBDIRS):
>         $(MAKE) -C $@ clean

On Wednesday 09 May 2001 04:03 pm, Paul D. Smith wrote:
> %% Barry D Benowitz <address@hidden> writes:
>
>   bdb> I have a variable with a list of subdirectories. I would like a
>   bdb> rule to descend these subdirectories, then run make clean in each
>   bdb> sub directory. Then I would like to do a make clean in the
>   bdb> current directory; How can I do that?
>
> # ---
> SUBDIRS = foo bar biz baz boz
>
> .PHONY: $(SUBDIRS)
>
> clean: $(SUBDIRS)
>
>         : do some cleaning in the current directory
>
> $(SUBDIRS):
>         $(MAKE) -C $@ clean
> # ---
>
>
> Note this will only work with GNU make.  If you can't rely on having GNU
> make, you can still do it but it's harder and less functional.



reply via email to

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