Hi,
I am looking for an elegant way for the parallelization of jobs in GNU make. Here is a sample of what I did so far. Make processes the directories dir-1, dir-2 and dir-3 in a serial fashion which is logical but not my intention:
SUBDIRS=dir-1 dir-2 dir-3
default: all
all:
@for dir in $(SUBDIRS); do (cd $$dir; $(MAKE)); done
.PHONY: clean
clean:
@for dir in $(SUBDIRS); do (cd $$dir; $(MAKE) clean); done
Is there a way to support parallel processing of these directories using the "-j" option without specifying specific targets for each directory?
Thx in advance!