Skip to content

Commit 6ba2488

Browse files
committed
Processed review comments.
Processed review comments and described the BUILD_MODE variable in section "Building a project" for CBS Makefile projects.
1 parent 378d553 commit 6ba2488

File tree

7 files changed

+48
-26
lines changed

7 files changed

+48
-26
lines changed

doc/org.eclipse.cdt.doc.user/src/getting_started/cbs_build_project.adoc

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ endif::[]
3030

3131
== Building a project
3232

33-
During CBS project creation a launch configuration with the same name
34-
is created along with it. The Build settings are managed in the *Build
35-
Settings* tab of the launch configuration.
33+
During Core Build System (CBS) project creation a launch configuration
34+
with the same name is created along with it. The Build settings are
35+
managed in the *Build Settings* tab of the launch configuration.
3636

3737
CBS projects rely on the xref:cbs_launchbar.adoc[Launch Bar]. Make
3838
sure the launch bar is installed and enabled.
@@ -84,4 +84,33 @@ The following picture shows the build settings of a CMake project.
8484

8585
image:cbs_build_settings_tab_cmake.png[CMake build settings tab]
8686

87+
=== Makefile projects BUILD_MODE
88+
89+
For CBS Makefile projects the launch mode is passed to `make` via
90+
environment variable `BUILD_MODE`. In the Makefile you can make use of
91+
this variable to set the wanted `CFLAGS` per launch mode.
92+
93+
[cols="1,1"]
94+
|===
95+
|Launch mode | BUILD_MODE
96+
97+
|Run
98+
|run
99+
100+
|Debug
101+
|debug
102+
|===
103+
104+
Here is some example code that makes use of `BUILD_MODE` to set the
105+
wanted `CFLAGS`:
106+
107+
[source,makefile]
108+
----
109+
ifeq ($(BUILD_MODE),debug)
110+
CFLAGS += -g -O0
111+
else ifeq ($(BUILD_MODE),run)
112+
CFLAGS += -O2
113+
endif
114+
----
115+
87116
icon:arrow-circle-right[] xref:cbs_run_project.adoc[Next: Running a project]

doc/org.eclipse.cdt.doc.user/src/getting_started/cbs_launchbar.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ endif::[]
3030

3131
== Launch Bar
3232

33-
CBS projects rely on the *LaunchBar*. Make sure the launch bar plugin
34-
is installed and enabled. In the global preferences the launch bar can
35-
be enabled or disabled.
33+
Core Build System (CBS) projects rely on the *Launch Bar*. Make sure
34+
the _LaunchBar UI_ feature is installed and enabled. In the global
35+
preferences the launch bar can be enabled or disabled.
3636

3737
image:launchbar_preferences.png[Launch Bar preferences]
3838

doc/org.eclipse.cdt.doc.user/src/getting_started/cbs_using_existing_code.adoc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@ endif::[]
3030

3131
== Using existing code
3232

33-
This tutorial describes how to use existing code for Core Build System
34-
projects.
33+
This tutorial describes how to create a new Core Build System
34+
(CBS) project for use with existing code.
3535

3636
Using existing code is done by creating a new **empty** project on top of the
3737
existing code.
3838

3939
=== Using an existing CMake project
4040

41-
To create an empty CMake project select the template *Empty or Existing CMake
41+
To create an empty CMake project in CDT select the template *Empty or Existing CMake
4242
Project* in the *New C/{cpp} Project* wizard.
4343

4444
image:cbs_empty_cmake_project.png[Empty or Existing CMake Project]
4545

46-
Then in the *New CMake Project* wizard deselect *Use default location*
46+
In the *New CMake Project* wizard deselect *Use default location*
4747
and set the location of the existing code.
4848

4949
image:cbs_existing_code_cmake.png[Existing code CMake]
@@ -53,12 +53,12 @@ xref:new_cmake_proj.adoc[Creating a CMake project]
5353

5454
=== Using an existing Makefile project
5555

56-
Create a Makefile project as described in
56+
Create a CBS Makefile project in CDT as described in
5757
xref:new_cbs_makefile_proj.adoc[Creating a Core Build System Makefile project]
5858
with the following changes:
5959

60-
In the *New Makefile Project* wizard deselect *Use default location*
61-
and set the location of the existing code, and deselect *Create Hello
60+
In the *New Makefile Project* wizard deselect *Use default location*,
61+
set the location of the existing code, and deselect *Create Hello
6262
World Source and Makefile example*.
6363

6464
image:cbs_existing_code_makefile.png[Existing code Makefile]

doc/org.eclipse.cdt.doc.user/src/getting_started/cdt_o_tutorial.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Development Toolkit (CDT) to:
3636
* xref:cdt_w_prepare_workbench.adoc[Prepare the Workbench]
3737
* xref:cdt_w_basic.adoc[Create a simple application]
3838
* xref:new_cmake_proj.adoc[Creating a CMake project]
39-
* xref:cdt_w_newproj.adoc[Create a Makefile project]
39+
* xref:cdt_w_basic.adoc[Create a Managed Build System Makefile project]
4040
* xref:cdt_w_import.adoc[Import an existing project]
4141
* xref:cdt_w_newcpp.adoc[Create a {cpp} file]
4242
* xref:cdt_w_newmake.adoc[Create a makefile]

doc/org.eclipse.cdt.doc.user/src/getting_started/cdt_w_newcpp.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ endif::[]
3232

3333
You can begin coding your HelloWorld program. The .cpp file that you
3434
create will be saved in the project folder you just created
35-
xref:cdt_w_newproj.adoc[Creating a Makefile project].
35+
xref:cdt_w_basic.adoc[Creating a Managed Build System Makefile project].
3636

3737
Files are edited in the C/{cpp} editor located to the right of the C/{cpp}
3838
Projects view. The left margin of the C/{cpp} editor, called the marker

doc/org.eclipse.cdt.doc.user/src/getting_started/new_cbs_makefile_proj.adoc

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,29 +38,24 @@ A project has an associated builder that can incrementally compile source files
3838
To create a project:
3939

4040
. Select menu:File[New > Project].
41-
42-
41+
+
4342
When you create a new project, you are required to specify the project type.
4443
This project type will determine the toolchain, data, and tabs that the CDT uses/displays.
45-
4644
. Select the type of project to create. For this tutorial, expand the *C/{cpp}* folder and select *C/{cpp} Project*.
4745
. Click btn:[Next].
4846

4947
image:cdt_w_basic03a.png[Select project type]
5048

5149
The *C/{cpp} Project* wizard opens:
5250

53-
5451
image:c_cpp_project_wizard.png[width=515]
5552

56-
5753
By default, the CDT presents all *C/{cpp} Project* templates.
5854

5955
. Select the *Make* template filter and choose from the *Makefile project* project template.
60-
61-
56+
+
6257
image:c_cpp_project_wizard_makefile.png[]
63-
58+
+
6459
. Click btn:[Next].
6560
. In the *Project name* field, provide a name for the new project.
6661
. Leave the *Use Default Location* option selected.

doc/org.eclipse.cdt.doc.user/src/getting_started/new_cmake_proj.adoc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,9 @@ A project has an associated builder that can incrementally compile source files
3838
To create a project:
3939

4040
. Select menu:File[New > Project].
41-
42-
41+
+
4342
When you create a new project, you are required to specify the project type.
4443
This project type will determine the toolchain, data, and tabs that the CDT uses/displays.
45-
4644
. Select the type of project to create. For this tutorial, expand the *C/{cpp}* folder and select *C/{cpp} Project*.
4745
. Click btn:[Next].
4846

0 commit comments

Comments
 (0)