From 2a669100f00eb9406ceb9ccad88182f701a4ea47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Svensson?= Date: Wed, 19 Jan 2022 16:50:24 +0100 Subject: [PATCH] Bug 577263: CommandGenerator not respected for option value type libs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Contributed by STMicroelectronics Change-Id: I2c332eb40b6b69aff405c2c7c86cdcd4acaf5d19 Signed-off-by: Torbjörn Svensson Also-By: Erik Hentschke Also-By: John Dallaway --- .../META-INF/MANIFEST.MF | 2 +- .../test1DepCalc2/Benchmarks/makefile | 3 +- .../test1DepCalc3/Benchmarks/makefile | 3 +- .../test1DepCalcPreBuild/Benchmarks/makefile | 3 +- .../oldTypeProjects/1.2/Benchmarks/makefile | 3 +- .../oldTypeProjects/2.0/Benchmarks/makefile | 3 +- .../oldTypeProjects/2.1/Benchmarks/makefile | 3 +- .../2.1CPP/Benchmarks/makefile | 3 +- .../linkedFolder/Benchmarks/makefile | 3 +- .../linkedLib/Benchmarks/makefile | 3 +- .../multiResConfig/Benchmarks/makefile | 3 +- .../singleFileExe/Benchmarks/makefile | 3 +- .../twoFileSO/Benchmarks/makefile | 3 +- .../CDTFortranTest1/Benchmarks/makefile | 3 +- .../CDTFortranTest2/Benchmarks/makefile | 3 +- .../TestATO/Benchmarks/makefile | 3 +- .../copyandDeploy/Benchmarks/makefile | 5 +- .../deleteFile/Benchmarks/makefile | 3 +- .../inputTypeOption/Benchmarks/makefile | 3 +- .../linkedFolder/Benchmarks/makefile | 3 +- .../linkedLib30/Benchmarks/makefile | 3 +- .../multiResConfig/Benchmarks/makefile | 3 +- .../preAndPostBuildSteps/Benchmarks/makefile | 3 +- .../rcbsBasicTest/Benchmarks/makefile | 3 +- .../singleFileExe/Benchmarks/makefile | 3 +- .../test with spaces/Benchmarks/makefile | 3 +- .../test30_1/Benchmarks/makefile | 5 +- .../test30_2/Benchmarks/makefile | 9 +- .../Benchmarks/makefile | 3 +- .../Benchmarks/makefile | 3 +- .../twoFileSO/Benchmarks/makefile | 3 +- .../Test 4.0 ConfigName.Dbg/makefile | 5 +- .../Test 4.0 ConfigName.Dbg/objects.mk | 4 +- .../test_40/Benchmarks/dbg 2/makefile | 5 +- .../test_40/Benchmarks/dbg 2/objects.mk | 4 +- .../testplugin/AbstractBuilderTest.java | 1 - .../core/tests/BuildSystem40Tests.java | 4 +- ...ManagedBuildDependencyCalculatorTests.java | 12 +-- .../ManagedCommandLineGeneratorTest.java | 69 ++++++++---- .../tests/ManagedProject21MakefileTests.java | 22 ++-- .../tests/ManagedProject30MakefileTests.java | 89 ++++++++------- .../core/tests/ManagedProjectUpdateTests.java | 18 ++-- .../META-INF/MANIFEST.MF | 2 +- .../cdt/managedbuilder/core/ITool.java | 7 ++ .../core/ManagedCommandLineGenerator.java | 17 +++ .../managedbuilder/internal/core/Tool.java | 102 +++++++++++++++++- .../makegen/gnu2/GnuMakefileGenerator.java | 91 ++++------------ 47 files changed, 309 insertions(+), 245 deletions(-) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/META-INF/MANIFEST.MF b/build/org.eclipse.cdt.managedbuilder.core.tests/META-INF/MANIFEST.MF index 2b8134ae390..9d06cc089b6 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/META-INF/MANIFEST.MF +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.core.tests; singleton:=true -Bundle-Version: 8.2.100.qualifier +Bundle-Version: 8.2.200.qualifier Bundle-Activator: org.eclipse.cdt.managedbuilder.testplugin.CTestPlugin Bundle-Vendor: %providerName Bundle-Localization: plugin 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 867d5eea260..647b5f43687 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 @@ -11,7 +11,6 @@ RM := rm -include Sources/sub\ sources/subdir.mk -include Sources/subdir.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C_DEPS)),) @@ -41,7 +40,7 @@ all: main-build main-build: test1DepCalc2 # Tool invocations -test1DepCalc2: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +test1DepCalc2: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: GCC C Linker' gcc -o "test1DepCalc2" $(OBJS) $(USER_OBJS) $(LIBS) 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 ce91d300eed..83ab62c47a5 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 @@ -11,7 +11,6 @@ RM := rm -include Sources/sub\ sources/subdir.mk -include Sources/subdir.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C_DEPS)),) @@ -41,7 +40,7 @@ all: main-build main-build: test1DepCalc3 # Tool invocations -test1DepCalc3: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +test1DepCalc3: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: GCC C Linker' gcc -o "test1DepCalc3" $(OBJS) $(USER_OBJS) $(LIBS) 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 c43b7e8364d..ac4945ba609 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 @@ -11,7 +11,6 @@ RM := rm -include Sources/sub\ sources/subdir.mk -include Sources/subdir.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C_DEPS)),) @@ -41,7 +40,7 @@ all: main-build main-build: test1DepCalcPreBuild # Tool invocations -test1DepCalcPreBuild: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +test1DepCalcPreBuild: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: GCC C Linker' gcc -o "test1DepCalcPreBuild" $(OBJS) $(USER_OBJS) $(LIBS) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/Benchmarks/makefile index 455f0590dc4..52846ad0ca0 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/1.2/Benchmarks/makefile @@ -9,7 +9,6 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C++_DEPS)),) @@ -54,7 +53,7 @@ all: main-build main-build: test12.exe # Tool invocations -test12.exe: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +test12.exe: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: Cygwin C++ Linker' g++ -o "test12.exe" $(OBJS) $(USER_OBJS) $(LIBS) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/Benchmarks/makefile index 7b951a24a2a..815689a4bf6 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/oldTypeProjects/2.0/Benchmarks/makefile @@ -9,7 +9,6 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C++_DEPS)),) @@ -54,7 +53,7 @@ all: main-build main-build: test20.exe # Tool invocations -test20.exe: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +test20.exe: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: Cygwin C++ Linker' g++ -o "test20.exe" $(OBJS) $(USER_OBJS) $(LIBS) 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 75e560baa21..e538af20c05 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 @@ -10,7 +10,6 @@ RM := rm -rf -include sources.mk -include Functions/subdir.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C_DEPS)),) @@ -40,7 +39,7 @@ all: main-build main-build: MBS2dot1.exe # Tool invocations -MBS2dot1.exe: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +MBS2dot1.exe: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: GCC C Linker' gcc -o "MBS2dot1.exe" $(OBJS) $(USER_OBJS) $(LIBS) 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 e84c3ff0165..72baa7f19f5 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 @@ -10,7 +10,6 @@ RM := rm -rf -include sources.mk -include Functions/subdir.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C++_DEPS)),) @@ -55,7 +54,7 @@ all: main-build main-build: Test21CXX # Tool invocations -Test21CXX: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +Test21CXX: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: GCC C++ Linker' g++ -o "Test21CXX" $(OBJS) $(USER_OBJS) $(LIBS) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedFolder/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedFolder/Benchmarks/makefile index b70d1011f70..0de58ca8a20 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedFolder/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedFolder/Benchmarks/makefile @@ -9,7 +9,6 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C_DEPS)),) @@ -39,7 +38,7 @@ all: main-build main-build: liblinkedFolder.a # Tool invocations -liblinkedFolder.a: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +liblinkedFolder.a: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: archiver.gnu' ar -r "liblinkedFolder.a" $(OBJS) $(USER_OBJS) $(LIBS) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/Benchmarks/makefile index e2f0e2aefc8..393dcbbf012 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/linkedLib/Benchmarks/makefile @@ -9,7 +9,6 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C_DEPS)),) @@ -39,7 +38,7 @@ all: main-build main-build: liblinkedLib.a # Tool invocations -liblinkedLib.a: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +liblinkedLib.a: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: archiver.gnu' ar -r "liblinkedLib.a" $(OBJS) $(USER_OBJS) $(LIBS) 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 c39f7b21c33..0eb1f4f0353 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 @@ -12,7 +12,6 @@ RM := rm -rf -include source2/subdir.mk -include source1/subdir.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(CC_DEPS)),) @@ -54,7 +53,7 @@ all: main-build main-build: testResCfg # Tool invocations -testResCfg: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +testResCfg: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: linker.gnu.cpp' g++ --strip-all -o "testResCfg" $(OBJS) $(USER_OBJS) $(LIBS) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/singleFileExe/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/singleFileExe/Benchmarks/makefile index dbce40e3a7f..6247b44b330 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/singleFileExe/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/singleFileExe/Benchmarks/makefile @@ -9,7 +9,6 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C_DEPS)),) @@ -39,7 +38,7 @@ all: main-build main-build: testSingleExe # Tool invocations -testSingleExe: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +testSingleExe: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: linker.gnu.c' gcc -o "testSingleExe" $(OBJS) $(USER_OBJS) $(LIBS) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/Benchmarks/makefile index f6c2c7bcea3..1b7921c3ca3 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test21Projects/twoFileSO/Benchmarks/makefile @@ -9,7 +9,6 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(CC_DEPS)),) @@ -51,7 +50,7 @@ all: main-build main-build: libtestDoubleSO.so # Tool invocations -libtestDoubleSO.so: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +libtestDoubleSO.so: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: linker.gnu.cpp' g++ -shared -o "libtestDoubleSO.so" $(OBJS) $(USER_OBJS) $(LIBS) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/CDTFortranTest1/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/CDTFortranTest1/Benchmarks/makefile index f5f99c8150a..5682e95f052 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/CDTFortranTest1/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/CDTFortranTest1/Benchmarks/makefile @@ -9,7 +9,6 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk -include subdir.mk --include objects.mk -include ../makefile.defs @@ -33,7 +32,7 @@ all: main-build main-build: CDTFortranTest1.exe # Tool invocations -CDTFortranTest1.exe: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +CDTFortranTest1.exe: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: Linker' mylink -o "CDTFortranTest1.exe" $(OBJS) $(USER_OBJS) $(LIBS) 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 92830e5c239..3d87a2d4bc8 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 @@ -10,7 +10,6 @@ RM := rm -rf -include sources.mk -include module/subdir.mk -include Sources/subdir.mk --include objects.mk -include ../makefile.defs @@ -34,7 +33,7 @@ all: main-build main-build: CDTFortranTest2 # Tool invocations -CDTFortranTest2: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +CDTFortranTest2: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: Linker' mylink -o "CDTFortranTest2" $(OBJS) $(USER_OBJS) $(LIBS) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/TestATO/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/TestATO/Benchmarks/makefile index aac2d965dfa..1d1ad19a3bb 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/TestATO/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/TestATO/Benchmarks/makefile @@ -9,7 +9,6 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk -include subdir.mk --include objects.mk -include ../makefile.defs @@ -33,7 +32,7 @@ all: main-build main-build: TestATO.out # Tool invocations -TestATO.out: $(OBJS) $(OPT_SRCS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +TestATO.out: $(OBJS) $(OPT_SRCS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: AssignToOption Executable Linker' ATOL -opt../TestATO1.opt -opt../TestATO2.opt -o "TestATO.out" $(OBJS) 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 ee65c8b1441..6efd87f2eb7 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 @@ -10,7 +10,6 @@ RM := rm -rf -include sources.mk -include Functions/subdir.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C_DEPS)),) @@ -43,14 +42,14 @@ all: main-build main-build: TestCopyandDeploy # Tool invocations -TestCopyandDeploy: $(EXECUTABLES) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +TestCopyandDeploy: $(EXECUTABLES) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: Deploy tool' cp $(EXECUTABLES) "TestCopyandDeploy" @echo 'Finished building target: $@' @echo ' ' -USER_OBJS.foo: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +USER_OBJS.foo: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Invoking: MBS30.linker.gnu.c' gcc -o "USER_OBJS.foo" $(OBJS) $(USER_OBJS) $(LIBS) @echo 'Finished building: $@' diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/deleteFile/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/deleteFile/Benchmarks/makefile index 42f351ebd07..3095d2f5d47 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/deleteFile/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/deleteFile/Benchmarks/makefile @@ -9,7 +9,6 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(CC_DEPS)),) @@ -51,7 +50,7 @@ all: main-build main-build: DeleteFile # Tool invocations -DeleteFile: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +DeleteFile: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: MBS30.linker.gnu.cpp' g++ -o "DeleteFile" $(OBJS) $(USER_OBJS) $(LIBS) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/inputTypeOption/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/inputTypeOption/Benchmarks/makefile index de3bc85ca96..35e7f1196c4 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/inputTypeOption/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/inputTypeOption/Benchmarks/makefile @@ -9,7 +9,6 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C_DEPS)),) @@ -39,7 +38,7 @@ all: main-build main-build: inputTypeOption # Tool invocations -inputTypeOption: $(OBJS) C:\An\ Absolute\ Path\ With\ Spaces\foo.linker $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +inputTypeOption: $(OBJS) C:\An\ Absolute\ Path\ With\ Spaces\foo.linker $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: org.eclipse.cdt.managedbuilder.core.tests.inputTypeOptionMakefileRenderingTest.c.linker' gcc --linkerInputTypeOption="C:\An Absolute Path With Spaces\foo.linker" -o "inputTypeOption" $(OBJS) $(USER_OBJS) $(LIBS) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/Benchmarks/makefile index fa1cd8d7110..98a60b6218c 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedFolder/Benchmarks/makefile @@ -9,7 +9,6 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C_DEPS)),) @@ -39,7 +38,7 @@ all: main-build main-build: liblinkedFolder.a # Tool invocations -liblinkedFolder.a: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +liblinkedFolder.a: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: MBS30.archiver.gnu' ar -r "liblinkedFolder.a" $(OBJS) $(USER_OBJS) $(LIBS) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedLib30/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedLib30/Benchmarks/makefile index 4bf8bfd66b4..409c34d5799 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedLib30/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/linkedLib30/Benchmarks/makefile @@ -9,7 +9,6 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C_DEPS)),) @@ -39,7 +38,7 @@ all: main-build main-build: liblinkedLib.a # Tool invocations -liblinkedLib.a: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +liblinkedLib.a: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: MBS30.archiver.gnu' ar -r "liblinkedLib.a" $(OBJS) $(USER_OBJS) $(LIBS) 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 e6a2b061589..02feb4ba926 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 @@ -12,7 +12,6 @@ RM := rm -rf -include source2/subdir.mk -include source1/subdir.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(CC_DEPS)),) @@ -54,7 +53,7 @@ all: main-build main-build: multiResConfig # Tool invocations -multiResConfig: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +multiResConfig: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: MBS30.linker.gnu.cpp' g++ -o "multiResConfig" $(OBJS) $(USER_OBJS) $(LIBS) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/preAndPostBuildSteps/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/preAndPostBuildSteps/Benchmarks/makefile index fb253a937b3..a37db0b8b3d 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/preAndPostBuildSteps/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/preAndPostBuildSteps/Benchmarks/makefile @@ -9,7 +9,6 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(CC_DEPS)),) @@ -52,7 +51,7 @@ all: main-build: preAndPostBuildSteps # Tool invocations -preAndPostBuildSteps: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +preAndPostBuildSteps: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: MBS30.linker.gnu.cpp' g++ -o "preAndPostBuildSteps" $(OBJS) $(USER_OBJS) $(LIBS) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/rcbsBasicTest/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/rcbsBasicTest/Benchmarks/makefile index 0bd6ef5ca14..778a733b655 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/rcbsBasicTest/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/rcbsBasicTest/Benchmarks/makefile @@ -9,7 +9,6 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C_DEPS)),) @@ -39,7 +38,7 @@ all: main-build main-build: rcbsBasicTest # Tool invocations -rcbsBasicTest: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +rcbsBasicTest: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: MBS30.linker.gnu.c' gcc -o "rcbsBasicTest" $(OBJS) $(USER_OBJS) $(LIBS) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/singleFileExe/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/singleFileExe/Benchmarks/makefile index ac4f80be820..65baeba7a69 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/singleFileExe/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/singleFileExe/Benchmarks/makefile @@ -9,7 +9,6 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C_DEPS)),) @@ -39,7 +38,7 @@ all: main-build main-build: singleFileExe # Tool invocations -singleFileExe: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +singleFileExe: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: MBS30.linker.gnu.c' gcc -o "singleFileExe" $(OBJS) $(USER_OBJS) $(LIBS) 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 ba6dbaa78bc..77591ae44be 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 @@ -10,7 +10,6 @@ RM := rm -rf -include sources.mk -include sub\ folder\ with\ spaces/subdir.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C_DEPS)),) @@ -40,7 +39,7 @@ all: main-build main-build: testwithspaces.exe # Tool invocations -testwithspaces.exe: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +testwithspaces.exe: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: GCC C Linker' gcc -o "testwithspaces.exe" $(OBJS) $(USER_OBJS) $(LIBS) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test30_1/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test30_1/Benchmarks/makefile index 8e6096dd522..643b0864fff 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test30_1/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/test30_1/Benchmarks/makefile @@ -9,7 +9,6 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C_DEPS)),) @@ -45,7 +44,7 @@ all: main-build main-build: Test30_1.so.4.5.6 secondary-outputs # Tool invocations -Test30_1.so.4.5.6: $(EXECUTABLES) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +Test30_1.so.4.5.6: $(EXECUTABLES) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: Deploy tool' cp $(EXECUTABLES) "Test30_1.so.4.5.6" @@ -54,7 +53,7 @@ Test30_1.so.4.5.6: $(EXECUTABLES) makefile objects.mk $(OPTIONAL_TOOL_DEPS) default.so.4.5.6: Test30_1.so.4.5.6 $(EXECUTABLES) -test30_1.so.1.2.3: $(STRIPPEDOBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +test30_1.so.1.2.3: $(STRIPPEDOBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Invoking: MBS30.linker.gnu.c' gcc -shared -Wl,-soname=test30_1.so.1.2.3 -o "test30_1.so.1.2.3" $(STRIPPEDOBJS) @echo 'Finished building: $@' 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 e9104c54817..147f9ceba79 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 @@ -10,7 +10,6 @@ RM := rm -rf -include sources.mk -include ABC/subdir.mk -include subdir.mk --include objects.mk -include ../makefile.defs @@ -49,26 +48,26 @@ all: main-build main-build: test30_2.tmp # Tool invocations -test30_2.tmp: $(LOGFILE) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +test30_2.tmp: $(LOGFILE) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: cat' cat $(LOGFILE) @echo 'Finished building target: $@' @echo ' ' -new.tar: $(CPP_SRCS) $(ASM_SRCS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +new.tar: $(CPP_SRCS) $(ASM_SRCS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Invoking: tar-create' tar -cf new.tar $(CPP_SRCS) $(ASM_SRCS) @echo 'Finished building: $@' @echo ' ' -new.log: $(TAROUT) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +new.log: $(TAROUT) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Invoking: tar-list' tar -tf $(TAROUT) > new.log @echo 'Finished building: $@' @echo ' ' -these file\ names are not in alphabetical order: $(LOGFILE) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +these file\ names are not in alphabetical order: $(LOGFILE) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Invoking: touch' touch -r $(LOGFILE) "these" "file names" "are" "not" "in" "alphabetical" "order" @echo 'Finished building: $@' diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/testFileWithNoExtension/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/testFileWithNoExtension/Benchmarks/makefile index 4ced2c2ff63..2925c1d190c 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/testFileWithNoExtension/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/testFileWithNoExtension/Benchmarks/makefile @@ -9,7 +9,6 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C_DEPS)),) @@ -39,7 +38,7 @@ all: main-build main-build: test.exe # Tool invocations -test.exe: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +test.exe: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: GCC C Linker' gcc -o "test.exe" $(OBJS) $(USER_OBJS) $(LIBS) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/testMacroSupportInBuildDefinitions/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/testMacroSupportInBuildDefinitions/Benchmarks/makefile index 67fdc660708..1cc4d5a8424 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/testMacroSupportInBuildDefinitions/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/testMacroSupportInBuildDefinitions/Benchmarks/makefile @@ -9,7 +9,6 @@ RM := rm # All of the sources participating in the build are defined here -include sources.mk -include subdir.mk --include objects.mk -include ../makefile.defs @@ -33,7 +32,7 @@ all: main-build main-build: testMacroSupportInBuildDefinitions.tar # Tool invocations -testMacroSupportInBuildDefinitions.tar: $(BAR_FILES) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +testMacroSupportInBuildDefinitions.tar: $(BAR_FILES) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: Bar Tool' tar cvf $@ $(BAR_FILES) diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/twoFileSO/Benchmarks/makefile b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/twoFileSO/Benchmarks/makefile index 9f711159432..e66b39f916e 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/twoFileSO/Benchmarks/makefile +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test30Projects/twoFileSO/Benchmarks/makefile @@ -9,7 +9,6 @@ RM := rm -rf # All of the sources participating in the build are defined here -include sources.mk -include subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C_DEPS)),) @@ -39,7 +38,7 @@ all: main-build main-build: libtwoFileSO.SOS # Tool invocations -libtwoFileSO.SOS: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +libtwoFileSO.SOS: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) @echo 'Building target: $@' @echo 'Invoking: MBS30.linker.gnu.c' gcc -shared -o "libtwoFileSO.SOS" $(OBJS) $(USER_OBJS) $(LIBS) 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 40639006c5a..353572bc2fc 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 @@ -16,7 +16,6 @@ RM := rm -rf -include d1/d2/d3/subdir.mk -include d1/d2/subdir.mk -include d1/subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C++_DEPS)),) @@ -61,10 +60,10 @@ all: main-build main-build: test_40 # Tool invocations -test_40: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +test_40: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) uo1 @echo 'Building target: $@' @echo 'Invoking: Test 4.0 ToolName.linker.gnu.cpp' - g++ -Llib/path/1 -o "test_40" $(OBJS) $(USER_OBJS) $(LIBS) + g++ -Llib/path/1 -o "test_40" $(OBJS) $(USER_OBJS) $(LIBS) uo1 -llib1 @echo 'Finished building target: $@' @echo ' ' diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test40Projects/test_40/Benchmarks/Test 4.0 ConfigName.Dbg/objects.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test40Projects/test_40/Benchmarks/Test 4.0 ConfigName.Dbg/objects.mk index e92e39761ba..742c2da043f 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test40Projects/test_40/Benchmarks/Test 4.0 ConfigName.Dbg/objects.mk +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test40Projects/test_40/Benchmarks/Test 4.0 ConfigName.Dbg/objects.mk @@ -2,7 +2,7 @@ # Automatically-generated file. Do not edit! ################################################################################ -USER_OBJS := uo1 +USER_OBJS := -LIBS := -llib1 +LIBS := 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 8f2c8eb4acb..841089e9c43 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 @@ -16,7 +16,6 @@ RM := rm -rf -include d1/d2/d3/subdir.mk -include d1/d2/subdir.mk -include d1/subdir.mk --include objects.mk ifneq ($(MAKECMDGOALS),clean) ifneq ($(strip $(C++_DEPS)),) @@ -61,10 +60,10 @@ all: main-build main-build: test_40 # Tool invocations -test_40: $(OBJS) $(USER_OBJS) makefile objects.mk $(OPTIONAL_TOOL_DEPS) +test_40: $(OBJS) $(USER_OBJS) makefile $(OPTIONAL_TOOL_DEPS) uo2 @echo 'Building target: $@' @echo 'Invoking: Test 4.0 ToolName.linker.gnu.cpp' - g++ -Llib/path/2 -o "test_40" $(OBJS) $(USER_OBJS) $(LIBS) + g++ -Llib/path/2 -o "test_40" $(OBJS) $(USER_OBJS) $(LIBS) uo2 -llib2 @echo 'Finished building target: $@' @echo ' ' diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test40Projects/test_40/Benchmarks/dbg 2/objects.mk b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test40Projects/test_40/Benchmarks/dbg 2/objects.mk index 4df42a24715..742c2da043f 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test40Projects/test_40/Benchmarks/dbg 2/objects.mk +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/resources/test40Projects/test_40/Benchmarks/dbg 2/objects.mk @@ -2,7 +2,7 @@ # Automatically-generated file. Do not edit! ################################################################################ -USER_OBJS := uo2 +USER_OBJS := -LIBS := -llib2 +LIBS := diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/AbstractBuilderTest.java b/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/AbstractBuilderTest.java index 0c29dbb14dd..d0fcc4efed6 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/AbstractBuilderTest.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/suite/org/eclipse/cdt/managedbuilder/testplugin/AbstractBuilderTest.java @@ -219,7 +219,6 @@ public abstract class AbstractBuilderTest { resources.add(buildDir); if (externalBuilder) { resources.add(buildDir.getFile("makefile")); - resources.add(buildDir.getFile("objects.mk")); resources.add(buildDir.getFile("sources.mk")); } for (String obj : objs) { diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/BuildSystem40Tests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/BuildSystem40Tests.java index ce593337ddd..320a0079d60 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/BuildSystem40Tests.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/BuildSystem40Tests.java @@ -69,8 +69,8 @@ public class BuildSystem40Tests extends TestCase { } public void test40() throws Exception { - String[] makefiles = { "makefile", "objects.mk", "sources.mk", "d1/subdir.mk", "d1/d2/subdir.mk", - "d1/d2/d3/subdir.mk", "d1_1/subdir.mk", "d1_1/d2_1/subdir.mk", "dir1/dd/excluded_c/subdir.mk", + String[] makefiles = { "makefile", "sources.mk", "d1/subdir.mk", "d1/d2/subdir.mk", "d1/d2/d3/subdir.mk", + "d1_1/subdir.mk", "d1_1/d2_1/subdir.mk", "dir1/dd/excluded_c/subdir.mk", "dir1/dd/excluded_c/asd/subdir.mk", "dir1/dd/ff/subdir.mk", }; IProject[] projects = createProjects("test_40", null, null, true); ICProjectDescriptionManager mngr = CoreModel.getDefault().getProjectDescriptionManager(); diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildDependencyCalculatorTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildDependencyCalculatorTests.java index f1ce25d3ac6..c9d178f74a2 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildDependencyCalculatorTests.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedBuildDependencyCalculatorTests.java @@ -184,8 +184,8 @@ public class ManagedBuildDependencyCalculatorTests extends TestCase { * test for dependency calculation as a side-effect of compilation */ public void test1DepCalc2() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), Path.fromOSString("subdir.mk"), + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk"), // This file is different using Cygwin vs GCC //Path.fromOSString("main.d"), Path.fromOSString("Sources/subdir.mk"), Path.fromOSString("Sources/func1.d"), @@ -199,8 +199,8 @@ public class ManagedBuildDependencyCalculatorTests extends TestCase { * test for dependency calculation using Echo, a 2nd conmpilation step, and post-processing */ public void test1DepCalc3() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), Path.fromOSString("subdir.mk"), + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk"), // This file is different using Cygwin vs GCC //Path.fromOSString("main.d"), Path.fromOSString("Sources/subdir.mk"), Path.fromOSString("Sources/func1.d"), @@ -214,8 +214,8 @@ public class ManagedBuildDependencyCalculatorTests extends TestCase { * test for dependency calculation that uses a separate, pre-build, step to generate dependency files */ public void test1DepCalcPreBuild() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), Path.fromOSString("subdir.mk"), + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk"), // This file is different using Cygwin vs GCC //Path.fromOSString("main.d"), Path.fromOSString("Sources/subdir.mk"), Path.fromOSString("Sources/func1.d"), diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedCommandLineGeneratorTest.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedCommandLineGeneratorTest.java index 0a14e0c4c37..e46a393145c 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedCommandLineGeneratorTest.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedCommandLineGeneratorTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2011 Intel Corporation and others. + * Copyright (c) 2004, 2022 Intel Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -17,6 +17,7 @@ package org.eclipse.cdt.managedbuilder.core.tests; import java.util.ArrayList; import java.util.Arrays; +import org.eclipse.cdt.managedbuilder.core.BuildException; import org.eclipse.cdt.managedbuilder.core.IConfiguration; import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; import org.eclipse.cdt.managedbuilder.core.IManagedCommandLineGenerator; @@ -42,7 +43,9 @@ public class ManagedCommandLineGeneratorTest extends TestCase { "${COMMAND} ${FLAGS} ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT}", "${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT}", "${COMMAND} ${FLAGS} ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}", + "${COMMAND} ${FLAGS} ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT} ${INPUTS} ${EXTRA_FLAGS}", "${command} ${flags} ${output_flag}${output_prefix}${output} ${WRONG_VAR_NAME}" }; + private static String TEST_TOOL_ID = "test.four.dot.zero.cdt.managedbuild.tool.gnu.c.linker"; private static String COMMAND_VAL = "[command]"; private static String FLAGS_VAL = "[flags]"; private static String[] FLAGS_ARRAY_VAL = FLAGS_VAL.split("\\s"); @@ -51,15 +54,20 @@ public class ManagedCommandLineGeneratorTest extends TestCase { private static String OUTPUT_VAL = "[output]"; private static String INPUTS_VAL = "[inputs]"; private static String[] INPUTS_ARRAY_VAL = INPUTS_VAL.split("\\s"); + private static String[] OBJECTS_ARRAY_VAL = new String[] { "obj0", "obj1" }; + private static String[] LIBRARIES_ARRAY_VAL = new String[] { "lib0", "lib1" }; + private static String EXTRA_FLAGS = "obj0 obj1 -llib0 -llib1"; private static String[] commandLineEtalonesForPatterns = { COMMAND_VAL + " " + FLAGS_VAL + " " + OUTPUT_FLAG_VAL + " " + OUTPUT_PREFIX_VAL + "\"" + OUTPUT_VAL + "\"" - + " " + "\"" + INPUTS_VAL + "\"", + + " " + "\"" + INPUTS_VAL + "\" " + EXTRA_FLAGS, COMMAND_VAL, COMMAND_VAL + " " + FLAGS_VAL, COMMAND_VAL + " " + FLAGS_VAL + " " + OUTPUT_FLAG_VAL, COMMAND_VAL + " " + FLAGS_VAL + " " + OUTPUT_FLAG_VAL + OUTPUT_PREFIX_VAL, COMMAND_VAL + " " + FLAGS_VAL + " " + OUTPUT_FLAG_VAL + OUTPUT_PREFIX_VAL + "\"" + OUTPUT_VAL + "\"", COMMAND_VAL + " " + FLAGS_VAL + " " + OUTPUT_FLAG_VAL + " " + OUTPUT_PREFIX_VAL + "\"" + OUTPUT_VAL + "\"", COMMAND_VAL + " " + FLAGS_VAL + " " + OUTPUT_FLAG_VAL + OUTPUT_PREFIX_VAL + "\"" + OUTPUT_VAL + "\"" + " " + "\"" + INPUTS_VAL + "\"", + COMMAND_VAL + " " + FLAGS_VAL + " " + OUTPUT_FLAG_VAL + OUTPUT_PREFIX_VAL + "\"" + OUTPUT_VAL + "\"" + " " + + "\"" + INPUTS_VAL + "\" " + EXTRA_FLAGS, COMMAND_VAL + " " + FLAGS_VAL + " " + OUTPUT_FLAG_VAL + OUTPUT_PREFIX_VAL + "\"" + OUTPUT_VAL + "\"" + " " + "${WRONG_VAR_NAME}" }; @@ -71,11 +79,14 @@ public class ManagedCommandLineGeneratorTest extends TestCase { return new TestSuite(ManagedCommandLineGeneratorTest.class); } - public final void testGenerateCommandLineInfoPatterns() { + public final void testGenerateCommandLineInfoPatterns() throws BuildException { + ITool tool = ManagedBuildManager.getExtensionTool(TEST_TOOL_ID); + setToolOptionByType(tool, IOption.OBJECTS, OBJECTS_ARRAY_VAL); + setToolOptionByType(tool, IOption.LIBRARIES, LIBRARIES_ARRAY_VAL); IManagedCommandLineGenerator gen = new ManagedCommandLineGenerator(); IManagedCommandLineInfo info = null; for (int i = 0; i < testCommandLinePatterns.length; i++) { - info = gen.generateCommandLineInfo(null, COMMAND_VAL, FLAGS_ARRAY_VAL, OUTPUT_FLAG_VAL, OUTPUT_PREFIX_VAL, + info = gen.generateCommandLineInfo(tool, COMMAND_VAL, FLAGS_ARRAY_VAL, OUTPUT_FLAG_VAL, OUTPUT_PREFIX_VAL, OUTPUT_VAL, INPUTS_ARRAY_VAL, testCommandLinePatterns[i]); assertNotNull(info); if (i < commandLineEtalonesForPatterns.length) { @@ -84,59 +95,63 @@ public class ManagedCommandLineGeneratorTest extends TestCase { } } - public final void testGenerateCommandLineInfoDoublePattern() { + public final void testGenerateCommandLineInfoDoublePattern() throws BuildException { + ITool tool = ManagedBuildManager.getExtensionTool(TEST_TOOL_ID); IManagedCommandLineGenerator gen = new ManagedCommandLineGenerator(); - IManagedCommandLineInfo info = gen.generateCommandLineInfo(null, COMMAND_VAL, FLAGS_ARRAY_VAL, OUTPUT_FLAG_VAL, + IManagedCommandLineInfo info = gen.generateCommandLineInfo(tool, COMMAND_VAL, FLAGS_ARRAY_VAL, OUTPUT_FLAG_VAL, OUTPUT_PREFIX_VAL, OUTPUT_VAL, INPUTS_ARRAY_VAL, "${OUTPUT_FLAG} ${OUTPUT_FLAG}"); assertNotNull(info); assertEquals(OUTPUT_FLAG_VAL + " " + OUTPUT_FLAG_VAL, info.getCommandLine()); } - public final void testGenerateCommandLineInfoParameters() { + public final void testGenerateCommandLineInfoParameters() throws BuildException { + ITool tool = ManagedBuildManager.getExtensionTool(TEST_TOOL_ID); + setToolOptionByType(tool, IOption.OBJECTS, OBJECTS_ARRAY_VAL); + setToolOptionByType(tool, IOption.LIBRARIES, LIBRARIES_ARRAY_VAL); IManagedCommandLineGenerator gen = new ManagedCommandLineGenerator(); - IManagedCommandLineInfo info = gen.generateCommandLineInfo(null, "", FLAGS_ARRAY_VAL, OUTPUT_FLAG_VAL, + IManagedCommandLineInfo info = gen.generateCommandLineInfo(tool, "", FLAGS_ARRAY_VAL, OUTPUT_FLAG_VAL, OUTPUT_PREFIX_VAL, OUTPUT_VAL, INPUTS_ARRAY_VAL, null); assertNotNull(info); assertEquals(FLAGS_VAL + " " + OUTPUT_FLAG_VAL + " " + OUTPUT_PREFIX_VAL + "\"" + OUTPUT_VAL + "\"" + " " + "\"" - + INPUTS_VAL + "\"", info.getCommandLine()); + + INPUTS_VAL + "\" " + EXTRA_FLAGS, info.getCommandLine()); - info = gen.generateCommandLineInfo(null, COMMAND_VAL, new String[0], OUTPUT_FLAG_VAL, OUTPUT_PREFIX_VAL, + info = gen.generateCommandLineInfo(tool, COMMAND_VAL, new String[0], OUTPUT_FLAG_VAL, OUTPUT_PREFIX_VAL, OUTPUT_VAL, INPUTS_ARRAY_VAL, null); assertNotNull(info); assertEquals(COMMAND_VAL + " " + OUTPUT_FLAG_VAL + " " + OUTPUT_PREFIX_VAL + "\"" + OUTPUT_VAL + "\"" + " " - + "\"" + INPUTS_VAL + "\"", info.getCommandLine()); + + "\"" + INPUTS_VAL + "\" " + EXTRA_FLAGS, info.getCommandLine()); - info = gen.generateCommandLineInfo(null, COMMAND_VAL, FLAGS_ARRAY_VAL, "", OUTPUT_PREFIX_VAL, OUTPUT_VAL, + info = gen.generateCommandLineInfo(tool, COMMAND_VAL, FLAGS_ARRAY_VAL, "", OUTPUT_PREFIX_VAL, OUTPUT_VAL, INPUTS_ARRAY_VAL, null); assertNotNull(info); assertEquals(COMMAND_VAL + " " + FLAGS_VAL + " " + OUTPUT_PREFIX_VAL + "\"" + OUTPUT_VAL + "\"" + " " + "\"" - + INPUTS_VAL + "\"", info.getCommandLine()); + + INPUTS_VAL + "\" " + EXTRA_FLAGS, info.getCommandLine()); - info = gen.generateCommandLineInfo(null, COMMAND_VAL, FLAGS_ARRAY_VAL, OUTPUT_FLAG_VAL, "", OUTPUT_VAL, + info = gen.generateCommandLineInfo(tool, COMMAND_VAL, FLAGS_ARRAY_VAL, OUTPUT_FLAG_VAL, "", OUTPUT_VAL, INPUTS_ARRAY_VAL, null); assertNotNull(info); assertEquals(COMMAND_VAL + " " + FLAGS_VAL + " " + OUTPUT_FLAG_VAL + " " + "\"" + OUTPUT_VAL + "\"" + " " + "\"" - + INPUTS_VAL + "\"", info.getCommandLine()); + + INPUTS_VAL + "\" " + EXTRA_FLAGS, info.getCommandLine()); - info = gen.generateCommandLineInfo(null, COMMAND_VAL, FLAGS_ARRAY_VAL, OUTPUT_FLAG_VAL, OUTPUT_PREFIX_VAL, "", + info = gen.generateCommandLineInfo(tool, COMMAND_VAL, FLAGS_ARRAY_VAL, OUTPUT_FLAG_VAL, OUTPUT_PREFIX_VAL, "", INPUTS_ARRAY_VAL, null); assertNotNull(info); assertEquals(COMMAND_VAL + " " + FLAGS_VAL + " " + OUTPUT_FLAG_VAL + " " + OUTPUT_PREFIX_VAL + " " + "\"" - + INPUTS_VAL + "\"", info.getCommandLine()); + + INPUTS_VAL + "\" " + EXTRA_FLAGS, info.getCommandLine()); - info = gen.generateCommandLineInfo(null, COMMAND_VAL, FLAGS_ARRAY_VAL, OUTPUT_FLAG_VAL, OUTPUT_PREFIX_VAL, + info = gen.generateCommandLineInfo(tool, COMMAND_VAL, FLAGS_ARRAY_VAL, OUTPUT_FLAG_VAL, OUTPUT_PREFIX_VAL, OUTPUT_VAL, new String[0], null); assertNotNull(info); assertEquals(COMMAND_VAL + " " + FLAGS_VAL + " " + OUTPUT_FLAG_VAL + " " + OUTPUT_PREFIX_VAL + "\"" + OUTPUT_VAL - + "\"", info.getCommandLine()); + + "\" " + EXTRA_FLAGS, info.getCommandLine()); - info = gen.generateCommandLineInfo(null, COMMAND_VAL, FLAGS_ARRAY_VAL, OUTPUT_FLAG_VAL, OUTPUT_PREFIX_VAL, + info = gen.generateCommandLineInfo(tool, COMMAND_VAL, FLAGS_ARRAY_VAL, OUTPUT_FLAG_VAL, OUTPUT_PREFIX_VAL, OUTPUT_VAL, null, null); assertNotNull(info); assertEquals(COMMAND_VAL + " " + FLAGS_VAL + " " + OUTPUT_FLAG_VAL + " " + OUTPUT_PREFIX_VAL + "\"" + OUTPUT_VAL - + "\"", info.getCommandLine()); + + "\" " + EXTRA_FLAGS, info.getCommandLine()); } public final void testCustomGenerator() { @@ -332,9 +347,13 @@ public class ManagedCommandLineGeneratorTest extends TestCase { String[] libs = config.getLibs(config.getArtifactExtension()); assertEquals(Arrays.asList("-optLibs=\"val4;COCG2;\"").toString(), Arrays.asList(libs).toString()); + assertEquals(Arrays.asList(libs).toString(), + Arrays.asList(tool.getExtraFlags(IOption.LIBRARIES)).toString()); String[] userObjs = config.getUserObjects(config.getArtifactExtension()); assertEquals(Arrays.asList("-optUserObjs=\"val5;COCG2;\"").toString(), Arrays.asList(userObjs).toString()); + assertEquals(Arrays.asList(userObjs).toString(), + Arrays.asList(tool.getExtraFlags(IOption.OBJECTS)).toString()); ManagedBuildTestHelper.removeProject("COCG2"); } catch (Exception e) { @@ -401,4 +420,12 @@ public class ManagedCommandLineGeneratorTest extends TestCase { } } + private void setToolOptionByType(ITool tool, int valueType, String[] value) throws BuildException { + for (IOption option : tool.getOptions()) { + if (valueType == option.getValueType()) { + option.setValue(value); + } + } + } + } diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProject21MakefileTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProject21MakefileTests.java index 406ea6ec5ec..178634e3f03 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProject21MakefileTests.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProject21MakefileTests.java @@ -248,8 +248,8 @@ public class ManagedProject21MakefileTests extends TestCase { * tests 2.1 style tool integration for a single file executable */ public void testSingleFileExe() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), Path.fromOSString("subdir.mk") }; + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk") }; IProject[] projects = createProjects("singleFileExe", null, null, true); buildProjects("singleFileExe", projects, makefiles); } @@ -258,8 +258,8 @@ public class ManagedProject21MakefileTests extends TestCase { * tests 2.1 style tool integration for a two file SO */ public void testTwoFileSO() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), Path.fromOSString("subdir.mk") }; + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk") }; IProject[] projects = createProjects("twoFileSO", null, null, true); buildProjects("twoFileSO", projects, makefiles); } @@ -268,8 +268,8 @@ public class ManagedProject21MakefileTests extends TestCase { * tests 2.1 style tool integration for multiple source files & a resource configuration */ public void testMultiResConfig() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), Path.fromOSString("subdir.mk"), Path.fromOSString("source1/subdir.mk"), + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk"), Path.fromOSString("source1/subdir.mk"), Path.fromOSString("source2/subdir.mk"), Path.fromOSString("source2/source21/subdir.mk") }; IProject[] projects = createProjects("multiResConfig", null, null, true); buildProjects("multiResConfig", projects, makefiles); @@ -280,7 +280,7 @@ public class ManagedProject21MakefileTests extends TestCase { */ public void testLinkedLib() throws IOException { boolean succeeded = false; - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), + IPath[] makefiles = { Path.fromOSString("makefile"), //Path.fromOSString("subdir.mk") // Can't compare this yet since it contains absolute paths! Path.fromOSString("sources.mk") }; IPath[] linkedFiles = { Path.fromOSString("f1.c"), Path.fromOSString("f2.c"), Path.fromOSString("test_ar.h") }; @@ -309,11 +309,11 @@ public class ManagedProject21MakefileTests extends TestCase { */ public void testLinkedFolder() throws IOException { boolean succeeded = false; - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("subdir.mk"), Path.fromOSString("sources.mk") }; + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("subdir.mk"), + Path.fromOSString("sources.mk") }; IPath[] linkedFiles = { Path.fromOSString("f1.c"), Path.fromOSString("f2.c"), Path.fromOSString("test_ar.h"), - Path.fromOSString("Benchmarks/makefile"), Path.fromOSString("Benchmarks/objects.mk"), - Path.fromOSString("Benchmarks/subdir.mk"), Path.fromOSString("Benchmarks/sources.mk") }; + Path.fromOSString("Benchmarks/makefile"), Path.fromOSString("Benchmarks/subdir.mk"), + Path.fromOSString("Benchmarks/sources.mk") }; File srcDirFile = CTestPlugin.getFileInPlugin(new Path("resources/test21Projects/linkedFolder/")); IPath srcDir = Path.fromOSString(srcDirFile.toString()); IPath tmpSubDir = Path.fromOSString("CDTMBSTest"); diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProject30MakefileTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProject30MakefileTests.java index 9e95ee095f7..16175e57617 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProject30MakefileTests.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProject30MakefileTests.java @@ -287,8 +287,8 @@ public class ManagedProject30MakefileTests extends TestCase { * tests 3.0 style tool integration for a single file executable */ public void test30SingleFileExe() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), Path.fromOSString("subdir.mk") }; + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk") }; IProject[] projects = createProjects("singleFileExe", null, null, true); buildProjects(projects, makefiles); } @@ -297,8 +297,8 @@ public class ManagedProject30MakefileTests extends TestCase { * tests 3.0 style tool integration for a two file SO */ public void test30TwoFileSO() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), Path.fromOSString("subdir.mk") }; + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk") }; IProject[] projects = createProjects("twoFileSO", null, null, true); buildProjects(projects, makefiles); } @@ -307,11 +307,11 @@ public class ManagedProject30MakefileTests extends TestCase { * tests 3.0 style tool integration for multiple source files & a resource configuration */ public void test30MultiResConfig() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), Path.fromOSString("subdir.mk"), Path.fromOSString("main.d"), - Path.fromOSString("source1/subdir.mk"), Path.fromOSString("source1/Class1.d"), - Path.fromOSString("source2/subdir.mk"), Path.fromOSString("source2/Class2.d"), - Path.fromOSString("source2/source21/Class21.d"), Path.fromOSString("source2/source21/subdir.mk") }; + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk"), Path.fromOSString("main.d"), Path.fromOSString("source1/subdir.mk"), + Path.fromOSString("source1/Class1.d"), Path.fromOSString("source2/subdir.mk"), + Path.fromOSString("source2/Class2.d"), Path.fromOSString("source2/source21/Class21.d"), + Path.fromOSString("source2/source21/subdir.mk") }; IProject[] projects = createProjects("multiResConfig", null, null, true); buildProjects(projects, makefiles); } @@ -320,7 +320,7 @@ public class ManagedProject30MakefileTests extends TestCase { * tests 3.0 style tool integration for linked files */ public void test30LinkedLib() throws IOException { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), + IPath[] makefiles = { Path.fromOSString("makefile"), //Path.fromOSString("subdir.mk") // Can't compare this yet since it contains absolute paths! Path.fromOSString("sources.mk") }; IPath[] linkedFiles = { Path.fromOSString("f1_30.c"), Path.fromOSString("f2_30.c"), @@ -348,11 +348,11 @@ public class ManagedProject30MakefileTests extends TestCase { * tests 3.0 style tool integration for a linked folder */ public void test30LinkedFolder() throws IOException { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("subdir.mk"), Path.fromOSString("sources.mk") }; + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("subdir.mk"), + Path.fromOSString("sources.mk") }; IPath[] linkedFiles = { Path.fromOSString("f1.c"), Path.fromOSString("f2.c"), Path.fromOSString("test_ar.h"), - Path.fromOSString("Benchmarks/makefile"), Path.fromOSString("Benchmarks/objects.mk"), - Path.fromOSString("Benchmarks/subdir.mk"), Path.fromOSString("Benchmarks/sources.mk") }; + Path.fromOSString("Benchmarks/makefile"), Path.fromOSString("Benchmarks/subdir.mk"), + Path.fromOSString("Benchmarks/sources.mk") }; File srcDirFile = CTestPlugin.getFileInPlugin(new Path("resources/test30Projects/linkedFolder/")); IPath srcDir = Path.fromOSString(srcDirFile.toString()); IPath tmpRootDir = Path @@ -377,9 +377,9 @@ public class ManagedProject30MakefileTests extends TestCase { * tests 3.0 style tool integration with pre and post process steps added to typical compile & link */ public void test30CopyandDeploy() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), Path.fromOSString("subdir.mk"), Path.fromOSString("main.d"), - Path.fromOSString("Functions/subdir.mk"), Path.fromOSString("Functions/Func1.d") }; + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk"), Path.fromOSString("main.d"), Path.fromOSString("Functions/subdir.mk"), + Path.fromOSString("Functions/Func1.d") }; IProject[] projects = createProjects("copyandDeploy", null, null, true); buildProjects(projects, makefiles); } @@ -389,8 +389,8 @@ public class ManagedProject30MakefileTests extends TestCase { * occurs in the managedbuild system */ public void test30DeleteFile() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("subdir.mk"), Path.fromOSString("sources.mk") }; + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("subdir.mk"), + Path.fromOSString("sources.mk") }; IProject[] projects = createProjects("deleteFile", null, null, true); final IWorkspace workspace = ResourcesPlugin.getWorkspace(); @@ -419,8 +419,8 @@ public class ManagedProject30MakefileTests extends TestCase { * "excluded from build" to see that this degenerative case is handled gracefully */ public void test30NoFilesToBuild() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("subdir.mk"), Path.fromOSString("sources.mk") }; + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("subdir.mk"), + Path.fromOSString("sources.mk") }; IProject[] projects = createProjects("noFilesToBuild", null, null, true); IProject project = projects[0]; @@ -437,8 +437,8 @@ public class ManagedProject30MakefileTests extends TestCase { * tests 3.0 managed build system with a project which has a file with no file extesnion */ public void testFileWithNoExtension() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), Path.fromOSString("subdir.mk") }; + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk") }; IProject[] projects = createProjects("testFileWithNoExtension", null, null, true); buildProjects(projects, makefiles); } @@ -448,8 +448,8 @@ public class ManagedProject30MakefileTests extends TestCase { * the proper commands are generated in the makefile which is created by the managedbuild system */ public void testPreAndPostProcessBuildSteps() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("subdir.mk"), Path.fromOSString("sources.mk") }; + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("subdir.mk"), + Path.fromOSString("sources.mk") }; IProject[] projects = createProjects("preAndPostBuildSteps", null, null, true); IProject project = projects[0]; @@ -467,8 +467,8 @@ public class ManagedProject30MakefileTests extends TestCase { * the proper commands are generated in the makefile which is created by the managedbuild system */ public void testResourceCustomBuildStep() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("subdir.mk"), Path.fromOSString("sources.mk") }; + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("subdir.mk"), + Path.fromOSString("sources.mk") }; ITool rcbsTool; IInputType rcbsToolInputType; IAdditionalInput rcbsToolInputTypeAdditionalInput; @@ -497,8 +497,8 @@ public class ManagedProject30MakefileTests extends TestCase { * tests 3.0 style tool integration with pre and post process steps added to typical compile & link */ public void test30_1() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), Path.fromOSString("subdir.mk") }; + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk") }; IProject[] projects = createProjects("test30_1", null, null, true); buildProjects(projects, makefiles); } @@ -507,8 +507,8 @@ public class ManagedProject30MakefileTests extends TestCase { * tests 3.0 style tool integration with multiple input types use Eclipse content types */ public void test30_2() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), Path.fromOSString("subdir.mk") }; + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk") }; IProject[] projects = createProjects("test30_2", null, null, true); buildProjects(projects, makefiles); } @@ -543,8 +543,8 @@ public class ManagedProject30MakefileTests extends TestCase { * tests external dependency calculation using Fortran modules */ public void CDTFortranTest1() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), Path.fromOSString("subdir.mk") }; + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk") }; IProject[] projects = createProjects("CDTFortranTest1", null, null, true); buildProjects(projects, makefiles); } @@ -553,9 +553,8 @@ public class ManagedProject30MakefileTests extends TestCase { * tests external dependency calculation using Fortran modules */ public void CDTFortranTest2() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), Path.fromOSString("module/subdir.mk"), - Path.fromOSString("Sources/subdir.mk") }; + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), + Path.fromOSString("module/subdir.mk"), Path.fromOSString("Sources/subdir.mk") }; IProject[] projects = createProjects("CDTFortranTest2", null, null, true); buildProjects(projects, makefiles); } @@ -564,15 +563,15 @@ public class ManagedProject30MakefileTests extends TestCase { * tests the InputType assignToOption attribute */ public void TestATO() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), Path.fromOSString("subdir.mk") }; + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk") }; IProject[] projects = createProjects("TestATO", null, null, true); buildProjects(projects, makefiles); } public void testMacroSupportInBuildDefinitions() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), Path.fromOSString("subdir.mk") }; + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk") }; IProject[] projects = createProjects("testMacroSupportInBuildDefinitions", null, null, true); buildProjects(projects, makefiles); } @@ -582,9 +581,9 @@ public class ManagedProject30MakefileTests extends TestCase { * tests managed build system with a project which has resources with spaces in their paths */ public void testSpaces() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), Path.fromOSString("subdir.mk"), - Path.fromOSString("main with spaces.d"), Path.fromOSString("sub folder with spaces/subdir.mk"), + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk"), Path.fromOSString("main with spaces.d"), + Path.fromOSString("sub folder with spaces/subdir.mk"), Path.fromOSString("sub folder with spaces/foo with spaces.d") }; IProject[] projects = createProjects("test with spaces", null, null, true); buildProjects(projects, makefiles); @@ -595,8 +594,8 @@ public class ManagedProject30MakefileTests extends TestCase { * tests managed build system with a project which has resources with spaces in their paths */ public void testInputTypeOption() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), Path.fromOSString("subdir.mk"), }; + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk"), }; IProject[] projects = createProjects("inputTypeOption", null, null, true); buildProjects(projects, makefiles); } diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProjectUpdateTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProjectUpdateTests.java index 72b71808cfc..ef5e66cacf8 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProjectUpdateTests.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/ManagedProjectUpdateTests.java @@ -209,8 +209,8 @@ public class ManagedProjectUpdateTests extends TestCase { * in case when user chooses to update the project */ public void testProjectUpdate12_Update() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), Path.fromOSString("subdir.mk") }; + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk") }; doTestProjectUpdate("1.2", true, true, makefiles); } @@ -219,8 +219,8 @@ public class ManagedProjectUpdateTests extends TestCase { * in case when user chooses to update the project */ public void testProjectUpdate20_Update() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), Path.fromOSString("subdir.mk") }; + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk") }; doTestProjectUpdate("2.0", true, true, makefiles); } @@ -229,9 +229,8 @@ public class ManagedProjectUpdateTests extends TestCase { * in case when user chooses to update the project */ public void testProjectUpdate21_Update() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), Path.fromOSString("subdir.mk"), - Path.fromOSString("Functions/subdir.mk") }; + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk"), Path.fromOSString("Functions/subdir.mk") }; doTestProjectUpdate("2.1", true, true, makefiles); } @@ -239,9 +238,8 @@ public class ManagedProjectUpdateTests extends TestCase { * tests project v2.1 update of a C++ project with C source files */ public void testProjectUpdate21CPP_Update() { - IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("objects.mk"), - Path.fromOSString("sources.mk"), Path.fromOSString("subdir.mk"), - Path.fromOSString("Functions/subdir.mk") }; + IPath[] makefiles = { Path.fromOSString("makefile"), Path.fromOSString("sources.mk"), + Path.fromOSString("subdir.mk"), Path.fromOSString("Functions/subdir.mk") }; doTestProjectUpdate("2.1CPP", true, true, makefiles); } diff --git a/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF b/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF index 0f6773a3389..bb7707b45a0 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF +++ b/build/org.eclipse.cdt.managedbuilder.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cdt.managedbuilder.core; singleton:=true -Bundle-Version: 9.3.400.qualifier +Bundle-Version: 9.4.0.qualifier Bundle-Activator: org.eclipse.cdt.managedbuilder.core.ManagedBuilderCorePlugin Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java index c4cd22e506b..72ab25837c5 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ITool.java @@ -714,4 +714,11 @@ public interface ITool extends IHoldsOptions { void setHidden(boolean hidden); String getUniqueRealName(); + + /** + * @since 9.4 + */ + default public String[] getExtraFlags(int optionType) { + return new String[0]; + } } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedCommandLineGenerator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedCommandLineGenerator.java index d49a1da42f4..1d5a6f715ec 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedCommandLineGenerator.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/core/ManagedCommandLineGenerator.java @@ -13,6 +13,8 @@ *******************************************************************************/ package org.eclipse.cdt.managedbuilder.core; +import java.util.stream.Stream; + import org.eclipse.cdt.managedbuilder.internal.core.Tool; /** @@ -29,6 +31,7 @@ public class ManagedCommandLineGenerator implements IManagedCommandLineGenerator private static final String OUTPUT_PREFIX_PRM_NAME = "OUTPUT_PREFIX"; //$NON-NLS-1$ private static final String OUTPUT_PRM_NAME = "OUTPUT"; //$NON-NLS-1$ private static final String INPUTS_PRM_NAME = "INPUTS"; //$NON-NLS-1$ + private static final String EXTRA_FLAGS_PRM_NAME = "EXTRA_FLAGS"; //$NON-NLS-1$ private String makeVariable(String variableName) { return "${" + variableName + "}"; //$NON-NLS-1$ //$NON-NLS-2$ @@ -65,12 +68,21 @@ public class ManagedCommandLineGenerator implements IManagedCommandLineGenerator String command = commandLinePattern; + // Workaround GNU ld limitation that requires additional objects and libraries to be last on command line + String[] extraFlags = mergeArrays(tool.getExtraFlags(IOption.OBJECTS), tool.getExtraFlags(IOption.LIBRARIES)); + String extraFlagsStr = stringArrayToString(extraFlags); + + // Need to update "flags" in order to make the change visible outside the makefile generator. + // NOTE: Do not update the flagsStr as it would render the options listed twice! + flags = mergeArrays(flags, extraFlags); + command = command.replace(makeVariable(CMD_LINE_PRM_NAME), commandName); command = command.replace(makeVariable(FLAGS_PRM_NAME), flagsStr); command = command.replace(makeVariable(OUTPUT_FLAG_PRM_NAME), outputFlag); command = command.replace(makeVariable(OUTPUT_PREFIX_PRM_NAME), outputPrefix); command = command.replace(makeVariable(OUTPUT_PRM_NAME), outputName); command = command.replace(makeVariable(INPUTS_PRM_NAME), inputsStr); + command = command.replace(makeVariable(EXTRA_FLAGS_PRM_NAME), extraFlagsStr); command = command.replace(makeVariable(CMD_LINE_PRM_NAME.toLowerCase()), commandName); command = command.replace(makeVariable(FLAGS_PRM_NAME.toLowerCase()), flagsStr); @@ -78,6 +90,7 @@ public class ManagedCommandLineGenerator implements IManagedCommandLineGenerator command = command.replace(makeVariable(OUTPUT_PREFIX_PRM_NAME.toLowerCase()), outputPrefix); command = command.replace(makeVariable(OUTPUT_PRM_NAME.toLowerCase()), outputName); command = command.replace(makeVariable(INPUTS_PRM_NAME.toLowerCase()), inputsStr); + command = command.replace(makeVariable(EXTRA_FLAGS_PRM_NAME.toLowerCase()), extraFlagsStr); return toManagedCommandLineInfo(tool, command.trim(), commandLinePattern, commandName, flags, outputFlag, outputPrefix, outputName, inputResources); @@ -148,4 +161,8 @@ public class ManagedCommandLineGenerator implements IManagedCommandLineGenerator } return String.join(WHITESPACE, array); } + + private String[] mergeArrays(String[]... arrays) { + return Stream.of(arrays).flatMap(Stream::of).toArray(String[]::new); + } } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java index 6bb19ec601e..9b01d256fa6 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/Tool.java @@ -74,6 +74,8 @@ import org.eclipse.cdt.managedbuilder.internal.macros.BuildfileMacroSubstitutor; import org.eclipse.cdt.managedbuilder.internal.macros.FileContextData; import org.eclipse.cdt.managedbuilder.internal.macros.IMacroContextInfo; import org.eclipse.cdt.managedbuilder.internal.macros.IMacroContextInfoProvider; +import org.eclipse.cdt.managedbuilder.internal.macros.OptionContextData; +import org.eclipse.cdt.managedbuilder.macros.BuildMacroException; import org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider; import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGenerator; import org.eclipse.cdt.managedbuilder.makegen.IManagedDependencyGeneratorType; @@ -103,7 +105,7 @@ import org.osgi.framework.Version; public class Tool extends HoldsOptions implements ITool, IOptionCategory, IMatchKeyProvider, IRealBuildObjectAssociation { - public static final String DEFAULT_PATTERN = "${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}"; //$NON-NLS-1$ + public static final String DEFAULT_PATTERN = "${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS} ${EXTRA_FLAGS}"; //$NON-NLS-1$ public static final String DEFAULT_CBS_PATTERN = "${COMMAND}"; //$NON-NLS-1$ //property name for holding the rebuild state @@ -4251,4 +4253,102 @@ public class Tool extends HoldsOptions // Tool does not have any ApplicabilityCalculator. return null; } + + @Override + public String[] getExtraFlags(int optionType) { + if (optionType != IOption.LIBRARIES && optionType != IOption.OBJECTS) { + // Early exit to avoid performance penalty + return new String[0]; + } + + Vector flags = new Vector<>(); + for (IOption option : getOptions()) { + try { + if (option.getValueType() != optionType) { + continue; + } + + // check to see if the option has an applicability calculator + IOptionApplicability applicabilityCalculator = option.getApplicabilityCalculator(); + + if (applicabilityCalculator == null + || applicabilityCalculator.isOptionUsedInCommandLine(this, this, option)) { + boolean generateDefaultCommand = true; + IOptionCommandGenerator commandGenerator = option.getCommandGenerator(); + if (commandGenerator != null) { + SupplierBasedCdtVariableSubstitutor macroSubstitutor = new BuildfileMacroSubstitutor(null, + EMPTY_STRING, WHITE_SPACE); + IMacroContextInfoProvider provider = BuildMacroProvider.getDefault(); + IMacroContextInfo info = provider.getMacroContextInfo(BuildMacroProvider.CONTEXT_OPTION, + new OptionContextData(option, this)); + if (info != null) { + macroSubstitutor.setMacroContextInfo(info); + String command = commandGenerator.generateCommand(option, macroSubstitutor); + if (command != null) { + flags.add(command); + generateDefaultCommand = false; + } + } + } + + if (generateDefaultCommand) { + switch (optionType) { + case IOption.LIBRARIES: { + String command = option.getCommand(); + String[] libs = option.getLibraries(); + for (String lib : libs) { + try { + String resolved[] = ManagedBuildManager.getBuildMacroProvider() + .resolveStringListValueToMakefileFormat(lib, " ", //$NON-NLS-1$ + " ", //$NON-NLS-1$ + IBuildMacroProvider.CONTEXT_OPTION, + new OptionContextData(option, this)); + if (resolved != null && resolved.length > 0) { + for (String string : resolved) { + if (!string.isEmpty()) { + flags.add(command + string); + } + } + } + } catch (BuildMacroException e) { + // TODO: report error + continue; + } + } + break; + } + case IOption.OBJECTS: { + String userObjs[] = option.getUserObjects(); + if (userObjs != null && userObjs.length > 0) { + for (String userObj : userObjs) { + try { + String resolved[] = ManagedBuildManager.getBuildMacroProvider() + .resolveStringListValueToMakefileFormat(userObj, "", //$NON-NLS-1$ + " ", //$NON-NLS-1$ + IBuildMacroProvider.CONTEXT_OPTION, + new OptionContextData(option, this)); + if (resolved != null && resolved.length > 0) { + flags.addAll(Arrays.asList(resolved)); + } + } catch (BuildMacroException e) { + // TODO: report error + continue; + } + } + } + break; + } + default: + // Cannot happen + break; + } + } + } + } catch (BuildException | CdtVariableException e) { + // TODO: report error + continue; + } + } + return flags.toArray(new String[flags.size()]); + } } diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu2/GnuMakefileGenerator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu2/GnuMakefileGenerator.java index 78cb573d28c..c1e3d3e71d3 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu2/GnuMakefileGenerator.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu2/GnuMakefileGenerator.java @@ -44,6 +44,8 @@ import java.util.TreeSet; import java.util.Vector; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.stream.Collectors; +import java.util.stream.Stream; import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.settings.model.CSourceEntry; @@ -972,12 +974,6 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { populateTopMakefile(makefileHandle, true); checkCancel(); - // Now finish up by adding all the object files - IPath objFilePath = topBuildDir.append(OBJECTS_MAKFILE); - IFile objsFileHandle = createFile(objFilePath); - populateObjectsMakefile(objsFileHandle); - checkCancel(); - // How did we do if (!getInvalidDirList().isEmpty()) { status = new MultiStatus(ManagedBuilderCorePlugin.getUniqueIdentifier(), IStatus.WARNING, "", //$NON-NLS-1$ @@ -1029,67 +1025,6 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { save(makeBuf, modMakefile); } - /** - * The makefile generator generates a Macro for each type of output, other than final artifact, - * created by the build. - * - * @param fileHandle The file that should be populated with the output - */ - protected void populateObjectsMakefile(IFile fileHandle) throws CoreException { - - // Master list of "object" dependencies, i.e. dependencies between input files and output files. - StringBuffer macroBuffer = new StringBuffer(); - List valueList; - macroBuffer.append(addGenericHeader()); - - // Map of macro names (String) to its definition (List of Strings) - HashMap> outputMacros = new HashMap<>(); - - // Add the predefined LIBS, USER_OBJS macros - - // Add the libraries this project depends on - valueList = new ArrayList<>(); - String[] libs = config.getLibs(buildTargetExt); - for (String lib : libs) { - valueList.add(lib); - } - outputMacros.put("LIBS", valueList); //$NON-NLS-1$ - - // Add the extra user-specified objects - valueList = new ArrayList<>(); - String[] userObjs = config.getUserObjects(buildTargetExt); - for (String obj : userObjs) { - valueList.add(obj); - } - outputMacros.put("USER_OBJS", valueList); //$NON-NLS-1$ - - // Write every macro to the file - for (Entry> entry : outputMacros.entrySet()) { - macroBuffer.append(entry.getKey()).append(" :="); //$NON-NLS-1$ - valueList = entry.getValue(); - for (String path : valueList) { - // These macros will also be used within commands. - // Make all the slashes go forward so they aren't - // interpreted as escapes and get lost. - // See https://bugs.eclipse.org/163672. - path = path.replace('\\', '/'); - - path = ensurePathIsGNUMakeTargetRuleCompatibleSyntax(path); - - macroBuffer.append(WHITESPACE); - macroBuffer.append(path); - } - // terminate the macro definition line - macroBuffer.append(NEWLINE); - // leave a blank line before the next macro - macroBuffer.append(NEWLINE); - } - - // For now, just save the buffer that was populated when the rules were created - save(macroBuffer, fileHandle); - - } - protected void populateSourcesMakefile(IFile fileHandle) throws CoreException { // Add the comment StringBuffer buffer = addGenericHeader(); @@ -1268,8 +1203,6 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { buffer.append(MODFILE_NAME).append(NEWLINE); } - buffer.append("-include objects.mk").append(NEWLINE).append(NEWLINE); //$NON-NLS-1$ - // Include generated dependency makefiles if non-empty AND a "clean" has not been requested if (!buildDepVars.isEmpty()) { buffer.append("ifneq ($(MAKECMDGOALS),clean)").append(NEWLINE); //$NON-NLS-1$ @@ -1763,9 +1696,16 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { } buildRule += calculatedDependencies; buildRule += WHITESPACE + MAKEFILE_NAME; // makefile itself - buildRule += WHITESPACE + OBJECTS_MAKFILE; // objects.mk buildRule += WHITESPACE + "$(OPTIONAL_TOOL_DEPS)"; //$NON-NLS-1$ // Optional dep to generated makefile extension files + // Depend on additional object files for the tool, if any + String[] additionalObjects = tool.getExtraFlags(IOption.OBJECTS); + if (additionalObjects.length > 0) { + buildRule += WHITESPACE + Stream.of(additionalObjects) // + .map(this::ensurePathIsGNUMakeTargetRuleCompatibleSyntax) // + .collect(Collectors.joining(WHITESPACE)); + } + // We can't have duplicates in a makefile if (getRuleList().contains(buildRule)) { } else { @@ -1797,8 +1737,17 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { } String[] cmdInputs = inputs.toArray(new String[inputs.size()]); IManagedCommandLineGenerator gen = tool.getCommandLineGenerator(); + String commandLinePattern = tool.getCommandLinePattern(); + if (!commandLinePattern.contains("${EXTRA_FLAGS}")) { //$NON-NLS-1$ + String[] objs = tool.getExtraFlags(IOption.OBJECTS); + String[] libs = tool.getExtraFlags(IOption.LIBRARIES); + if (objs.length > 0 || libs.length > 0) { + // Tool command line pattern would expect legacy "$(USER_OBJS)" or "$(LIBS)" make-symbols to be appended. + commandLinePattern = commandLinePattern + " ${EXTRA_FLAGS}"; //$NON-NLS-1$ + } + } IManagedCommandLineInfo cmdLInfo = gen.generateCommandLineInfo(tool, command, flags, outflag, outputPrefix, - primaryOutputs, cmdInputs, tool.getCommandLinePattern()); + primaryOutputs, cmdInputs, commandLinePattern); // The command to build String buildCmd = null;