Skip to content

Add option to choose make command #63

Closed
wants to merge 1 commit into from
View
8 ino/commands/build.py
@@ -43,6 +43,8 @@ def setup_arg_parser(self, parser):
super(Build, self).setup_arg_parser(parser)
self.e.add_board_model_arg(parser)
self.e.add_arduino_dist_arg(parser)
+ parser.add_argument('-c', '--make-command', metavar='MAKE_COMMAND',
+ default=self.e.default_make_command, help='Make command')
parser.add_argument('-v', '--verbose', default=False, action='store_true',
help='Verbose make output')
@@ -72,6 +74,9 @@ def discover(self):
tool_key, ['hardware', 'tools', 'avr', 'bin'],
items=[tool_binary], human_name=tool_binary)
+ def register_make_command(self, make_command):
+ self.make_command = make_command
+
def setup_flags(self, board_key):
board = self.e.board_model(board_key)
mcu = '-mmcu=' + board['build']['mcu']
@@ -135,7 +140,7 @@ def render_template(self, source, target, **ctx):
def make(self, makefile, **kwargs):
makefile = self.render_template(makefile + '.jinja', makefile, **kwargs)
- ret = subprocess.call(['make', '-f', makefile, 'all'])
+ ret = subprocess.call([self.make_command, '-f', makefile, 'all'])
if ret != 0:
raise Abort("Make failed with code %s" % ret)
@@ -203,6 +208,7 @@ def scan_dependencies(self):
def run(self, args):
self.discover()
+ self.register_make_command(args.make_command)
self.setup_flags(args.board_model)
self.create_jinja(verbose=args.verbose)
self.make('Makefile.sketch')
View
1 ino/environment.py
@@ -67,6 +67,7 @@ class Environment(dict):
if platform.system() == 'Darwin':
arduino_dist_dir_guesses.insert(0, '/Applications/Arduino.app/Contents/Resources/Java')
+ default_make_command = 'make'
default_board_model = 'uno'
ino = sys.argv[0]
Something went wrong with that request. Please try again.