Next: 6.2 Most of the Up: 6 Subprojects Previous: 6 Subprojects

6.1 Why do subprojects exist ?

Before version 2.4.0, gnustep-make did not support having source files in subdirectories. For example, you couldn't write:

include $(GNUSTEP_MAKEFILES)/common.make

TOOL_NAME = HelloWorld
HelloWorld_OBJC_FILES = Subdirectory/HelloWorld.m

include $(GNUSTEP_MAKEFILES)/tool.make

This works if you use gnustep-make 2.4.0 (or later); but wouldn't work with previous versions of gnustep-make, because HelloWorld.m is in a subdirectory. So, people who wanted to organize their source files in different subdirectories had to use ``subprojects''. You created a GNUmakefile in each of the subdirectories (which would build using subproject.make), then specifies that the tool had some subprojects. So, the tool's GNUmakefile would have been -

include $(GNUSTEP_MAKEFILES)/common.make

TOOL_NAME = HelloWorld
HelloWorld_SUBPROJECTS = Subdirectory

include $(GNUSTEP_MAKEFILES)/tool.make

and in the subdirectory you'd have had a GNUmakefile such as the following one -

include $(GNUSTEP_MAKEFILES)/common.make

SUBPROJECT_NAME = Subdirectory
Subdirectory_OBJC_FILES = HelloWorld.m

include $(GNUSTEP_MAKEFILES)/subproject.make

You'll appreciate how easier it is to specify source files in subdirectories directly in the tool's GNUmakefile (as allowed by gnustep-make 2.4.0), without having to have an additional GNUmakefile in each subdirectory.



2010-03-12