473,385 Members | 1,732 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

which group can i ask for makefile?


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
2 1722
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Efrat Regev | last post by:
Hello, I'd like to ask a question concerning a python script in a makefile. Suppose I have a C++ project (sorry for raising this in a Python newsgroup), with some makefile for it. Before...
3
by: tmponko | last post by:
OK...I'm new to this and I'm sure I'm missing something obvious, so please be kind. I've tried several different approaches to this problem (including various if, ifeq, and case constructs), and...
1
by: Fernando Silva | last post by:
Hello! Because I don't have access to CC compiler I need to change a example Makefile to use gcc (version 2.95.2) in order to compile some code. But until now I didn't had any success in being...
2
by: Juhan Voolaid | last post by:
Hello I need help with my makefile, so that when I compile my project the source code files would be separated from the object (*.o) files. So if I have: main.cpp and classes.cpp - the...
2
by: Ney André de Mello Zunino | last post by:
Hello. I am having trouble building a simple project that uses one of the Standard C++ Library's IO facilities. The following is a stripped-down version that illustrates the problem: ...
1
by: %NAME% | last post by:
I wish to put a number of .db2 scripts in my makefile. However, some of the db2 scripts tries to revoke privileges from users that might do not have that privilege already, thus returns an error...
4
by: Jess | last post by:
Hello, I am now trying to use makefile to compile C++ programs. My makefile looks like: f1.o : f1.cpp h1.h h2.h g++ -c f1.cpp f2.o : f2.cpp h2.h h3.h g++ -c f2.cpp
6
by: ahlongxp | last post by:
socket.makefile() may lose data when "connection reset by peer". and socket.recv() will never lose the data. change the "1" to "0" in the client code to see the difference. confirmed on both...
8
by: xz | last post by:
I am a rookie of C++ and got so confused with the Makefile these days. Could anyone be so kind and give a little sample Makefile for the following particular example? Let's say I have the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.