diff options
author | Andrew Gvozdev | 2011-07-02 04:41:56 +0000 |
---|---|---|
committer | Andrew Gvozdev | 2011-07-02 04:41:56 +0000 |
commit | 7867099287697f04cdc64cad3313f3cc424e5d80 (patch) | |
tree | 87e7bdb9f012ef43191de05981096ae337e75de5 /build | |
parent | 24c4f8f836a00eeb77a766f27babf2b0c8578295 (diff) | |
download | org.eclipse.cdt-7867099287697f04cdc64cad3313f3cc424e5d80.tar.gz org.eclipse.cdt-7867099287697f04cdc64cad3313f3cc424e5d80.tar.xz org.eclipse.cdt-7867099287697f04cdc64cad3313f3cc424e5d80.zip |
bug 312835: CDT build settings which are set at the folder level are
ignored in certain situations.
Based on patch from MJ <jensem2@yahoo.com>
Diffstat (limited to 'build')
-rw-r--r-- | build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java | 15 |
1 files changed, 8 insertions, 7 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 45e6bf1bbfb..f73baa7605a 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 @@ -1207,16 +1207,17 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { buffer.append(COMMENT_SYMBOL + WHITESPACE + ManagedMakeMessages.getResourceString(SRC_LISTS) + NEWLINE); buffer.append("-include sources.mk" + NEWLINE); //$NON-NLS-1$ - // add an include for each subdir - buffer.append("-include subdir.mk" + NEWLINE); //$NON-NLS-1$ - - for (IResource res : getSubdirList()) { - IContainer subDir = (IContainer)res; + // Add includes for each subdir in child-subdir-first order (required for makefile rule matching to work). + List<String> subDirList = new ArrayList<String>(); + for (IContainer subDir : getSubdirList()) { IPath projectRelativePath = subDir.getProjectRelativePath(); - if(!projectRelativePath.toString().equals("")) //$NON-NLS-1$ - buffer.append("-include " + escapeWhitespaces(projectRelativePath.toString()) + SEPARATOR + "subdir.mk"+ NEWLINE); //$NON-NLS-1$ //$NON-NLS-2$ + subDirList.add(0, projectRelativePath.toString()); + } + for (String dir : subDirList) { + buffer.append("-include " + escapeWhitespaces(dir) + SEPARATOR + "subdir.mk"+ NEWLINE); //$NON-NLS-1$ //$NON-NLS-2$ } + buffer.append("-include subdir.mk" + NEWLINE); //$NON-NLS-1$ buffer.append("-include objects.mk" + NEWLINE + NEWLINE); //$NON-NLS-1$ |