Skip to content

Commit

Permalink
revert renaming cppflags to compile_flags
Browse files Browse the repository at this point in the history
See 8ac0a40 comments on GitHub
  • Loading branch information
nkrkv committed Sep 24, 2013
1 parent 2ed47f2 commit a4a16e9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
26 changes: 13 additions & 13 deletions ino/commands/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Build(Command):
default_ar = 'avr-ar'
default_objcopy = 'avr-objcopy'

default_compile_flags = '-ffunction-sections -fdata-sections -g -Os -w'
default_cppflags = '-ffunction-sections -fdata-sections -g -Os -w'
default_cflags = ''
default_cxxflags = '-fno-exceptions'
default_ldflags = '-Os --gc-sections'
Expand Down Expand Up @@ -86,29 +86,29 @@ def setup_arg_parser(self, parser):
'is not given, searches in Arduino directories '
'before PATH. Default: "%(default)s".')

parser.add_argument('-f', '--compile-flags', metavar='FLAGS',
default=self.default_compile_flags,
parser.add_argument('--cppflags', metavar='FLAGS',
default=self.default_cppflags,
help='Flags that will be passed to the compiler. '
'Note that multiple (space-separated) flags must '
'be surrounded by quotes, e.g. '
'`--compile-flags="-DC1 -DC2"\' specifies flags to define '
'`--cflags="-DC1 -DC2"\' specifies flags to define '
'the constants C1 and C2. Default: "%(default)s".')

parser.add_argument('--cflags', metavar='FLAGS',
default=self.default_cflags,
help='Like --compile-flags, but the flags specified are '
help='Like --cppflags, but the flags specified are '
'only passed to compilations of C source files. '
'Default: "%(default)s".')

parser.add_argument('--cxxflags', metavar='FLAGS',
default=self.default_cxxflags,
help='Like --compile-flags, but the flags specified '
help='Like --cppflags, but the flags specified '
'are only passed to compilations of C++ source '
'files. Default: "%(default)s".')

parser.add_argument('--ldflags', metavar='FLAGS',
default=self.default_ldflags,
help='Like --compile-flags, but the flags specified '
help='Like --cppflags, but the flags specified '
'are only passed during the linking stage. Note '
'these flags should be specified as if `ld\' were '
'being invoked directly (i.e. the `-Wl,\' prefix '
Expand Down Expand Up @@ -148,24 +148,24 @@ def setup_flags(self, args):
board = self.e.board_model(args.board_model)
mcu = '-mmcu=' + board['build']['mcu']
# Hard-code the flags that are essential to building the sketch
self.e['compile_flags'] = SpaceList([
self.e['cppflags'] = SpaceList([
mcu,
'-DF_CPU=' + board['build']['f_cpu'],
'-DARDUINO=' + str(self.e.arduino_lib_version.as_int()),
'-I' + self.e['arduino_core_dir'],
])
# Add additional flags as specified
self.e['compile_flags'] += SpaceList(shlex.split(args.compile_flags))
self.e['cppflags'] += SpaceList(shlex.split(args.cppflags))

if 'vid' in board['build']:
self.e['compile_flags'].append('-DUSB_VID=%s' % board['build']['vid'])
self.e['cppflags'].append('-DUSB_VID=%s' % board['build']['vid'])
if 'pid' in board['build']:
self.e['compile_flags'].append('-DUSB_PID=%s' % board['build']['pid'])
self.e['cppflags'].append('-DUSB_PID=%s' % board['build']['pid'])

if self.e.arduino_lib_version.major:
variant_dir = os.path.join(self.e.arduino_variants_dir,
board['build']['variant'])
self.e.compile_flags.append('-I' + variant_dir)
self.e.cppflags.append('-I' + variant_dir)

self.e['cflags'] = SpaceList(shlex.split(args.cflags))
self.e['cxxflags'] = SpaceList(shlex.split(args.cxxflags))
Expand Down Expand Up @@ -275,7 +275,7 @@ def scan_dependencies(self):
scanned_libs.add(lib)

self.e['used_libs'] = used_libs
self.e['compile_flags'].extend(self.recursive_inc_lib_flags(used_libs))
self.e['cppflags'].extend(self.recursive_inc_lib_flags(used_libs))

def run(self, args):
self.discover(args)
Expand Down
2 changes: 1 addition & 1 deletion ino/make/Makefile.deps.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{% for source, target in cpp.items() %}
{{ target.path }} : {{ source.path }}
@mkdir -p {{ target.path|dirname }}
{{v}}{{ e.cc }} {{ e.compile_flags }} {{ inc_flags }} {{ iquote(source) }} -MM $^ > $@
{{v}}{{ e.cc }} {{ e.cppflags }} {{ inc_flags }} {{ iquote(source) }} -MM $^ > $@
{# prepend build path to a target in the generated file and
add .d file itself as a target so that changes in a header file would rebuild dependency files
See: http://make.paulandlesley.org/autodep.html #}
Expand Down
4 changes: 2 additions & 2 deletions ino/make/Makefile.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ include {{ target.path|depsname }}
{% endmacro %}

{% macro compile_c(filemap) %}
{{ compile(filemap, e.cc ~ ' ' ~ e.compile_flags ~ ' ' ~ e.cflags) }}
{{ compile(filemap, e.cc ~ ' ' ~ e.cppflags ~ ' ' ~ e.cflags) }}
{% endmacro %}

{% macro compile_cpp(filemap) %}
{{ compile(filemap, e.cxx ~ ' ' ~ e.compile_flags ~ ' ' ~ e.cxxflags) }}
{{ compile(filemap, e.cxx ~ ' ' ~ e.cppflags ~ ' ' ~ e.cxxflags) }}
{% endmacro %}

{#
Expand Down

0 comments on commit a4a16e9

Please sign in to comment.