Hi,

Suppose there are many subdirectories in a directory. The sub dirs all
have working makefiles.

'make -j3' in the parent dir would parallel make all directories. But
'make clean -j3' could not. The problem is that I don't know how to
clean each directory as well as deleting the file '.d'.

Can somebody let me know how to do it?

Thanks,
Peng

------------------------
.PHONY: all clean

SUBDIRS := $(filter-out backup bash doc,$(patsubst %/.,%,$(wildcard */.)))

.PHONY: $(SUBDIRS)

all: $(SUBDIRS)

-include .d
.d:
        @rm -f $@; \
                for dir in $(SUBDIRS); do \
                echo $$dir: >> $@; \
                echo -e "\t"@$$\{MAKE\} -C $$dir $$\{MAKECMDGOALS\}>> $@; \
                echo >> $@; \
                done

clean:
        @$(RM) .d; for dir in $(SUBDIRS); do \
                $(MAKE) -C $$dir clean & \
                done


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to