Better text output in shell script.

pull/15/head
Jussi Pakkanen 12 years ago
parent 4fbb42da96
commit 026aa086dc
  1. 3
      interpreter.py
  2. 8
      shellgenerator.py

@ -51,6 +51,9 @@ class Interpreter():
self.project = None
self.compilers = []
self.executables = {}
def get_project(self):
return self.project
def get_executables(self):
return self.executables

@ -29,7 +29,9 @@ class ShellGenerator():
self.interpreter.run()
outfilename = os.path.join(self.environment.get_build_dir(), self.build_filename)
outfile = open(outfilename, 'w')
outfile.write('#!/bin/sh\n')
outfile.write('#!/bin/sh\n\n')
outfile.write('echo This is an autogenerated shell script build file for project \\"%s\\".\n'
% self.interpreter.get_project())
self.generate_commands(outfile)
outfile.close()
os.chmod(outfilename, stat.S_IREAD | stat.S_IWRITE | stat.S_IEXEC |\
@ -55,7 +57,7 @@ class ShellGenerator():
commands += compiler.get_output_flags()
commands.append(abs_obj)
quoted = environment.shell_quote(commands) + ['\n']
outfile.write('\necho Compiling %s\n' % src)
outfile.write('\necho Compiling \\"%s\\"\n' % src)
outfile.write(' '.join(quoted))
return abs_obj
@ -67,7 +69,7 @@ class ShellGenerator():
commands += linker.get_output_flags()
commands.append(outname)
quoted = environment.shell_quote(commands) + ['\n']
outfile.write('\necho Linking %s.\n' % outname)
outfile.write('\necho Linking \\"%s\\".\n' % outname)
outfile.write(' '.join(quoted))
def generate_commands(self, outfile):

Loading…
Cancel
Save