Hello, all!
I'm a newbie in make.
My trouble is: I have a library (in an [tt]*.a[/tt] file) and want be able to use it's functions. How can I bind this lib to my programm? I thought it goes with [tt]make[/tt] somehow. I know it should be done with [tt]-l[/tt] option of make. BUT! The Makefile isn't mine I doing the reverse programming here and it isn't funny any more.
Here is a part of the Makefile:
[tt]
include ../Makefile.inc
DEST = libcommon.a
OBJS = utils.o debug.o fault.o
GLINFOBJS = globinfo.o ../infod/infod_clnt.o ../infod/infod_xdr.o
###
.PHONY: all install clean veryclean depend
all: $(DEST) libglobinfo.a
install: all
clean:
rm -f *.o *~
veryclean: clean
rm -f libcommon.a libglobinfo.a libtcl_gdbm.a
###
$(DEST): $(OBJS)
ar r $@ $(OBJS)
libglobinfo.a: $(GLINFOBJS)
ar r $@ $(GLINFOBJS)
[/tt]
The file, where I need some functions of that external lib is globinfo.c. I don't understand at all where should I put that [tt]-l[/tt] thing? In [tt]Makefile.inc[/tt]
are given the compiler things like
[tt]
CC = gcc -pipe
INCLUDES = -I/usr/X11R6/include -I/usr/include/xyz -I../common -I../rpc
DEFINES = -D_GNU_SOURCE -D_REENTRANT
ifndef OPTIMIZE
DEFINES += -D_DEBUG
endif
CFLAGS = $(INCLUDES) $(DEFINES)
CFLAGS += -mpentium -O -g -Wall #-Wno-implicit
LDFLAGS = -g
LIBPATH = -L/usr/X11R6/lib -L../common -L../rpc
.............
[/tt]
Any ideas?
Thanks.
I'm a newbie in make.
My trouble is: I have a library (in an [tt]*.a[/tt] file) and want be able to use it's functions. How can I bind this lib to my programm? I thought it goes with [tt]make[/tt] somehow. I know it should be done with [tt]-l[/tt] option of make. BUT! The Makefile isn't mine I doing the reverse programming here and it isn't funny any more.
Here is a part of the Makefile:
[tt]
include ../Makefile.inc
DEST = libcommon.a
OBJS = utils.o debug.o fault.o
GLINFOBJS = globinfo.o ../infod/infod_clnt.o ../infod/infod_xdr.o
###
.PHONY: all install clean veryclean depend
all: $(DEST) libglobinfo.a
install: all
clean:
rm -f *.o *~
veryclean: clean
rm -f libcommon.a libglobinfo.a libtcl_gdbm.a
###
$(DEST): $(OBJS)
ar r $@ $(OBJS)
libglobinfo.a: $(GLINFOBJS)
ar r $@ $(GLINFOBJS)
[/tt]
The file, where I need some functions of that external lib is globinfo.c. I don't understand at all where should I put that [tt]-l[/tt] thing? In [tt]Makefile.inc[/tt]
are given the compiler things like
[tt]
CC = gcc -pipe
INCLUDES = -I/usr/X11R6/include -I/usr/include/xyz -I../common -I../rpc
DEFINES = -D_GNU_SOURCE -D_REENTRANT
ifndef OPTIMIZE
DEFINES += -D_DEBUG
endif
CFLAGS = $(INCLUDES) $(DEFINES)
CFLAGS += -mpentium -O -g -Wall #-Wno-implicit
LDFLAGS = -g
LIBPATH = -L/usr/X11R6/lib -L../common -L../rpc
.............
[/tt]
Any ideas?
Thanks.