1

I am using scons. In my project I got a situation like to compile the .src files.

To compile them I have created a new builder. Code for new builder is

    asmcode_generator = Builder(action = '$ASCOM', single_source = 1,  suffix = '.obj')
    env.Append(BUILDERS = {'AsmCodeGenerator' : asmcode_generator})

And I am compiling the .src file with the above builder. Code is as below.

    sources = env.AsmCodeGenerator(service.src)

above code is working fine and generating the .obj file.

I want to print a String when an object file is generated. for that I did the below.

     env['ASCOMSTR'] = "= Assembling $SOURCE "

But it is not printing this string while compiling. The above code is working when an assembly file is compiled by scons builder.

can any one tell me how to do this.

4

1 回答 1

0

您所拥有的是一个带有命令字符串的操作对象(无论 $ASCOM 作为命令行计算的结果)并且没有构建字符串(因为您没有指定一个)。

您需要更完整地创建自己的操作对象,因此:

 asmcode_generate = Builder(action = Action('$ASCOM', 'Assembling $SOURCE'), ...)
于 2013-05-23T10:02:27.007 回答