MCPcopy Create free account
hub / github.com/go-python/gopy / genMakefile

Method genMakefile

bind/gen.go:711–730  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

709}
710
711func (g *pyGen) genMakefile() {
712 gencmd := strings.Replace(g.cfg.Cmd, "gopy build", "gopy gen", 1)
713 gencmd = CmdStrToMakefile(gencmd)
714
715 pycfg, err := GetPythonConfig(g.cfg.VM)
716 if err != nil {
717 panic(err)
718 }
719
720 if g.mode == ModeExe {
721 g.makefile.Printf(MakefileExeTemplate, g.cfg.Name, g.cfg.Cmd, gencmd, g.cfg.VM, g.libext, pycfg.CFlags, pycfg.LdFlags)
722 } else {
723 winhack := ""
724 if WindowsOS {
725 winhack = fmt.Sprintf(`# windows-only sed hack here to fix pybindgen declaration of PyInit
726 sed -i "s/ PyInit_/ __declspec(dllexport) PyInit_/g" %s.c`, g.cfg.Name)
727 }
728 g.makefile.Printf(MakefileTemplate, g.cfg.Name, g.cfg.Cmd, gencmd, g.cfg.VM, g.libext, g.extraGccArgs, pycfg.CFlags, pycfg.LdFlags, winhack)
729 }
730}
731
732// generate external types, go code
733func (g *pyGen) genExtTypesGo() {

Callers 1

genPreMethod · 0.95

Calls 3

CmdStrToMakefileFunction · 0.85
GetPythonConfigFunction · 0.85
PrintfMethod · 0.80

Tested by

no test coverage detected