make problem w/ implicit rules

Ed Hourigan ehouriga@dreamscape.com
Sat May 13 07:09:00 GMT 2000


I am new to the cygwin version of gcc/g++.  I have used gcc/g++ under Unix
for several
years.  In a typical Unix makefile, you can have implicit rules like this:

.SUFFIXES: .cpp .o

# rule to make a .o from a .cpp file

.cpp.o:
      g++ $(FLAGS) -c $<


This allows you to add source files to your project w/out having to add an
explicit rule for each source file.  All you have to do is update the list
of object
files (.o) in the makefile.

However, this doesn't seem to be supported or work under the cygwin version
of make.   Is there something I need to configure?  I took a simple makefile
from a Linux machine and moved it onto a PC w/ cygwin installed (along with
source .cpp files)
and I cannot make/build the project anymore.  The error I get is:

make: ** No rule to make target 'main.o' needed by 'testit'. Stop


The makefile doesn't have an explicit rule for main.o.  Under Linux, it uses
the
implicit rule to take the source file main.cpp and compile it into main.o



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



More information about the Cygwin mailing list