Silly me, I hadn't write a makefile in, uh.. almost years, I had forgot that makefile in general are more or less single directory friendly, ...
----- Original Message ----- From: "Nicola Pero" <[EMAIL PROTECTED]>
To: "Lloyd Dupont" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Friday, April 29, 2005 9:27 PM
Subject: Re: GNU(step)Makefile & Windows problem
I tryed to compile a simple project (on Windows) using GNUstep makefile system with a simple makefile like that: ------------------------------------- include $(GNUSTEP_MAKEFILES)/common.make
TOOL_NAME = NMReadWrite ADDITIONAL_OBJCFLAGS = -Wno-import
NMReadWrite_OBJC_FILES = main.m code.m TreeClasses/NMBranch.m TreeClasses/NMTool.m
include $(GNUSTEP_MAKEFILES)/tool.make -------------------------------------
it failed on the compilation of TreeClass/NMBranch.m with an error like that: ------------------------------------- Making all for tool NMReadWrite... Compiling file main.m ... Compiling file code.m ... Compiling file TreeClasses/NMBranch.m ... shared_obj/TreeClasses/NMBranch.d: No such file or directory make[1]: *** [shared_obj/TreeClasses/NMBranch.o] Error 1 make: *** [NMReadWrite.all.tool.variables] Error 2 -------------------------------------
and indeed, when I looked into shared_obj directory, there is not even a TreeClasses directory into it.
Is it a bug or a feature of the GNUstep makefile system to not being able to
work with multiple directories for the source?
Well the idea is that you have a GNUmakefile in each directory where you are compiling, so that if you want to just compile the files in the directory (and sub-directories of it) you can type 'make' anywhere and that works.
In your case, if you want to spread the tool ObjC files in the top-level directory and a subdirectory, you can use a SUBPROJECT.
Put in the top level directory the following GNUmakefile:
include $(GNUSTEP_MAKEFILES)/common.make
TOOL_NAME = NMReadWrite ADDITIONAL_OBJCFLAGS = -Wno-import
NMReadWrite_OBJC_FILES = main.m code.m NMReadWrite_SUBPROJECTS = TreeClasses
include $(GNUSTEP_MAKEFILES)/tool.make
and inside the TreeClasses directory, the following GNUmakefile:
include $(GNUSTEP_MAKEFILES)/common.make
SUBPROJECT_NAME = TreeClasses ADDITIONAL_OBJCFLAGS = -Wno-import
TreeClasses_OBJC_FILES = NMBranch.m NMTool.m
include $(GNUSTEP_MAKEFILES)/subproject.make
That should work! Then you can type 'make' inside TreeClasses if you just want to compile that directory (useful for checking that the new code compiles). Obviously to build the tool anew you need to type 'make' in the top-level directory.
If you want to spread the code over multiple subdirs, just add more dirs to the NMReadWrite_SUBPROJECTS list in the top-level GNUmakefile, and in each put a subproject makefile like the one I showed you.
Thanks :-)
_______________________________________________ Discuss-gnustep mailing list [email protected] http://lists.gnu.org/mailman/listinfo/discuss-gnustep
