Next: 5.2 Advanced usage of Up: 5 Subdirectories Previous: 5 Subdirectories

5.1 Examples

Let's say that you want to build a tool and a library. To use the new subdirectories makefiles, first of all you need to put the tool and the library into two separate subdirectories. For example, you could put the tool into a subdirectory called Tools, and the library into a subdirectory called Source (they could be called anything you want). Each of them will have its own standalone GNUmakefile.

At the top-level, you create a GNUmakefile that will drive the building of the subdirectories. Here is an example:

include $(GNUSTEP_MAKEFILES)/common.make

SERIAL_SUBDIRECTORIES = Source Tools

include $(GNUSTEP_MAKEFILES)/serial-subdirectories.make

This will cause gnustep-make to go into the SERIAL_SUBDIRECTORIES in order, and build them serially, one by one. So, it will first build Source (that contains our library) and then Tools (that contains our tool).

If you want the two subdirectories to be built in parallel, you just need to use parallel-subdirectories.make, as follows:

include $(GNUSTEP_MAKEFILES)/common.make

PARALLEL_SUBDIRECTORIES = Source Tools

include $(GNUSTEP_MAKEFILES)/parallel-subdirectories.make

This will tell gnustep-make that it should fork off two subprocesses, and build the Source and Tools subdirectories in parallel.



2010-03-12