Beispiel #1
0
    def CTNGenerate_C(self, buildpath, locations):
        current_location = self.GetCurrentLocation()
        location_str = "_".join(map(str, current_location))
        codeGenerator = CodeGenerator(self)

        text = ""

        text += codeGenerator.GenerateCode()

        text += "int __init_%s(int argc,char **argv)\n{\n"%location_str
        text += "\t" + codeGenerator.GeneretaInit()
        text += "\n}\n\n"

        text += "void __cleanup_%s(void)\n{\n"%location_str
        text += "\n}\n\n"

        text += "void __retrieve_%s(void)\n{\n"%location_str
        text += "   ;\n"
        text += "\n}\n\n"

        text += "void __publish_%s(void)\n{\n"%location_str
        text += "\n"
        text += "\n}\n\n"

        Gen_Cfile_path = os.path.join(buildpath, "mbSlave_%s.c"%location_str)
        cfile = open(Gen_Cfile_path,'w')
        cfile.write(text)
        cfile.close()

        matiec_flags = '"-I%s"'%os.path.abspath(self.GetCTRoot().GetIECLibPath())

        return [(Gen_Cfile_path, str(matiec_flags))],str(""),True