From 278bcbd7be5ff39973221a5cb7bebcbc02e943f9 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 2 Mar 2001 16:04:26 -0500 Subject: [PATCH] ENH: Added custom rule support to cmUnixMakefileGenerator. --- Source/cmUnixMakefileGenerator.cxx | 22 ++++++++++++++++++++++ Source/cmUnixMakefileGenerator.h | 1 + 2 files changed, 23 insertions(+) diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx index c5445f8bc..84fa09210 100644 --- a/Source/cmUnixMakefileGenerator.cxx +++ b/Source/cmUnixMakefileGenerator.cxx @@ -59,6 +59,7 @@ void cmUnixMakefileGenerator::OutputMakefile(const char* file) this->OutputExecutableRules(fout); this->OutputSubDirectoryRules(fout); this->OutputDepends(fout); + this->OutputCustomRules(fout); } // Output the LIBRARY and SRC_OBJS list based on @@ -366,3 +367,24 @@ void cmUnixMakefileGenerator::OutputDepends(std::ostream& fout) } } } + + +// Output each custom rule in the following format: +// m_Result: m_Depends[0] m_Depends[1] ... +// (tab) m_Command +void cmUnixMakefileGenerator::OutputCustomRules(std::ostream& fout) +{ + for(std::vector::const_iterator c = + m_Makefile->GetCustomCommands().begin(); + c != m_Makefile->GetCustomCommands().end(); ++c) + { + fout << c->m_Result.c_str() << ":"; + for(std::vector::const_iterator d = c->m_Depends.begin(); + d != c->m_Depends.end(); ++ d) + { + fout << " " << d->c_str(); + } + fout << "\n\t" << c->m_Command.c_str() << "\n\n"; + } + +} diff --git a/Source/cmUnixMakefileGenerator.h b/Source/cmUnixMakefileGenerator.h index d956a47b9..0a5b17a93 100644 --- a/Source/cmUnixMakefileGenerator.h +++ b/Source/cmUnixMakefileGenerator.h @@ -49,6 +49,7 @@ protected: void OutputSubDirectoryRules(std::ostream&); void OutputDependInformation(std::ostream&); void OutputDependLibraries(std::ostream&); + void OutputCustomRules(std::ostream&); }; #endif