|
|
Re: Makefile build configurations [message #1839105 is a reply to message #1839093] |
Sun, 14 March 2021 03:01   |
David Vavra Messages: 1427 Registered: October 2012 |
Senior Member |
|
|
In a managed build there is a makefile for each build configuration.
The build configuration is usually the name of the build folder within the project.
You can change this for each configuration (or all) with
Project --> Properties --> C/C++ Build --> Builder Settings tab --> Build Location
(though maybe not in a managed build).
When executing Project --> Build Project, CDT will set the current working directory to the
directory in Build Location then execute the build command found in
Project --> Properties --> C/C++ Build --> Builder Settings tab --> Build Command
The default is "make <target>" but you can change it by turning off Use default build command
AFAIK, you CANNOT stop the target from being appended to the command.
The command can
- use Build Variables found in Project --> Properties --> C/C++ Build --> Build Variables
- set environment variables when running make with Project --> Properties --> C/C++ Build --> Environment
In a Makefile Project you get to decide what the makefile does but the initial build actions are the same.
All of the items in Project --> Properties --> C/C++ Build (except for logging) can be modified according to build configuration.
https://help.eclipse.org/2020-09/topic/org.eclipse.cdt.doc.user/reference/cdt_u_prop_build.htm
https://help.eclipse.org/2020-09/nav/10_4_7_0_3
[Updated on: Sun, 14 March 2021 03:18] Report message to a moderator
|
|
|
|
|
Re: Makefile build configurations [message #1839141 is a reply to message #1839129] |
Mon, 15 March 2021 15:49   |
David Vavra Messages: 1427 Registered: October 2012 |
Senior Member |
|
|
Quote:I created the project using the New C/C++ Project Wizard and selected the makefile project experimental template.
I'm not sure what was intended with that particular Project Wizard but IMO it's broken.
I do note that it is marked experimental.
It seems to generate a project similar to a CMake project.
The way I generate Makefile Projects as I described them
is to import them with File --> Import --> C/C++ --> Existing Code as Makefile Project
I tried creating one with File --> New --> Makefile Project with Existing Code
Both seem to work the same.
Note: "existing code" is misleading.
You can create both in an empty directory.
If you want to try it on your current project,
I suggest deleting the.project and .cproject files first.
Doing so will lose whatever Eclipse settings you have already made, though.
[Updated on: Mon, 15 March 2021 15:53] Report message to a moderator
|
|
|
|
Re: Makefile build configurations [message #1839190 is a reply to message #1839187] |
Wed, 17 March 2021 09:52   |
David Vavra Messages: 1427 Registered: October 2012 |
Senior Member |
|
|
I'm surprised. Works OK for me.
The major difference between a Managed Build Project and a Makefile Project is the generation of a makefile.
Another is mostly the project layout which should have been left untouched.
Turn off autogeneration with Project --> Properties --> C/C++ Build --> Builder Settings tab --> Generate Makefiles automatically
It will then be a Makefile Project where you maintain the makefile.
Quote:I tried the procedure you gave me, but ... it created another Managed Build project instead of a Makefile Project. Everything is working except I cannot control the make command line, nor figure out how to control the BUILD_MODE variable.
What do you mean by "another Managed Build project"?
The first using the wizard that you described is a modified Makefile Project.
If you had actually made a Managed Build project then the controls for the makefile and setting variables would be there.
Sounds like you just used the experimental Makefile wizard again.
[Updated on: Wed, 17 March 2021 17:01] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02140 seconds