[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Building a library with tools that depend on it
From: |
Nicola Pero |
Subject: |
Re: Building a library with tools that depend on it |
Date: |
Mon, 2 Dec 2002 12:07:03 +0000 (GMT) |
> Hi folks,
>
> I am trying to write a GNUmakefile to :
>
> - Create a library "libPiranhas"
> - Compile various demos as tools that depend on the "libPiranhas"=20
> target
>
> I tried to include the "library.make" and use the "LIBRARY_NAME =3D=20
> libPiranhas", but there is no libPiranhas created after compilation=20
> (which goes well) :/
It should be in
shared_obj/ix86/linux-gnu/gnu-gnu-gnu/libPiranahs.so
(or a different directory if you are on a different system).
There should also be a handy symbolic link
obj/libPiranhas.so --> shared_obj/ix86/linux-gnu/gnu-gnu-gnu/libPiranahs.so
> So my RTFM-style question are:
>
> - How do I write a target for building a shared library from objc=20
> source files
Have a look on
http://www.gnustep.it/nicola/Tutorials
there are two tutorials on writing gnustep makefiles (the first one, and
the last one). A simple step by step tutorial is probably what you need.
> - How do I write a target for building a tool that depends on this=20
> shared library and properly links with it
In case the tutorials don't explain this, I'll quickly sum up - say that
you have (just guessing, you need to creatively adapt to your case):
xxx/
xxx/Library
xxx/Tools
You then add
xxx/GNUmakefile
as follows:
include $(GNUSTEP_MAKEFILES)/common.make
SUBPROJECTS = Library Tools
include $(GNUSTEP_MAKEFILES)/aggregate.make
this simple makefile will step first in Library, then in Tools, so you can
compile from top-level both Library and Tools by typing 'make'.
Then you add
xxx/Library/GNUmakefile
the makefile for your library.
Then you add
xxx/Tools/GNUmakefile
the makefile for your tools, where you add
ADDITIONAL_TOOL_LIBS += -lpiranahs
ADDITIONAL_TOOL_LIB_DIRS += -L../Library/obj
But - suggestion - take the comfortable and friendly way :-) - read the
tutorials first before trying! :-)