|
|
|
@ -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): |
|
|
|
|