discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Creating shared library using GNUstep makefile, with files distribut


From: Richard Frith-Macdonald
Subject: Re: Creating shared library using GNUstep makefile, with files distributed in different folders
Date: Thu, 27 Jan 2011 06:08:59 +0000

On 26 Jan 2011, at 03:18, indieAN wrote:

> Hi Ivan,
> I did that, But GNUstep makefile doesn't seems to like it.
> 
> 
> libCoCoStep_OBJC_FILES +=  Support/EAGLView.m
> 
> 
> resulted in 
> 
> Making all for library libCoCoStep...
> Compiling file Support/EAGLView.m ...
> Support/EAGLView.m:457: fatal error: opening dependency file
> obj/Support/EAGLView.m.d: No such file or directory
> compilation terminated.
> make[3]: *** [obj/Support/EAGLView.m.o] Error 1
> make[2]: *** [internal-library-all_] Error 2
> make[1]: *** [libCoCoStep.all.library.variables] Error 2
> make: *** [internal-all] Error 2
> 
> 
> 
> I believe static lib approach could work. But I am not knowing how to do
> it using GNUstep makefile. All I know is, I can specify that whether a
> library  should be static/shared  by  using shared=no/yes on makefile of
> particular directory. 
> Can anybody put light on this one,
> 
> thanks,
> Indie AN.
> 
> 
> 
> On Tue, 2011-01-25 at 16:24 +0100, Ivan Vučica wrote:
>> Shouldn't you be able to just reference the files in subdirectories by  
>> specifying the relative path?
>> 
>> support/file.m
>> support/file.h
>> 
>> I had some issues with same-name files in multiple directories when  
>> using autotools (not the gnustep build system) in another project. You  
>> might want to avoid having files with identical names.
>> 
>> Alternatively, consider building support/ library as a static library  
>> and then linking it into the main shared library.
>> 
>> Regards,
>> 
>> Ivan Vučica
>> via phone
>> 
>> On 24. sij. 2011., at 19:20, Indie AN <an.indian.indie@gmail.com> wrote:
>> 
>>> Hi Everybody,
>>> I am new to GNUstep makefile build system . I am creating a shared
>>> library named libCoCostep.
>>>       Folder cocostep contains majority of the files, however for
>>> understandability some files are put in sub folder called Support.
>>> Whenever building shared lib I want build all files with it.  
>>> Currently I
>>> am using two separate shared libs one for cocostep folder another for
>>> Support folder (libCoCostepSupport). How can I avoid using separate  
>>> libs
>>> without restructuring files.
>>> 
>>> Thanks
>>> indie AN

To combine source from different folders you use 'subprojects'.  The source in 
each subproject is built independently, and then combined into the library.

You can look at the gnustep-base source for an example of doing this (to 
conditionally incorporate code from the Additions, ObjectiveC2, unix and win32 
subdirectories).

What you do is include aggregate.make in your top level makefile before 
including library.make, and you add  libraryname_SUBPROJECTS  to specify which 
subprojects to including in your library.

Within the subdirectories, you use subproject.make and build your source files 
into a subprojects (which just compiles the source in that subdirectory).






reply via email to

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