Moving to c++: no rule to make target file.c needed by file.o

Viewed 1288

I've got a source base in C using autoconf/automake, which now should be compiled using a C++ Compiler.

So I've renamed all files from .c to .cpp and changed all makefiles accordingly. However I get the following error (e.g.):

make[3]: *** No rule to make target 'tmsConfigFiles.c', needed by 'tmsConfigFiles.o'.  Stop.

The Makefile basically consists of

bin_PROGRAMS = configparser

configparser_SOURCES = tmsConfigFiles.cpp tmsMoreFiles.cpp tmsEvenMoreFiles.cpp

AM_CXXFLAGS = -I .. -DSOME_DEFINE -Wall -Wextra -etc

This works for the overwhelming parts of the source code (some of which were cpp from start) but for some files the error message above appears. Did try to clean and autoreconf -is etc. to no avail.

The same revision works on Centos 6, fails sometimes on Centos 7, failes always on my Arch box.

Anyone had a similar bug in autotools or knows a workaround?

2 Answers
Related