package main
import "fmt"
func main() {
fmt.Println("Test")
}
'''
File : compileGo.py
Author : Mike
E-Mail : Mike_Zhang@live.com
'''
import os
srcSuffix = '.go'
dstSuffix = '.exe'
cmdCompile = "8g"
cmdLink = "8l"
fList = []
for dirPath,dirNames,fileNames in os.walk('.'):
for file in fileNames:
name,extension = os.path.splitext(file)
if extension == srcSuffix :
fList.append(name)
tmpName = name + '.8' # temp file
strCompile = '%s -o %s %s ' % (cmdCompile,tmpName,file)
print strCompile
os.popen(strCompile) # compile
strLink = '%s -o %s %s' % (cmdLink,name+dstSuffix,tmpName)
print strLink
os.popen(strLink) # link
os.remove(tmpName) # remove temp file
break # only search the current directory