Discussion:
How to link the objects that are not created by libtool
sea star
2018-02-15 00:59:15 UTC
Permalink
Hi,

I have a set of object files built by libool and other set of object files
that are not built by libool. The non-libtool object files are created
outside of my project to which I have limited access.

I have the following in my Makefile.am:

objdir=/nfsmnt/projx/build/release/
OBJS="$(objdir)/bar.o $(testdir)/foo.o"

testSDB_SOURCES = $(testdir)/testSDB.cpp

testSDB_LDADD = $(test_LIBS) $(OBJS) -lboost_system -lboost_thread

testSDB_CPPFLAGS = $(SDB_FLAGS) $(CLIENT_FLAGS) $(SERVER_INCS)



At the time of linking, I'm getting the following make error and it
complains that there is no make target for object files defined in OBJS.

make: *** No rule to make target `"/nfsmnt/projx/build/release/bar.o',
needed by `testSDB'. Stop.

Is there a way stop "make" looking for rule skip building bar.o/foo.o
instead just use the pre-built non-libtool object files during linking? If
so, how do I do that?

I tried specifying OBJS in testSDB_Dependencies(testSDB_DEPENDENCIES=
$(OBJS)), but I was still getting the same error. I couldn't find the
suitable variables at https://www.gnu.org/software/
automake/manual/automake.html#Program-and-Library-Variables to accomplish
my needs.

Any help/advice?

Thanks,
cvin
Basin Ilya
2018-02-15 13:36:17 UTC
Permalink
Please try to add

.PHONY: $(objdir)/bar.lo:

$(objdir)/bar.lo:

to your Makefile.am
Post by sea star
Hi,
I have a set of object files built by libool and other set of object files
that are not built by libool. The non-libtool object files are created
outside of my project to which I have limited access.
objdir=/nfsmnt/projx/build/release/
OBJS="$(objdir)/bar.o $(testdir)/foo.o"
testSDB_SOURCES = $(testdir)/testSDB.cpp
testSDB_LDADD = $(test_LIBS) $(OBJS) -lboost_system -lboost_thread
testSDB_CPPFLAGS = $(SDB_FLAGS) $(CLIENT_FLAGS) $(SERVER_INCS)
At the time of linking, I'm getting the following make error and it
complains that there is no make target for object files defined in OBJS.
make: *** No rule to make target `"/nfsmnt/projx/build/release/bar.o',
needed by `testSDB'. Stop.
Is there a way stop "make" looking for rule skip building bar.o/foo.o
instead just use the pre-built non-libtool object files during linking? If
so, how do I do that?
I tried specifying OBJS in testSDB_Dependencies(testSDB_DEPENDENCIES=
$(OBJS)), but I was still getting the same error. I couldn't find the
suitable variables at https://www.gnu.org/software/
automake/manual/automake.html#Program-and-Library-Variables to accomplish
my needs.
Any help/advice?
Thanks,
cvin
Basin Ilya
2018-02-15 13:49:29 UTC
Permalink
I've tested your rules. Simply remove the double quotes surrounding the OBJS value and it will work.
Post by Basin Ilya
Please try to add
to your Makefile.am
Post by sea star
Hi,
I have a set of object files built by libool and other set of object files
that are not built by libool. The non-libtool object files are created
outside of my project to which I have limited access.
objdir=/nfsmnt/projx/build/release/
OBJS="$(objdir)/bar.o $(testdir)/foo.o"
testSDB_SOURCES = $(testdir)/testSDB.cpp
testSDB_LDADD = $(test_LIBS) $(OBJS) -lboost_system -lboost_thread
testSDB_CPPFLAGS = $(SDB_FLAGS) $(CLIENT_FLAGS) $(SERVER_INCS)
At the time of linking, I'm getting the following make error and it
complains that there is no make target for object files defined in OBJS.
make: *** No rule to make target `"/nfsmnt/projx/build/release/bar.o',
needed by `testSDB'. Stop.
Is there a way stop "make" looking for rule skip building bar.o/foo.o
instead just use the pre-built non-libtool object files during linking? If
so, how do I do that?
I tried specifying OBJS in testSDB_Dependencies(testSDB_DEPENDENCIES=
$(OBJS)), but I was still getting the same error. I couldn't find the
suitable variables at https://www.gnu.org/software/
automake/manual/automake.html#Program-and-Library-Variables to accomplish
my needs.
Any help/advice?
Thanks,
cvin
sea star
2018-03-09 20:04:38 UTC
Permalink
Thanks Basin. Yes, it works.

-Thanks
cvin
Post by Basin Ilya
I've tested your rules. Simply remove the double quotes surrounding the
OBJS value and it will work.
Post by Basin Ilya
Please try to add
to your Makefile.am
Post by sea star
Hi,
I have a set of object files built by libool and other set of object
files
Post by Basin Ilya
Post by sea star
that are not built by libool. The non-libtool object files are created
outside of my project to which I have limited access.
objdir=/nfsmnt/projx/build/release/
OBJS="$(objdir)/bar.o $(testdir)/foo.o"
testSDB_SOURCES = $(testdir)/testSDB.cpp
testSDB_LDADD = $(test_LIBS) $(OBJS) -lboost_system -lboost_thread
testSDB_CPPFLAGS = $(SDB_FLAGS) $(CLIENT_FLAGS) $(SERVER_INCS)
At the time of linking, I'm getting the following make error and it
complains that there is no make target for object files defined in OBJS.
make: *** No rule to make target `"/nfsmnt/projx/build/release/bar.o',
needed by `testSDB'. Stop.
Is there a way stop "make" looking for rule skip building bar.o/foo.o
instead just use the pre-built non-libtool object files during linking?
If
Post by Basin Ilya
Post by sea star
so, how do I do that?
I tried specifying OBJS in testSDB_Dependencies(testSDB_DEPENDENCIES=
$(OBJS)), but I was still getting the same error. I couldn't find the
suitable variables at https://www.gnu.org/software/
automake/manual/automake.html#Program-and-Library-Variables to
accomplish
Post by Basin Ilya
Post by sea star
my needs.
Any help/advice?
Thanks,
cvin
Loading...