avr-gcc-list
[Top][All Lists]
Advanced

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

RE: [avr-gcc-list] Exporting functions as lib


From: Christian Neumair
Subject: RE: [avr-gcc-list] Exporting functions as lib
Date: Sun, 14 Dec 2003 14:20:57 +0100

On So, 2003-12-14 at 08:06 -0500, James A. Russo wrote:
> Chris, 
> 
>       You can put the libraries anywhere as long as the linker knows
> where to get at them. You typically would use -L/path/to/lib and
> -I/path/to/header files. 
> 
> Ex: 
> 
>       /usr/local/uc-projects/lib/libcoolhwardware.a
>       /usr/local/uc-projects/include/coolhardware.h
> 
> 
> and then something like this:
> 
>       avr-gcc -L/usr/local/uc-projects/lib
> -I/usr/local/uc-projects/include/ project.c -o project -lcoolhardware
> 
> where project.c now has: 
>       #include<coolhardware.h>
> 
> note that the -lcoolhardware doesn't have the lib in front of it like
> the filename does, this is automatically added for you.. so -lfoo
> references file libfoo.a. 

Thanks for your explanation.
I've got a little problem, though: I don't seem to get any lib files.
Instead, the Makefile generates .d, .eep, .hex, .lss, .lst, .map and .o
files.
The real question is: How do I get a file that is suitable to link
against.
In plain C I always do such things using libtool, but avr-libc doesn't
use it and when trying to put up project dir using autotools and a
Makefile.am, I failed. 

regs,
 Chris

> 
> > -----Original Message-----
> > From: address@hidden
> [mailto:address@hidden
> > On Behalf Of Christian Neumair
> > Sent: Sunday, December 14, 2003 7:32 AM
> > To: address@hidden
> > Subject: [avr-gcc-list] Exporting functions as lib
> > 
> > Hi there!
> > I've got a nifty C library exporting some helper functions for a
> > particular hardware unit. Currently I'm building it together with the
> > source code before compiling/flashing using
> > #include "mylib.h"
> > and some Makefile magic inside my C source tree.
> > Now, I'd like to build and install it, i.e. I can use it using
> > #include <mylib.h>
> > just like I can do
> > #include <stdio.h> and it should magically link against it.
> > I've already taken a look at a recent avr-libc version but grepping
> the
> > Makefiles and configure.in file didn't really help since I don't know
> > where to install these files etc.
> > Are there any hints/code samples showing me how to install a helper
> > library?
> > I'd like to package/redistribute it.
> > Thanks in advance!
> > 
> > regs,
> >  Chris



reply via email to

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