Subj : Re: Make file To : comp.os.linux From : Larry I Smith Date : Wed Jul 28 2004 03:49 pm Omid wrote: > Hi. > > I have a newbie question regarding creating a Makefile. > > I want to create a Makefile that runs "make" in 3 subdirectories. > Something like this: > > --------------------------------------- > -- Makefile --------------------------- > --------------------------------------- > all: > cd folder1 > make > cd .. > > cd folder2 > make > cd .. > > cd folder3 > make > cd .. > --------------------------------------- > > However, this doesn't work. > The output is: > --------------------------------------- > eomirou@E-56BCB50DA21A4 /my/path > $ make > cd folder1 > make > make[1]: Entering directory `/my/path' > cd folder1 > make > make[2]: Entering directory `/my/path' > cd folder1 > make > make[3]: Entering directory `/my/path' > cd folder1 > make > make[4]: Entering directory `/my/path' > > etc... > --------------------------------------- > > > Any suggestions about how to make this work? > > > /Omid First, read the 'info' pages for GNU Make. GNU Make is quite a comprehensive program. Here's the answer to your immediate question: --------------------------------------- -- Makefile --------------------------- --------------------------------------- all: $(MAKE) -C folder1 $(MAKE) -C folder2 $(MAKE) -C folder3 Regards, Larry -- Anti-spam address, change each 'X' to '.' to reply directly. .