Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorSean Evoy2004-08-16 13:50:55 -0400
committerSean Evoy2004-08-16 13:50:55 -0400
commitaf2454ec9894f193ade067334b4e37aa726ef0ea (patch)
tree7d2d9f35cdb43e309a16ce829afdb441a603afd0 /build
parent5a650d1e6e4abf6e3c3dfcd5c28c9e9bd7201c82 (diff)
downloadorg.eclipse.cdt-af2454ec9894f193ade067334b4e37aa726ef0ea.tar.gz
org.eclipse.cdt-af2454ec9894f193ade067334b4e37aa726ef0ea.tar.xz
org.eclipse.cdt-af2454ec9894f193ade067334b4e37aa726ef0ea.zip
Fix for bugzilla 70491 -- Unable to build source files in a linked directory
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java28
1 files changed, 26 insertions, 2 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java
index f6c03a02f55..ab2d934bfe9 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java
@@ -331,9 +331,33 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
String depFile = relativePath + resourceName + DOT + DEP_EXT;
getDependencyMakefiles().add(depFile);
}
+
+ /*
+ * fix for PR 70491
+ * We need to check if the current resource is LINKED, because
+ * the default CDT doesn't handle this properly. If it IS linked,
+ * then we must get the actual location of the resource, rather
+ * than the relative path.
+ */
+ IPath resourceLocation = resource.getLocation();
+ String projectLocation = project.getLocation().toString();
+ String resourcePath = null;
+ String buildRule = null;
+ // figure out path to use to resource
+ if(!resourceLocation.toString().startsWith(projectLocation)) {
+ // it IS linked, so use the actual location
+ resourcePath = resourceLocation.toString();
+ // Need a hardcoded rule, not a pattern rule, as a linked file
+ // can reside in any path
+ buildRule = relativePath + resourceName + DOT + outputExtension + COLON + WHITESPACE + resourcePath;
+ } else {
+ // use the relative path (not really needed to store per se but in the future someone may want this)
+ resourcePath = relativePath;
+ // The rule and command to add to the makefile
+ buildRule = relativePath + WILDCARD + DOT + outputExtension + COLON + WHITESPACE + ROOT + SEPARATOR + resourcePath + WILDCARD + DOT + inputExtension;
+ } // end fix for PR 70491
- // Add the rule and command to the makefile
- String buildRule = relativePath + WILDCARD + DOT + outputExtension + COLON + WHITESPACE + ROOT + SEPARATOR + relativePath + WILDCARD + DOT + inputExtension;
+ // No duplicates in a makefile
if (getRuleList().contains(buildRule)) {
return;
}

Back to the top