build: Build script improvements

This commit is contained in:
Alexander Afanasyev
2014-12-20 17:56:50 -08:00
parent 7ce4e68e5e
commit 8200d73066
2 changed files with 18 additions and 13 deletions
+15 -10
View File
@@ -1,4 +1,3 @@
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
import os, os.path
@@ -335,8 +334,8 @@ class ns3pcfile_task(Task.Task):
def __str__(self):
"string to display to the user"
tgt_str = ' '.join([a.bldpath() for a in self.outputs])
return 'pcfile: %s\n' % (tgt_str)
tgt_str = ' '.join([a.path_from(a.ctx.launch_node()) for a in self.outputs])
return 'pcfile: %s' % (tgt_str)
def runnable_status(self):
return super(ns3pcfile_task, self).runnable_status()
@@ -473,13 +472,19 @@ class ns3header_task(Task.Task):
def __str__(self):
"string to display to the user"
env = self.env
src_str = ' '.join([a.bldpath() for a in self.inputs])
tgt_str = ' '.join([a.bldpath() for a in self.outputs])
src_str = ' '.join([a.path_from(a.ctx.launch_node()) for a in self.inputs])
tgt_str = ' '.join([a.path_from(a.ctx.launch_node()) for a in self.outputs])
if self.outputs: sep = ' -> '
else: sep = ''
if self.mode == 'remove':
return 'rm-ns3-header %s' % (self.header_to_remove.abspath(),)
return 'install-ns3-header: %s' % (tgt_str)
return '%s' % (self.header_to_remove.abspath(),)
return '%s%s%s' % (src_str, sep, tgt_str)
def keyword(self):
if self.mode == 'remove':
return "Removing"
else:
return "Copying"
def __repr__(self):
return str(self)
@@ -644,13 +649,13 @@ class gen_ns3_module_header_task(Task.Task):
def __str__(self):
"string to display to the user"
env = self.env
src_str = ' '.join([a.bldpath() for a in self.inputs])
tgt_str = ' '.join([a.bldpath() for a in self.outputs])
src_str = ' '.join([a.path_from(a.ctx.launch_node()) for a in self.inputs])
tgt_str = ' '.join([a.path_from(a.ctx.launch_node()) for a in self.outputs])
if self.outputs: sep = ' -> '
else: sep = ''
if self.mode == 'remove':
return 'rm-module-header %s' % (self.header_to_remove.abspath(),)
return 'gen-module-header: %s' % (tgt_str)
return 'gen-module-header: %s%s%s' % (src_str, sep, tgt_str)
def run(self):
if self.mode == 'remove':
+3 -3
View File
@@ -21,8 +21,8 @@ class command_task(Task.Task):
def __str__(self):
"string to display to the user"
env = self.env
src_str = ' '.join([a.bldpath() for a in self.inputs])
tgt_str = ' '.join([a.bldpath() for a in self.outputs])
src_str = ' '.join([a.path_from(a.ctx.launch_node()) for a in self.inputs])
tgt_str = ' '.join([a.path_from(a.ctx.launch_node()) for a in self.outputs])
if self.outputs:
sep = ' -> '
else:
@@ -31,7 +31,7 @@ class command_task(Task.Task):
pipeline = shellcmd.Pipeline()
pipeline.parse(self.generator.command)
cmd = pipeline.get_abbreviated_command()
return 'command (%s): %s%s%s\n' % (cmd, src_str, sep, tgt_str)
return 'command (%s): %s%s%s' % (cmd, src_str, sep, tgt_str)
def _subst_arg(self, arg, direction, namespace):
"""