aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2012-12-29 22:13:14 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2012-12-29 22:13:14 +0200
commit026aa086dcb09d48ef658ccfc3e4a857bf416016 (patch)
treefe63efa5cdada37ade538058136096bd8d3165c4
parent4fbb42da96c25002a6170a4bca4e8f4eb7f2b94e (diff)
downloadmeson-026aa086dcb09d48ef658ccfc3e4a857bf416016.zip
meson-026aa086dcb09d48ef658ccfc3e4a857bf416016.tar.gz
meson-026aa086dcb09d48ef658ccfc3e4a857bf416016.tar.bz2
Better text output in shell script.
-rwxr-xr-xinterpreter.py3
-rwxr-xr-xshellgenerator.py8
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):