Skip to content

Commit a164224

Browse files
author
Bogdan Marinescu
committed
Changed prefix file name to mbed_conf.h
Also changed some function names to make it clear that the prefix headers feature is only used for config.
1 parent 85eca37 commit a164224

File tree

5 files changed

+29
-29
lines changed

5 files changed

+29
-29
lines changed

tools/build_api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ def build_project(src_path, build_path, target, toolchain_name,
232232
prev_features = features
233233
config.validate_config()
234234

235-
# Set the toolchain's prefix header with the config data
236-
toolchain.set_prefix_header_content(config.get_config_data_header())
235+
# Set the toolchain's config header with the config data
236+
toolchain.set_config_header_content(config.get_config_data_header())
237237

238238
# Compile Sources
239239
for path in src_paths:
@@ -403,8 +403,8 @@ def build_library(src_paths, build_path, target, toolchain_name,
403403
prev_features = features
404404
config.validate_config()
405405

406-
# Set the toolchain's prefix header with the config data
407-
toolchain.set_prefix_header_content(config.get_config_data_header())
406+
# Set the toolchain's config header with the config data
407+
toolchain.set_config_header_content(config.get_config_data_header())
408408

409409
# Compile Sources
410410
for path in src_paths:

tools/toolchains/__init__.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ def __init__(self, target, options=None, notify=None, macros=None, silent=False,
265265

266266
self.flags = deepcopy(self.DEFAULT_FLAGS)
267267

268-
# prefix_header_content will hold the content of the prefix header (if used)
269-
self.prefix_header_content = None
268+
# config_header_content will hold the content of the config header (if used)
269+
self.config_header_content = None
270270

271271
def get_output(self):
272272
return self.output
@@ -871,24 +871,24 @@ def mem_stats(self, map):
871871
memap.generate_output('csv-ci', map_csv)
872872

873873
# "Prefix headers" are automatically included by the compiler at the beginning of
874-
# each source file.
875-
# header_content - the content of the prefix header file.
876-
def set_prefix_header_content(self, header_content):
877-
self.prefix_header_content = header_content
874+
# each source file. They are used to provide configuration data.
875+
# header_content - the content of the config header file.
876+
def set_config_header_content(self, header_content):
877+
self.config_header_content = header_content
878878

879-
# Return the location of the prefix header. This function will create the prefix
880-
# header first if needed. The header will be written in a file called "mbed_prefix.h"
879+
# Return the location of the config header. This function will create the config
880+
# header first if needed. The header will be written in a file called "mbed_conf.h"
881881
# located in the project's build directory.
882-
# If prefix headers are not used (self.prefix_header_content is None), the function
882+
# If config headers are not used (self.config_header_content is None), the function
883883
# returns None
884-
def get_prefix_header(self):
885-
if self.prefix_header_content is None:
884+
def get_config_header(self):
885+
if self.config_header_content is None:
886886
return None
887-
prefix_file = join(self.build_dir, "mbed_prefix.h")
888-
if not exists(prefix_file):
889-
with open(prefix_file, "wt") as f:
890-
f.write(self.prefix_header_content)
891-
return prefix_file
887+
config_file = join(self.build_dir, "mbed_conf.h")
888+
if not exists(config_file):
889+
with open(config_file, "wt") as f:
890+
f.write(self.config_header_content)
891+
return config_file
892892

893893

894894
from tools.settings import ARM_BIN

tools/toolchains/arm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ def get_dep_option(self, object):
116116

117117
def get_compile_options(self, defines, includes):
118118
opts = ['-D%s' % d for d in defines] + ['--via', self.get_inc_file(includes)]
119-
prefix_header = self.get_prefix_header()
120-
if prefix_header is not None:
121-
opts = opts + ['--preinclude', prefix_header]
119+
config_header = self.get_config_header()
120+
if config_header is not None:
121+
opts = opts + ['--preinclude', config_header]
122122
return opts
123123

124124
@hook_tool

tools/toolchains/gcc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ def get_dep_option(self, object):
167167

168168
def get_compile_options(self, defines, includes):
169169
opts = ['-D%s' % d for d in defines] + ['@%s' % self.get_inc_file(includes)]
170-
prefix_header = self.get_prefix_header()
171-
if prefix_header is not None:
172-
opts = opts + ['-include', prefix_header]
170+
config_header = self.get_config_header()
171+
if config_header is not None:
172+
opts = opts + ['-include', config_header]
173173
return opts
174174

175175
@hook_tool

tools/toolchains/iar.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ def cc_extra(self, object):
120120

121121
def get_compile_options(self, defines, includes):
122122
opts = ['-D%s' % d for d in defines] + ['-f', self.get_inc_file(includes)]
123-
prefix_header = self.get_prefix_header()
124-
if prefix_header is not None:
125-
opts = opts + ['--preinclude', prefix_header]
123+
config_header = self.get_config_header()
124+
if config_header is not None:
125+
opts = opts + ['--preinclude', config_header]
126126
return opts
127127

128128
@hook_tool

0 commit comments

Comments
 (0)