Skip to content

Commit

Permalink
Processed review comments.
Browse files Browse the repository at this point in the history
Processed review comments and described the BUILD_MODE variable in
section "Building a project" for CBS Makefile projects.
  • Loading branch information
ewaterlander committed Jan 27, 2025
1 parent 378d553 commit 6ba2488
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ endif::[]

== Building a project

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

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

image:cbs_build_settings_tab_cmake.png[CMake build settings tab]

=== Makefile projects BUILD_MODE

For CBS Makefile projects the launch mode is passed to `make` via
environment variable `BUILD_MODE`. In the Makefile you can make use of
this variable to set the wanted `CFLAGS` per launch mode.

[cols="1,1"]
|===
|Launch mode | BUILD_MODE

|Run
|run

|Debug
|debug
|===

Here is some example code that makes use of `BUILD_MODE` to set the
wanted `CFLAGS`:

[source,makefile]
----
ifeq ($(BUILD_MODE),debug)
CFLAGS += -g -O0
else ifeq ($(BUILD_MODE),run)
CFLAGS += -O2
endif
----

icon:arrow-circle-right[] xref:cbs_run_project.adoc[Next: Running a project]
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ endif::[]

== Launch Bar

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

image:launchbar_preferences.png[Launch Bar preferences]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ endif::[]

== Using existing code

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

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

=== Using an existing CMake project

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

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

Then in the *New CMake Project* wizard deselect *Use default location*
In the *New CMake Project* wizard deselect *Use default location*
and set the location of the existing code.

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

=== Using an existing Makefile project

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

In the *New Makefile Project* wizard deselect *Use default location*
and set the location of the existing code, and deselect *Create Hello
In the *New Makefile Project* wizard deselect *Use default location*,
set the location of the existing code, and deselect *Create Hello
World Source and Makefile example*.

image:cbs_existing_code_makefile.png[Existing code Makefile]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Development Toolkit (CDT) to:
* xref:cdt_w_prepare_workbench.adoc[Prepare the Workbench]
* xref:cdt_w_basic.adoc[Create a simple application]
* xref:new_cmake_proj.adoc[Creating a CMake project]
* xref:cdt_w_newproj.adoc[Create a Makefile project]
* xref:cdt_w_basic.adoc[Create a Managed Build System Makefile project]
* xref:cdt_w_import.adoc[Import an existing project]
* xref:cdt_w_newcpp.adoc[Create a {cpp} file]
* xref:cdt_w_newmake.adoc[Create a makefile]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ endif::[]

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

Files are edited in the C/{cpp} editor located to the right of the C/{cpp}
Projects view. The left margin of the C/{cpp} editor, called the marker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,24 @@ A project has an associated builder that can incrementally compile source files
To create a project:

. Select menu:File[New > Project].


+
When you create a new project, you are required to specify the project type.
This project type will determine the toolchain, data, and tabs that the CDT uses/displays.

. Select the type of project to create. For this tutorial, expand the *C/{cpp}* folder and select *C/{cpp} Project*.
. Click btn:[Next].

image:cdt_w_basic03a.png[Select project type]

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


image:c_cpp_project_wizard.png[width=515]


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

. Select the *Make* template filter and choose from the *Makefile project* project template.


+
image:c_cpp_project_wizard_makefile.png[]

+
. Click btn:[Next].
. In the *Project name* field, provide a name for the new project.
. Leave the *Use Default Location* option selected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ A project has an associated builder that can incrementally compile source files
To create a project:

. Select menu:File[New > Project].


+
When you create a new project, you are required to specify the project type.
This project type will determine the toolchain, data, and tabs that the CDT uses/displays.

. Select the type of project to create. For this tutorial, expand the *C/{cpp}* folder and select *C/{cpp} Project*.
. Click btn:[Next].

Expand Down

0 comments on commit 6ba2488

Please sign in to comment.