diff --git a/CMakeRules.make.in b/CMakeRules.make.in index 6e1b50c07..3a8e2491b 100644 --- a/CMakeRules.make.in +++ b/CMakeRules.make.in @@ -18,7 +18,7 @@ depend: ${CMAKE} ${SUBDIR_DEPEND} clean: ${SUBDIR_CLEAN} - rm -f ${SRC_OBJ} ${EXECUTABLES} + rm -f ${SRC_OBJ} ${EXECUTABLES} ${TARGETS} CMakeTargets.make: ${CMAKE} ${srcdir}/CMakeLists.txt ${CMAKE} ${currentdir}/CMakeLists.txt -S${currentdir} -O${currentbindir} -H${topdir} -B${CMAKE_CONFIG_DIR} diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx index 60941fead..6575b582c 100644 --- a/Source/cmUnixMakefileGenerator.cxx +++ b/Source/cmUnixMakefileGenerator.cxx @@ -107,6 +107,25 @@ void cmUnixMakefileGenerator::OutputTargetRules(std::ostream& fout) } fout << "\n\n"; } + + // get the classes from the source lists then add them to the SRC_OBJ list + fout << "SRC_OBJ = "; + for(cmTargets::const_iterator l = tgts.begin(); + l != tgts.end(); l++) + { + std::vector classes = + m_Makefile->GetClassesFromSourceLists(l->second.GetSourceLists()); + for(std::vector::iterator i = classes.begin(); + i != classes.end(); i++) + { + if(!i->m_HeaderFileOnly) + { + fout << "\\\n" << i->m_ClassName << ".o "; + } + } + } + fout << "\n\n"; + }