Subj : Re: Make file To : comp.os.linux From : Stu Date : Wed Jul 28 2004 08:11 am Make files aren't like shell scripts. Each line of execution inherits the the same environment. For example: all: ls cd dir1 ls Both ls commands will output the same value(s). That being said, the key is "each line of execution". So, keep the commands on the same line and it will work: all: ls ; cd dir1 ; ls Also, if you call make from inside a Makefile (recursively), use the ${MAKE} macro. So, your Makefile would look like this: all: cd folder1 ; ${MAKE} cd folder2 ; ${MAKE} cd folder3 ; ${MAKE} Stu 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 .