Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Schaefer2017-11-09 14:13:35 -0500
committerDoug Schaefer2017-11-09 20:35:17 -0500
commit45019ea7805777774f71d395e077fe36068d401f (patch)
tree2f729e5005a6a26f0219c6e54699638a8758ebd2 /build/org.eclipse.cdt.make.core
parent18f76e8313432b297765c23b95f1d5033789195e (diff)
downloadorg.eclipse.cdt-45019ea7805777774f71d395e077fe36068d401f.tar.gz
org.eclipse.cdt-45019ea7805777774f71d395e077fe36068d401f.tar.xz
org.eclipse.cdt-45019ea7805777774f71d395e077fe36068d401f.zip
Add settings to Makefile build configs to build at project root.
Often Makefile projects are intended to be built from the project root directory, such as ESP32 IDF projects. This adds a setting to control that. Change-Id: I151ebf60a7609461d24e192a9d6418fccb737055
Diffstat (limited to 'build/org.eclipse.cdt.make.core')
-rw-r--r--build/org.eclipse.cdt.make.core/plugin.xml2
-rw-r--r--build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakefileBuildConfigurationProvider.java (renamed from build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakefileBuildConfigurationProvider.java)6
-rw-r--r--build/org.eclipse.cdt.make.core/templates/simple/Makefile9
3 files changed, 12 insertions, 5 deletions
diff --git a/build/org.eclipse.cdt.make.core/plugin.xml b/build/org.eclipse.cdt.make.core/plugin.xml
index 63816b7021..5de1999d0e 100644
--- a/build/org.eclipse.cdt.make.core/plugin.xml
+++ b/build/org.eclipse.cdt.make.core/plugin.xml
@@ -197,7 +197,7 @@
<extension
point="org.eclipse.cdt.core.buildConfigProvider">
<provider
- class="org.eclipse.cdt.make.internal.core.MakefileBuildConfigurationProvider"
+ class="org.eclipse.cdt.make.core.MakefileBuildConfigurationProvider"
id="org.eclipse.cdt.make.core.provider"
natureId="org.eclipse.cdt.make.core.makeNature">
</provider>
diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakefileBuildConfigurationProvider.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakefileBuildConfigurationProvider.java
index f820c4eb7e..1406011df4 100644
--- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/MakefileBuildConfigurationProvider.java
+++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/core/MakefileBuildConfigurationProvider.java
@@ -5,19 +5,21 @@
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
-package org.eclipse.cdt.make.internal.core;
+package org.eclipse.cdt.make.core;
import org.eclipse.cdt.core.build.ICBuildConfiguration;
import org.eclipse.cdt.core.build.ICBuildConfigurationManager;
import org.eclipse.cdt.core.build.ICBuildConfigurationProvider;
import org.eclipse.cdt.core.build.IToolChain;
import org.eclipse.cdt.core.build.StandardBuildConfiguration;
-import org.eclipse.cdt.make.core.MakeCorePlugin;
import org.eclipse.core.resources.IBuildConfiguration;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+/**
+ * @since 7.4
+ */
public class MakefileBuildConfigurationProvider implements ICBuildConfigurationProvider {
public static final String ID = "org.eclipse.cdt.make.core.provider"; //$NON-NLS-1$
diff --git a/build/org.eclipse.cdt.make.core/templates/simple/Makefile b/build/org.eclipse.cdt.make.core/templates/simple/Makefile
index 02622849e1..404907713d 100644
--- a/build/org.eclipse.cdt.make.core/templates/simple/Makefile
+++ b/build/org.eclipse.cdt.make.core/templates/simple/Makefile
@@ -1,11 +1,16 @@
+PROJECT_ROOT = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
+
OBJS = ${projectName}.o
all: ${projectName}
${projectName}: $(OBJS)
- $(CC) -o $@ $^
+ $(CXX) -o $@ $^
+
+%.o: $(PROJECT_ROOT)%.cpp
+ $(CXX) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
-%.o: ../../%.cpp
+%.o: $(PROJECT_ROOT)%.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
clean:

Back to the top