summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalUnixMakefileGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2004-08-05 14:17:26 (GMT)
committerBrad King <brad.king@kitware.com>2004-08-05 14:17:26 (GMT)
commit46418e70a3a20744ad7ede40bfdbc41a67646831 (patch)
treeeb64c4784ef14ae2fdbed92c38e9d8be55ab773a /Source/cmLocalUnixMakefileGenerator.cxx
parentaa1b32218a0664242ebd2ba988194f98026b88ac (diff)
downloadCMake-46418e70a3a20744ad7ede40bfdbc41a67646831.zip
CMake-46418e70a3a20744ad7ede40bfdbc41a67646831.tar.gz
CMake-46418e70a3a20744ad7ede40bfdbc41a67646831.tar.bz2
BUG#427: Generated makefiles need to have targets with canonical names for each executable and library target in order for try-compiles to work correctly when specifying the target.
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator.cxx')
-rw-r--r--Source/cmLocalUnixMakefileGenerator.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx
index 7624136..16724f5 100644
--- a/Source/cmLocalUnixMakefileGenerator.cxx
+++ b/Source/cmLocalUnixMakefileGenerator.cxx
@@ -1261,6 +1261,9 @@ void cmLocalUnixMakefileGenerator::OutputLibraryRule(std::ostream& fout,
depend.c_str(),
commands);
}
+
+ // Add a target with the canonical name (no prefix, suffix or path).
+ this->OutputMakeRule(fout, comment, name, tgt.c_str(), 0);
}
void cmLocalUnixMakefileGenerator::OutputSharedLibraryRule(std::ostream& fout,
@@ -1537,6 +1540,15 @@ void cmLocalUnixMakefileGenerator::OutputExecutableRule(std::ostream& fout,
depend.c_str(),
commands);
}
+
+ // Add a target with the canonical name (no prefix, suffix or path).
+ // Note that on some platforms the "local target" added above will
+ // actually be the canonical name and will have set "target"
+ // correctly. Do not duplicate this target.
+ if(target != name)
+ {
+ this->OutputMakeRule(fout, comment.c_str(), name, target.c_str(), 0);
+ }
}