Make problem with MSVSC++

W

W. Bauer

Dear all

The following makefile

CXX= cl
CXXFLAGS = -c -O2
%.o : %.cc
$(CXX) $(CXXFLAGS) $*.cc
lib: cflow_irr.o
gives, when called with "make lib", the error

NMAKE : fatal error U1073: don't know how to make 'cflow_irr.o'
Using instead the explicit dependency
cflow_irr.o:
$(CXX) $(CXXFLAGS) cflow_irr.cc
it works. This is my first makefile problem, so I would appreciate any
hints. The problem is the more then 100 files need to get compiled.

W. Bauer
 
J

John Harrison

Dear all

The following makefile

CXX= cl
CXXFLAGS = -c -O2
%.o : %.cc
$(CXX) $(CXXFLAGS) $*.cc
lib: cflow_irr.o
gives, when called with "make lib", the error

NMAKE : fatal error U1073: don't know how to make 'cflow_irr.o'
Using instead the explicit dependency
cflow_irr.o:
$(CXX) $(CXXFLAGS) cflow_irr.cc
it works. This is my first makefile problem, so I would appreciate any
hints. The problem is the more then 100 files need to get compiled.

W. Bauer

I think that the syntax for NMAKE is completely different from the syntax
you are used to. But in any case for help with NMAKE ask on a Windows
programming group such as or
maybe You are off topic here.

But they'll probably tell you to forget about makefiles and create a project
instead.

john
 
W

W. Bauer

(e-mail address removed) (John Harrison) wrote in
You are off topic here.
Sorry!

But they'll probably tell you to forget about makefiles and create a
project instead.

I hope not.

W. Bauer
 
M

Marc

W. Bauer said:
%.o : %.cc
$(CXX) $(CXXFLAGS) $*.cc

This is a GNUism. The regular unix way to do this is :
..cc.o:
$(CXX) $(CXXFLAGS) $<

you may also need to add a line: ".SUFFIXES: .cc .o", I do not remember
what the default list is supposed to be.

I do not know about nmake in particular, but you are more likely to have
the standard syntax work than an extension.
 
W

W. Bauer

.cc.o:
$(CXX) $(CXXFLAGS) $<

you may also need to add a line: ".SUFFIXES: .cc .o", I do not remember


Many thanks, that works. Actually, both
$(CXX) $(CXXFLAGS) $*.cc
and
$(CXX) $(CXXFLAGS) $<
work with nmake of MSVC++

Many thanks for the help, W. Bauer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top