MCPcopy Index your code
hub / github.com/go-python/gopy / CmdStrToMakefile

Function CmdStrToMakefile

bind/gen.go:697–709  ·  view source on GitHub ↗

CmdStrToMakefile does what is needed to make the command string suitable for makefiles * removes -output

(cmdstr string)

Source from the content-addressed store, hash-verified

695// CmdStrToMakefile does what is needed to make the command string suitable for makefiles
696// * removes -output
697func CmdStrToMakefile(cmdstr string) string {
698 if oidx := strings.Index(cmdstr, "-output="); oidx > 0 {
699 spidx := strings.Index(cmdstr[oidx:], " ")
700 cmdstr = cmdstr[:oidx] + cmdstr[oidx+spidx+1:]
701 }
702 cmds := strings.Fields(cmdstr)
703 ncmds := make([]string, 0, len(cmds)+1)
704 ncmds = append(ncmds, cmds[:2]...)
705 ncmds = append(ncmds, "-no-make")
706 ncmds = append(ncmds, cmds[2:]...)
707
708 return strings.Join(ncmds, " ")
709}
710
711func (g *pyGen) genMakefile() {
712 gencmd := strings.Replace(g.cfg.Cmd, "gopy build", "gopy gen", 1)

Callers 2

GenPyPkgSetupFunction · 0.92
genMakefileMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected