Use the full path for kibot in the makefile if not installed.

When we detect the run isn't from the system installation.
This commit is contained in:
Salvador E. Tropea 2021-02-10 19:47:15 -03:00
parent f744892810
commit 99dfbbd99d
1 changed files with 4 additions and 1 deletions

View File

@ -344,7 +344,10 @@ def generate_makefile(makefile, cfg_file, outputs):
with open(makefile, 'wt') as f:
f.write('#!/usr/bin/make\n')
f.write('# Automatically generated by KiBot from `{}`\n'.format(cfg_file))
f.write('KIBOT=kibot\n')
fname = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'src', 'kibot'))
if not os.path.isfile(fname):
fname = 'kibot'
f.write('KIBOT={}\n'.format(fname))
f.write('DEBUG=\n')
f.write('CONFIG={}\n'.format(cfg_file))
f.write('SCH={}\n'.format(os.path.relpath(GS.sch_file)))