help-make
[Top][All Lists]
Advanced

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

Recursive make for 'all' and 'clean' targets


From: hi
Subject: Recursive make for 'all' and 'clean' targets
Date: Wed, 24 Mar 2010 18:35:20 +0530

Hi,

I have created makefile as follow, which work fine in recursive (plus
parallel build) for 'allprodbld' target.

The problem I am facing is how can I have recursive 'clean' target? In
following case 'clean' is not working.

<Makefile>

############ actual scenario
SUBPRODSBLD = prod*

.PHONY:: $(SUBPRODSBLD)
$(SUBPRODSBLD)::
    $(MAKE) -C $@ allprodbld

.PHONY:: subprodsbld
subprodsbld:: $(SUBPRODSBLD)
    @echo "dep: $^"

.PHONY:: allprodbld
allprodbld::
    $(MAKE) subprodsbld

### Following would not work as prod1 dir will be call for 'make clean'
SUBPRODSCLR = prod*

.PHONY:: $(SUBPRODSCLR)
$(SUBPRODSCLR)::
    $(MAKE) -C $@ clean

.PHONY:: subprodsclr
subprodsclr:: $(SUBPRODSCLR)
    @echo "dep: $^"

clean::
    # $(MAKE) subprodsclr

</Makefile>

Thank you in advance.
-Hiral




reply via email to

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