diff --git a/generators.py b/generators.py index 7ec61352a..2a11170cc 100755 --- a/generators.py +++ b/generators.py @@ -80,13 +80,15 @@ class NinjaGenerator(Generator): outfile.write('# This is the build file for project "%s"\n' % self.build.get_project()) outfile.write('# It is autogenerated. Do not edit by hand.\n\n') self.generate_rules(outfile) - + self.generate_ending(outfile) + def generate_rules(self, outfile): outfile.write('# Rules for compiling.\n\n') self.generate_compile_rules(outfile) outfile.write('# Rules for linking.\n\n') self.generate_static_link_rules(outfile) self.generate_dynamic_link_rules(outfile) + [self.generate_target(outfile, t[1]) for t in self.build.get_targets()] def generate_static_link_rules(self, outfile): static_linker = self.build.static_linker @@ -112,7 +114,8 @@ class NinjaGenerator(Generator): outfile.write(command) outfile.write(description) outfile.write('\n') - + outfile.write('\n') + def generate_compile_rules(self, outfile): for compiler in self.build.compilers: langname = compiler.get_language() @@ -128,6 +131,15 @@ class NinjaGenerator(Generator): outfile.write('\n') outfile.write('\n') + def generate_target(self, outfile, target): + pass + + def generate_ending(self, outfile): + build = 'build all: phony %s\n' % ' '.join(self.build.get_targets().keys()) + default = 'default all\n\n' + outfile.write(build) + outfile.write(default) + class ShellGenerator(Generator): def __init__(self, build, interp): Generator.__init__(self, build, interp)