Permalink
Browse files

Add option to choose make command (fix #60)

  • Loading branch information...
1 parent 77decf0 commit 1397ab64c75aa9180fe37075b7b5cb56deb71fc5 @Kernald committed Feb 19, 2013
Showing with 8 additions and 1 deletion.
  1. +7 −1 ino/commands/build.py
  2. +1 −0 ino/environment.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
@@ -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]

0 comments on commit 1397ab6

Please sign in to comment.