On Thu, 13 Aug 1998, Ibrahim F Haddad wrote:
> I have a directory that contains 2 sub directories.
> In each of the subdirectories I have a software
> that uses makefile to compile. So i have 2 makefiles.
> I need to have a makefile in the root directory that
> upon the initation of 'make' would go and
> do 'make' for the makefiles available in the 2
> subdirectories.
> the question is: how??? :)
SUBDIRS = subdir1 subdir2 subdir3
all: Makefile
for i in $(SUBDIRS); do $(MAKE) -C $$i; done
Similar loops can be used for clean, dep or anything else you want:
.PHONY: clean dep
clean:
for i in $(SUBDIRS); do $(MAKE) clean -C $$i; done
dep:
for i in $(SUBDIRS); do $(MAKE) dep -C $$i; done