PDA

View Full Version : Help with Makefiles



WebmasterMattD
05-21-2002, 03:17 AM
For an application that I am writing in C, i need to have one Makefile that will access the Makefiles in all of the directories that have stuff to be compiled.

My question is simple (and I hope the answer is too), how would I go about doing this.

Thanks,

Salem
05-21-2002, 11:18 AM
I imagine your top-level makefile will contain the following

- a target, which is dependent on the products of your sub-makes
- calls to all the sub-makes

Like so
make -f dir1/makefile
make -f dir2/makefile

etc

WebmasterMattD
05-21-2002, 02:54 PM
Thanks for that

Later,

kwigibo
05-24-2002, 08:51 AM
or a line like this in the main makefile

#libobjects defined earlier in file
$(libobjects) : lib.h ;cd lib && $(MAKE) MAKEFLAGS=