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

Makefile for C++ program

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
* 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

P: n/a

"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 discussion thread is closed

Replies have been disabled for this discussion.