Mail Archives: djgpp/1996/05/20/23:15:15
Reply to message 9139561 from MARTYNAS.KUNI on 05/20/96 7:40AM
>Everything worked ok. But when I renamed all .cc files to .cpp and changed
>all appearances of .cc in the makefile to .cpp (including .cc.o: ), make
>always goes to the link step, even when there are no .o files at all.
>Just now some idea struck me -- this must have something to do with
>.SUFFIXES, but I thought .cpp was confirmed to be a valid C++ source
>file extension, thus make should recognize it. GCC itself recognizes it,
>though dumps .cc extension to cc1plus. Anyway, I'll read more make docs
>and try the .SUFFIXES stuff at home, but right now if the problem is different
>and someone knows the solution, please let me know.
I think you simply need to put this line in the makefile:
.SUFFIXES: .cpp
to add .cpp to make's list of default suffix rules. If it isn't in there, make
will
take a rule like:
.cpp.o :
as indicating a target of ".cpp.o", instead of the intended expansion.
BTW, if you read up in the make docs, you will see that that form of
declaring an implicit rule is obsolete. You'd get much more reliable
results from make, and avoid having to alter .SUFFIXES, by using:
%.o : %.cpp
hth,
John
- Raw text -