Generate some of targets.
This commit is contained in:
parent
40c001772b
commit
f5f783b382
|
@ -80,6 +80,7 @@ class NinjaGenerator(Generator):
|
||||||
outfile.write('# This is the build file for project "%s"\n' % self.build.get_project())
|
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')
|
outfile.write('# It is autogenerated. Do not edit by hand.\n\n')
|
||||||
self.generate_rules(outfile)
|
self.generate_rules(outfile)
|
||||||
|
self.generate_ending(outfile)
|
||||||
|
|
||||||
def generate_rules(self, outfile):
|
def generate_rules(self, outfile):
|
||||||
outfile.write('# Rules for compiling.\n\n')
|
outfile.write('# Rules for compiling.\n\n')
|
||||||
|
@ -87,6 +88,7 @@ class NinjaGenerator(Generator):
|
||||||
outfile.write('# Rules for linking.\n\n')
|
outfile.write('# Rules for linking.\n\n')
|
||||||
self.generate_static_link_rules(outfile)
|
self.generate_static_link_rules(outfile)
|
||||||
self.generate_dynamic_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):
|
def generate_static_link_rules(self, outfile):
|
||||||
static_linker = self.build.static_linker
|
static_linker = self.build.static_linker
|
||||||
|
@ -112,6 +114,7 @@ class NinjaGenerator(Generator):
|
||||||
outfile.write(command)
|
outfile.write(command)
|
||||||
outfile.write(description)
|
outfile.write(description)
|
||||||
outfile.write('\n')
|
outfile.write('\n')
|
||||||
|
outfile.write('\n')
|
||||||
|
|
||||||
def generate_compile_rules(self, outfile):
|
def generate_compile_rules(self, outfile):
|
||||||
for compiler in self.build.compilers:
|
for compiler in self.build.compilers:
|
||||||
|
@ -128,6 +131,15 @@ class NinjaGenerator(Generator):
|
||||||
outfile.write('\n')
|
outfile.write('\n')
|
||||||
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):
|
class ShellGenerator(Generator):
|
||||||
def __init__(self, build, interp):
|
def __init__(self, build, interp):
|
||||||
Generator.__init__(self, build, interp)
|
Generator.__init__(self, build, interp)
|
||||||
|
|
Loading…
Reference in New Issue