By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,952 Members | 1,592 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,952 IT Pros & Developers. It's quick & easy.

which group can i ask for makefile?

P: n/a

Is it off-topic here or not? If not, please help me. Thanks in advance.

X

--------------------

I have main.cpp, tfunclib.cpp in the current folder (same as makefile),
and "library files" vmclass.cpp, tclass.cpp, newtonsolver.cpp in another
folder (mentioned below as OBJDIR). i compile those "library files" and
it's ok.
now i want to make main.cpp in the current folder. how can i specify the
director to the makefile so that it knows where i put the library files?

I got the following msg for output:
--------------------
make: *** No rule to make target `tclass.cpp', needed by `tclass.o'. Stop.
--------------------

and my source code of makefile below:

--------------------
TARGET = main

OBJDIR = /home1/user/personal/program/cpplibrary/standard

OBJ = main.o tfunclib.o tclass.o vmclass.o newtonsolver.o

CL = g++

INCLUDEDIR = -I/home1/user/personal/program/cpplibrary/standard

$(TARGET) : $(OBJ)
$(CL) -o $(TARGET) $(OBJ)

main.o : main.cpp
$(CL) -c $(INCLUDEDIR) main.cpp

tfunclib.o : tfunclib.cpp
$(CL) -c $(INCLUDEDIR) tfunclib.cpp

$(OBJDIR)/vmclass.o: $(OBJDIR)/vmclass.cpp $(OBJDIR)/vmclass.h
$(CL) -c $(INCLUDEDIR) $(OBJDIR)/vmclass.cpp \
-o $(OBJDIR)/vmclass.o

$(OBJDIR)/tclass.o : tclass.cpp tclass.h
$(CL) -c $(INCLUDEDIR) $(OBJDIR)/tclass.cpp \
-o $(OBJDIR)/tclass.o

$(OBJDIR)/newtonsolver.o : newtonsolver.cpp newtonsolver.h
$(CL) -c $(INCLUDEDIR) $(OBJDIR)/newtonsolver.cpp \
-o $(OBJDIR)/newtonsolver.o

..PHONY : clean
clean:
rm $(TARGET) $(OBJ)

# END OF MAKEFILE
Jul 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Wed, 14 Jul 2004 13:29:08 -0700, xuatla <xu****@gmail.com> wrote:

Is it off-topic here or not? If not, please help me. Thanks in advance.

It's off topic, but see below.

X

--------------------

I have main.cpp, tfunclib.cpp in the current folder (same as makefile),
and "library files" vmclass.cpp, tclass.cpp, newtonsolver.cpp in another
folder (mentioned below as OBJDIR). i compile those "library files" and
it's ok.
now i want to make main.cpp in the current folder. how can i specify the
director to the makefile so that it knows where i put the library files?

I got the following msg for output:
--------------------
make: *** No rule to make target `tclass.cpp', needed by `tclass.o'.
Stop.
--------------------

and my source code of makefile below:

--------------------
TARGET = main

OBJDIR = /home1/user/personal/program/cpplibrary/standard

OBJ = main.o tfunclib.o tclass.o vmclass.o newtonsolver.o


I could easily be wrong but the obvious thing to me would be to replace

OBJ = main.o tfunclib.o tclass.o vmclass.o newtonsolver.o

with

OBJ = main.o tfunclib.o $(OBJDIR)/tclass.o $(OBJDIR)/vmclass.o
$(OBJDIR)/newtonsolver.o

but that's just a guess.

If that doesn't help try a group with linux and development in its name,
e.g. news:comp.os.linux.development.apps They should know about gnu make.

john
Jul 22 '05 #2

P: n/a
thank you!
it really works. i will try other related group next time.

X

John Harrison wrote:
On Wed, 14 Jul 2004 13:29:08 -0700, xuatla <xu****@gmail.com> wrote:

Is it off-topic here or not? If not, please help me. Thanks in advance.


It's off topic, but see below.

X

--------------------

I have main.cpp, tfunclib.cpp in the current folder (same as
makefile), and "library files" vmclass.cpp, tclass.cpp,
newtonsolver.cpp in another folder (mentioned below as OBJDIR). i
compile those "library files" and it's ok.
now i want to make main.cpp in the current folder. how can i specify
the director to the makefile so that it knows where i put the library
files?

I got the following msg for output:
--------------------
make: *** No rule to make target `tclass.cpp', needed by `tclass.o'.
Stop.
--------------------

and my source code of makefile below:

--------------------
TARGET = main

OBJDIR = /home1/user/personal/program/cpplibrary/standard

OBJ = main.o tfunclib.o tclass.o vmclass.o newtonsolver.o


I could easily be wrong but the obvious thing to me would be to replace

OBJ = main.o tfunclib.o tclass.o vmclass.o newtonsolver.o

with

OBJ = main.o tfunclib.o $(OBJDIR)/tclass.o $(OBJDIR)/vmclass.o
$(OBJDIR)/newtonsolver.o

but that's just a guess.

If that doesn't help try a group with linux and development in its
name, e.g. news:comp.os.linux.development.apps They should know about
gnu make.

john

Jul 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.