()
| 709 | } |
| 710 | |
| 711 | func (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 |
| 733 | func (g *pyGen) genExtTypesGo() { |
no test coverage detected