From 70b1c522bd45220e815d1cb0fc85f2ca208c5946 Mon Sep 17 00:00:00 2001 From: Andrew Gvozdev Date: Sat, 2 Jul 2011 02:25:38 -0400 Subject: [PATCH] bug 312835: CDT build settings which are set at the folder level are ignored in certain situations - restored reverse sorting plus unit tests adjusted --- .../depCalcProjects/test1DepCalc2/Benchmarks/makefile | 2 +- .../depCalcProjects/test1DepCalc3/Benchmarks/makefile | 2 +- .../test1DepCalcPreBuild/Benchmarks/makefile | 2 +- .../resources/oldTypeProjects/2.1/Benchmarks/makefile | 2 +- .../oldTypeProjects/2.1CPP/Benchmarks/makefile | 2 +- .../test21Projects/multiResConfig/Benchmarks/makefile | 2 +- .../test30Projects/CDTFortranTest2/Benchmarks/makefile | 2 +- .../test30Projects/copyandDeploy/Benchmarks/makefile | 2 +- .../test30Projects/multiResConfig/Benchmarks/makefile | 2 +- .../test with spaces/Benchmarks/makefile | 2 +- .../test30Projects/test30_2/Benchmarks/makefile | 2 +- .../Benchmarks/Test 4.0 ConfigName.Dbg/makefile | 10 +++++----- .../test40Projects/test_40/Benchmarks/dbg 2/makefile | 10 +++++----- .../makegen/gnu/GnuMakefileGenerator.java | 2 ++ 14 files changed, 23 insertions(+), 21 deletions(-) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/depCalcProjects/test1DepCalc2/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/depCalcProjects/test1DepCalc2/Benchmarks/makefile index ca817ed064d..ec879dbab28 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/depCalcProjects/test1DepCalc2/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/depCalcProjects/test1DepCalc2/Benchmarks/makefile @@ -8,9 +8,9 @@ RM := rm # All of the sources participating in the build are defined here -include sources.mk --include subdir.mk -include Sources/sub\ sources/subdir.mk -include Sources/subdir.mk +-include subdir.mk -include objects.mk ifneq ($(MAKECMDGOALS),clean) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/depCalcProjects/test1DepCalc3/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/depCalcProjects/test1DepCalc3/Benchmarks/makefile index bb7df04e72c..ab37fe11c88 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/depCalcProjects/test1DepCalc3/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/depCalcProjects/test1DepCalc3/Benchmarks/makefile @@ -8,9 +8,9 @@ RM := rm # All of the sources participating in the build are defined here -include sources.mk --include subdir.mk -include Sources/sub\ sources/subdir.mk -include Sources/subdir.mk +-include subdir.mk -include objects.mk ifneq ($(MAKECMDGOALS),clean) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/depCalcProjects/test1DepCalcPreBuild/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/depCalcProjects/test1DepCalcPreBuild/Benchmarks/makefile index fe04e748726..d6a77e7b69f 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/depCalcProjects/test1DepCalcPreBuild/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/depCalcProjects/test1DepCalcPreBuild/Benchmarks/makefile @@ -8,9 +8,9 @@ RM := rm # All of the sources participating in the build are defined here -include sources.mk --include subdir.mk -include Sources/sub\ sources/subdir.mk -include Sources/subdir.mk +-include subdir.mk -include objects.mk ifneq ($(MAKECMDGOALS),clean) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1/Benchmarks/makefile index 038b91e1fe5..daf3ddba611 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1/Benchmarks/makefile @@ -8,8 +8,8 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk --include subdir.mk -include Functions/subdir.mk +-include subdir.mk -include objects.mk ifneq ($(MAKECMDGOALS),clean) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Benchmarks/makefile index af08b211a27..f8e1db9fe0b 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.1CPP/Benchmarks/makefile @@ -8,8 +8,8 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk --include subdir.mk -include Functions/subdir.mk +-include subdir.mk -include objects.mk ifneq ($(MAKECMDGOALS),clean) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/makefile index 84038314cd9..b3ff9638b40 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/multiResConfig/Benchmarks/makefile @@ -8,10 +8,10 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk --include subdir.mk -include source2/source21/subdir.mk -include source2/subdir.mk -include source1/subdir.mk +-include subdir.mk -include objects.mk ifneq ($(MAKECMDGOALS),clean) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/CDTFortranTest2/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/CDTFortranTest2/Benchmarks/makefile index dac8cf094f6..1494f91eb4d 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/CDTFortranTest2/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/CDTFortranTest2/Benchmarks/makefile @@ -8,9 +8,9 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk --include subdir.mk -include module/subdir.mk -include Sources/subdir.mk +-include subdir.mk -include objects.mk -include ../makefile.defs diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/copyandDeploy/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/copyandDeploy/Benchmarks/makefile index b529f504995..f5c7a35d105 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/copyandDeploy/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/copyandDeploy/Benchmarks/makefile @@ -8,8 +8,8 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk --include subdir.mk -include Functions/subdir.mk +-include subdir.mk -include objects.mk ifneq ($(MAKECMDGOALS),clean) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/multiResConfig/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/multiResConfig/Benchmarks/makefile index cb444208e33..9019ba02cc1 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/multiResConfig/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/multiResConfig/Benchmarks/makefile @@ -8,10 +8,10 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk --include subdir.mk -include source2/source21/subdir.mk -include source2/subdir.mk -include source1/subdir.mk +-include subdir.mk -include objects.mk ifneq ($(MAKECMDGOALS),clean) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test with spaces/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test with spaces/Benchmarks/makefile index 175913b7db4..93013536cd6 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test with spaces/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test with spaces/Benchmarks/makefile @@ -8,8 +8,8 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk --include subdir.mk -include sub\ folder\ with\ spaces/subdir.mk +-include subdir.mk -include objects.mk ifneq ($(MAKECMDGOALS),clean) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test30_2/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test30_2/Benchmarks/makefile index 65717c42e50..8d9479bd03c 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test30_2/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test30_2/Benchmarks/makefile @@ -8,8 +8,8 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk --include subdir.mk -include ABC/subdir.mk +-include subdir.mk -include objects.mk -include ../makefile.defs diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test40Projects/test_40/Benchmarks/Test 4.0 ConfigName.Dbg/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test40Projects/test_40/Benchmarks/Test 4.0 ConfigName.Dbg/makefile index cd8da22cb2a..b65df3e00e1 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test40Projects/test_40/Benchmarks/Test 4.0 ConfigName.Dbg/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test40Projects/test_40/Benchmarks/Test 4.0 ConfigName.Dbg/makefile @@ -8,15 +8,15 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk --include subdir.mk -include dir1/dd/ff/subdir.mk --include dir1/dd/excluded_c/subdir.mk -include dir1/dd/excluded_c/asd/subdir.mk --include d1_1/subdir.mk +-include dir1/dd/excluded_c/subdir.mk -include d1_1/d2_1/subdir.mk --include d1/subdir.mk --include d1/d2/subdir.mk +-include d1_1/subdir.mk -include d1/d2/d3/subdir.mk +-include d1/d2/subdir.mk +-include d1/subdir.mk +-include subdir.mk -include objects.mk ifneq ($(MAKECMDGOALS),clean) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test40Projects/test_40/Benchmarks/dbg 2/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test40Projects/test_40/Benchmarks/dbg 2/makefile index b75363e252c..791ddb26174 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test40Projects/test_40/Benchmarks/dbg 2/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test40Projects/test_40/Benchmarks/dbg 2/makefile @@ -8,15 +8,15 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk --include subdir.mk -include dir1/dd/ff/subdir.mk --include dir1/dd/excluded_c/subdir.mk -include dir1/dd/excluded_c/asd/subdir.mk --include d1_1/subdir.mk +-include dir1/dd/excluded_c/subdir.mk -include d1_1/d2_1/subdir.mk --include d1/subdir.mk --include d1/d2/subdir.mk +-include d1_1/subdir.mk -include d1/d2/d3/subdir.mk +-include d1/d2/subdir.mk +-include d1/subdir.mk +-include subdir.mk -include objects.mk ifneq ($(MAKECMDGOALS),clean) 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 f73baa7605a..d103f8f4d43 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 @@ -22,6 +22,7 @@ import java.io.Reader; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; @@ -1214,6 +1215,7 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { if(!projectRelativePath.toString().equals("")) //$NON-NLS-1$ subDirList.add(0, projectRelativePath.toString()); } + Collections.sort(subDirList, Collections.reverseOrder()); for (String dir : subDirList) { buffer.append("-include " + escapeWhitespaces(dir) + SEPARATOR + "subdir.mk"+ NEWLINE); //$NON-NLS-1$ //$NON-NLS-2$ }