473,402 Members | 2,046 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,402 software developers and data experts.

Makefile for C++ program

Hi

I have downloaded a program that is written in C++ that I would like to
compile into a Win XP executable.
The program contains a Makefile written for Unix/linux/cygwin.
I would like to modify it, if neccessary, so that I can compile it using MS
Visual C++ 6.0.
Here is the code for the Makefile:

//START
CC = /bin/g++ -Winline -Wall -Wno-sign-compare

VIENNA = vienna

COPT = -include Alignment_prefix.h -I$(VIENNA)
LDFLAGS = $(COPT) -L$(VIENNA)
LIBS = -lRNA

SOURCES = main.cpp \
AlignmentManager.cpp \
Alphabet.cpp \
DistanceTable.cpp \
Profile.cpp \
ProfileDistanceTable.cpp \
Sequence.cpp \
Region.cpp \
ViennaLib.cpp

#OBJECTS = vienna/fold.o vienna/RNAstruct.o vienna/fold_vars.h

all: viennalib align_with_log

viennalib:
cd vienna; $(MAKE)

align_with_log:
$(CC) $(SOURCES) -o ../rnaprofile $(LDFLAGS) $(LIBS)

clean:
cd vienna; $(MAKE) clean
//END

I suspect that all I need to do is remove the first line that says, "CC =
/bin/g++ -Winline -Wall -Wno-sign-compare", as Visual C++ already has a
compiler, and should know where it is. How do I get get Visual C++ to use
this Makefile to compile into a Win XP executable?

Any help much appreciated.

Cheers
Sharp Tool

Aug 5 '05 #1
4 2885
You will probably not find any help on this newsgroup since it is geared
towards standard C++ language questions only.

I suggest you ask on the microsoft VC++ forum. Maybe this one:
microsoft.public.vstudio.general

--John Ratliff
Aug 5 '05 #2
You will probably not find any help on this newsgroup since it is geared
towards standard C++ language questions only.

I suggest you ask on the microsoft VC++ forum. Maybe this one:
microsoft.public.vstudio.general

--John Ratliff


Thanks John

I will keep an eye out anyway in hope that someone might be able to help me
out.

Cheers
Sharp tool

Aug 5 '05 #3
* Sharp Tool:

I have downloaded a program that is written in C++ that I would like to
compile into a Win XP executable.
The program contains a Makefile written for Unix/linux/cygwin.
I would like to modify it, if neccessary, so that I can compile it using MS
Visual C++ 6.0.
Better use e.g. g++ or Visual C++ 7.1 (which is a free download). Visual
C++ 6.0 is an old compiler that's non-standard in many respects.

Also, instead of struggling with 'make', which isn't one standard but a
number of different but somewhat similar tools, try out e.g. 'jam'.

The Boost library uses a version of 'jam', <url:
http://www.boost.org/tools/build/jam_src/index.html>.

Here is the code for the Makefile:

//START
CC = /bin/g++ -Winline -Wall -Wno-sign-compare
You'll have to change this definition, both the compiler invocation and the
options, corresponding to the compiler you'll be using.

VIENNA = vienna

COPT = -include Alignment_prefix.h -I$(VIENNA)
Ditto.

LDFLAGS = $(COPT) -L$(VIENNA)
Ditto.

LIBS = -lRNA
Ditto.

SOURCES = main.cpp \
AlignmentManager.cpp \
Alphabet.cpp \
DistanceTable.cpp \
Profile.cpp \
ProfileDistanceTable.cpp \
Sequence.cpp \
Region.cpp \
ViennaLib.cpp
OK (and this is probably the _only_ rule you don't have to change).

#OBJECTS = vienna/fold.o vienna/RNAstruct.o vienna/fold_vars.h
May have to be changed or not (some compilers use '.obj' file name suffix
for object files).

all: viennalib align_with_log
OS-specific.

viennalib:
cd vienna; $(MAKE)
OS-specific.

align_with_log:
$(CC) $(SOURCES) -o ../rnaprofile $(LDFLAGS) $(LIBS)
Compiler-specific.

clean:
cd vienna; $(MAKE) clean


OS-specific.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Aug 5 '05 #4

"Alf P. Steinbach" <al***@start.no> wrote in message
news:42****************@news.individual.net...
* Sharp Tool:

I have downloaded a program that is written in C++ that I would like to
compile into a Win XP executable.
The program contains a Makefile written for Unix/linux/cygwin.
I would like to modify it, if neccessary, so that I can compile it using MS Visual C++ 6.0.
Better use e.g. g++ or Visual C++ 7.1 (which is a free download). Visual
C++ 6.0 is an old compiler that's non-standard in many respects.

Where can I download Visual C++ 7.1 compiler?

Also, instead of struggling with 'make', which isn't one standard but a
number of different but somewhat similar tools, try out e.g. 'jam'.

The Boost library uses a version of 'jam', <url:
http://www.boost.org/tools/build/jam_src/index.html>.

I will check this out.

Here is the code for the Makefile:

//START
CC = /bin/g++ -Winline -Wall -Wno-sign-compare


You'll have to change this definition, both the compiler invocation and

the options, corresponding to the compiler you'll be using.

This is going to harder than I thought. I have never been taught to use
Makefile. We would just create header and implementation files, one of which
would be the main method, and we would simply compile it using Visual C++
6.0. Now, I have come across this program that uses a Makefile, and I can't
seem to compile without it. Are there any reference for creating a makefile
for WinXP?

Cheers
Sharp tool

Aug 6 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: rick_muller | last post by:
I'm interested in parsing a (simple) Makefile using Python. I need to write a packager for a program I'm supporting, and would like to read the list of files in the makefile so that I only have to...
1
by: Jamie Saker | last post by:
I think I'm overlooking something assumed in socket's makefile method. Googling several hours and digging thru the python reference didn't help - I think I'm overlooking an assumption between...
3
by: Faith | last post by:
any good tips on reading makefiles that were written using C++ ASAP please
2
by: xuatla | last post by:
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"...
5
by: Jacobo Rodriguez Villar | last post by:
Hello, Is there any way (or program) to convert and maintain easily a C++ project (vs7.1) to a Makefile file, in order to build it in Linux? Many thanks -- Jacobo Rodríguez Villar ...
6
by: dolphin | last post by:
Hi! I am learing makefile recently.Now I have a problem. I write a very simple program just like "hello world" I write two makefile for it.One is included in another. the first is makefile...
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...
5
by: M.Liang Liu | last post by:
I have a project with the following dirs: --------------------------------------------------------------------------------------- +src |-proj0 |-program1 |-program2 |-proj1 |-program1...
3
by: gaurav kashyap | last post by:
Hi all, I am using Link-41b parser in my program. The windows version of it has an .exe file that can be executed using os.system command On Linux version,I have a makefile. so my question is:...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.