diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2013-03-01 22:03:31 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2013-03-01 22:03:31 +0200 |
commit | 8f1764b8f5b53cd6524bc5bc3fcc6f0b7100533c (patch) | |
tree | 8184fc56894263c5fef9b113c8b772f95e90d44b | |
parent | 6247fe8bb259f1b979c9b5d661a73159abc961e5 (diff) | |
download | meson-8f1764b8f5b53cd6524bc5bc3fcc6f0b7100533c.zip meson-8f1764b8f5b53cd6524bc5bc3fcc6f0b7100533c.tar.gz meson-8f1764b8f5b53cd6524bc5bc3fcc6f0b7100533c.tar.bz2 |
Final pieces of NinjaBuildElement usage.
-rwxr-xr-x | backends.py | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/backends.py b/backends.py index 54d0570..b282b6b 100755 --- a/backends.py +++ b/backends.py @@ -518,12 +518,6 @@ class NinjaBackend(Backend): elem.add_dep(dep_targets) elem.add_item('LINK_FLAGS', commands) return elem - #build = 'build %s: %s %s %s\n' % \ - #(ninja_quote(outname), linker_rule, ' '.join([ninja_quote(i) for i in obj_list]), - # dep_targets) - #flags = ' LINK_FLAGS = %s\n' % ' '.join([ninja_quote(a) for a in commands]) - #outfile.write(build) - #outfile.write(flags) def generate_shlib_aliases(self, target, outdir, outfile, elem): basename = target.get_filename() @@ -538,18 +532,22 @@ class NinjaBackend(Backend): def generate_ending(self, outfile): targetlist = [self.get_target_filename(t) for t in self.build.get_targets().values()] - build = 'build all: phony %s\n' % ' '.join(targetlist) + elem = NinjaBuildElement('all', 'phony', targetlist) + elem.write(outfile) + default = 'default all\n\n' - outfile.write(build) outfile.write(default) - deps = [ ninja_quote(os.path.join(self.build_to_src, df)) \ + + deps = [os.path.join(self.build_to_src, df) \ for df in self.interpreter.get_build_def_files()] - depstr = ' '.join(deps) - buildregen = 'build build.ninja: REGENERATE_BUILD | %s\n\n' % depstr - outfile.write(buildregen) + elem = NinjaBuildElement('build.ninja', 'REGENERATE_BUILD', deps) + elem.write(outfile) - ignore_missing = 'build %s: phony\n\n' % depstr + phonydeps = [ ninja_quote(os.path.join(self.build_to_src, df)) \ + for df in self.interpreter.get_build_def_files()] + phonydepstr = ' '.join(phonydeps) + ignore_missing = 'build %s: phony\n\n' % phonydepstr outfile.write(ignore_missing) class ShellBackend(Backend): |