diff options
-rwxr-xr-x | interpreter.py | 3 | ||||
-rwxr-xr-x | shellgenerator.py | 8 |
2 files changed, 8 insertions, 3 deletions
diff --git a/interpreter.py b/interpreter.py index eb8e17a..5116f00 100755 --- a/interpreter.py +++ b/interpreter.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 diff --git a/shellgenerator.py b/shellgenerator.py index 60ece26..6ac6f0b 100755 --- a/shellgenerator.py +++ b/shellgenerator.py @@ -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): |