Skip to content

Commit 8c87c26

Browse files
committed
Updated README.md to include instructions for different operating systems. Reduced duplicate code.
1 parent d93bdaf commit 8c87c26

File tree

2 files changed

+36
-16
lines changed

2 files changed

+36
-16
lines changed

tools/export/cces/README.md.tmpl

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
1-
CrossCore Embedded Studio (CCES) can generate IDE projects from the command line using .json input files.
1+
# Create and build CrossCore Embedded Studio projects
2+
CrossCore Embedded Studio (CCES) can generate and build IDE projects from the command line using .json input files.
3+
4+
## Create a new project
25

36
Run the following headless tools command to create your CrossCore Embedded Studio project using the .json file generated by the ARM mbed exporter:
4-
> {{ project_create_command }}
7+
{% for operating_system, command in commands['create'].items() %}
8+
### {{ operating_system }}
9+
> {{ command }}
10+
11+
{% endfor %}
12+
where "CCES_HOME" is an environment variable pointing to the root CCES installation directory and "WORKSPACE" is the path to the desired CCES workspace directory.
513

6-
where "WORKSPACE" is the path to the desired CCES workspace directory.
14+
Once the CrossCore Embedded Studio project is generated, you can import the project into the IDE for development and debugging.
715

8-
Once the CrossCore Embedded Studio project is generated, you can import the project into the IDE for development and debugging. You can also use headless tools to build the project with the following command:
9-
> {{ project_build_command }}
16+
## Build a project
17+
Once created, you can use headless tools to build the project with the following command:
18+
{% for operating_system, command in commands['build'].items() %}
19+
### {{ operating_system }}
20+
> {{ command }}
1021

11-
where "WORKSPACE" is the path to the desired CCES workspace directory.
22+
{% endfor %}
23+
where "CCES_HOME" is an environment variable pointing to the root CCES installation directory and "WORKSPACE" is the path to the desired CCES workspace directory.
1224

1325
For more information on how to use CrossCore Embedded Studio and headless tools, please see the CrossCore Embedded Studio Help.

tools/export/cces/__init__.py

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,7 @@ def convert_common_options(prefix, options, flags):
139139
# remove these flags without converting to option
140140
# since they are added by CCES
141141
remove = ["-c"]
142-
for flag in remove:
143-
if flag in flags:
144-
flags.remove(flag)
142+
CCES.clean_flags(flags, remove)
145143

146144
value = prefix + "option.dwarfversion.enumerated.v2"
147145
for flag in flags:
@@ -163,9 +161,7 @@ def convert_assembler_options(flags):
163161
# remove these flags without converting to option
164162
# since they are added by CCES
165163
remove = ["-x", "assembler-with-cpp"]
166-
for flag in remove:
167-
if flag in flags:
168-
flags.remove(flag)
164+
CCES.clean_flags(flags, remove)
169165

170166
booleans = {"-v": "arm.assembler.option.verbose",
171167
"-g": "arm.assembler.option.debuginfo"}
@@ -389,11 +385,23 @@ def generate(self):
389385
# generate a readme on how to create the CCES project
390386
# using the generated .json file
391387

388+
cces_paths = {
389+
"Windows" : "%CCES_HOME%\\Eclipse\\ccesc.exe",
390+
"Linux" : "${CCES_HOME}/Eclipse/cces",
391+
"MacOS" : "${CCES_HOME}/MacOS/cces"
392+
}
393+
394+
commands = {"create":{}, "build":{}}
395+
for operating_system, path in cces_paths.items():
396+
commands["create"][operating_system] = \
397+
CCES.get_project_create_command(path, \
398+
"WORKSPACE", project)
399+
commands["build"][operating_system] = \
400+
CCES.get_project_build_command(path, \
401+
"WORKSPACE", project)
402+
392403
jinja_ctx = {
393-
'project_create_command' : CCES.get_project_create_command("cces", \
394-
"WORKSPACE", project),
395-
'project_build_command' : CCES.get_project_build_command("cces", \
396-
"WORKSPACE", project)
404+
'commands' : commands
397405
}
398406

399407
self.gen_file('cces/README.md.tmpl', jinja_ctx, "README.md")

0 commit comments

Comments
 (0)