From a4a16e91587b5ccaf5a177e478a349de63acb23e Mon Sep 17 00:00:00 2001 From: Victor Nakoryakov Date: Tue, 24 Sep 2013 13:35:46 +0400 Subject: [PATCH] revert renaming cppflags to compile_flags See 8ac0a403ff76a1c9698840b931c09633d2fccef8 comments on GitHub --- ino/commands/build.py | 26 +++++++++++++------------- ino/make/Makefile.deps.jinja | 2 +- ino/make/Makefile.jinja | 4 ++-- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/ino/commands/build.py b/ino/commands/build.py index 9906417..1ce313f 100644 --- a/ino/commands/build.py +++ b/ino/commands/build.py @@ -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' @@ -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 ' @@ -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)) @@ -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) diff --git a/ino/make/Makefile.deps.jinja b/ino/make/Makefile.deps.jinja index e5a2f7d..fafbe5a 100644 --- a/ino/make/Makefile.deps.jinja +++ b/ino/make/Makefile.deps.jinja @@ -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 #} diff --git a/ino/make/Makefile.jinja b/ino/make/Makefile.jinja index cdde7a4..afe8538 100644 --- a/ino/make/Makefile.jinja +++ b/ino/make/Makefile.jinja @@ -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 %} {#