summaryrefslogtreecommitdiff
path: root/task.cc
diff options
context:
space:
mode:
Diffstat (limited to 'task.cc')
-rw-r--r--task.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/task.cc b/task.cc
index 19e4712..4dcbbd8 100644
--- a/task.cc
+++ b/task.cc
@@ -156,9 +156,16 @@ void Task::start()
if(recompile)
{
- std::string cmd =
- "g++ -MMD -c " + std::string(sourceFile) + " " +
- config.cxxflags + " " +
+ std::string comp = "g++";
+ std::string flags = config.cxxflags;
+ if(std::string(sourceFile.extension()) == ".c")
+ {
+ comp = "gcc";
+ flags = config.cflags;
+ }
+ std::string cmd = comp +
+ " -MMD -c " + std::string(sourceFile) + " " +
+ flags + " " +
"-o " + std::string(targetFile);
std::cout << cmd << "\n";