gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: subprojects


From: Nicola Pero
Subject: Re: subprojects
Date: Thu, 19 Jul 2001 09:58:16 +0100 (BST)

> Does anyone have an example of a project using subprojects?  I'm a little
> unclear on the makefile syntax.

There are really two cases: 

* aggregate projects - which are really separate projects built in
separate directories, with a GNUmakefile at the top so that you can type
`make' in the top dir and the make package steps in the subdirs and
compiles each project;

In this case, the syntax is:

include $(GNUSTEP_MAKEFILES)/common.make

SUBPROJECTS = Source Tools

include $(GNUSTEP_MAKEFILES)/aggregate.make


And then you have two subdirectories, Source/ and Tools/, and each one
contains its own GNUmakefile with its own separate project.  You can count
on Source/ being compiled/processed before Tools/.


* `real' subprojects - when a tool or a library or whatever has part of
its source code inside subdirectories, and when you type `make' for that
tool, gnustep-make compiles all the subprojects of that tool, and then -
when linking - merges the object files from the subprojects into the tool.

In this case, the syntax is:

include $(GNUSTEP_MAKEFILES)/common.make

TOOL_NAME = WebServer
WebServer_OBJC_FILES = main.m
WebServer_SUBPROJECTS = FileSystem Library Network

include $(GNUSTEP_MAKEFILES)/tool.make

(please note that you don't need to include any special makefile -
xxx_SUBPROJECTS is supported automatically for all target types by
rules.make - also please note the difference - here is xxx_SUBPROJECTS,
while for aggregate projects is simply SUBPROJECTS) for a fictious tool
called WebServer, which contains a `main.m' file in the top level dir, and
then the other *.m files are in the three directories FileSystem/,
Library/, Network/.  In each of these directories you have something like
the following GNUmakefile:

include $(GNUSTEP_MAKEFILES)/common.make

SUBPROJECT_NAME = FileSystem
FileSystem_OBJC_FILES = file1.m file2.m file3.m

include $(GNUSTEP_MAKEFILES)/subproject.make

the directory then of course contains these file1.m, file2.m and file3.m
files.

When the tool is compiled, gnustep-make steps in all subproject dirs,
compiles all the stuff there, and when it's compiling the tools, links all
the compiled stuff from the subprojects and the top level object files
into a single tool.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]