func compileFile(path, dirName, execName string, cgoEnabled bool) error {
	tmpExecPath, err := compileSingleFile(path, cgoEnabled)
	if err != nil {
		fmt.Println("File: " + path + " | Impossible to compile.")
		return err
	}
	execVersion := ""
	if execName == "" {
		execName, execVersion, err = commons.GetNameVersion(tmpExecPath)
		if err == nil {
			execName = createFilenameExecutable(execName, execVersion)
		} else {
			fmt.Println("File: " + path + " | Error in the executable info.")
			fmt.Println("File: " + path + " | Falling back to use the hash as name.")
			hashName, err := commons.ExecutableHash(tmpExecPath)
			if err != nil {
				fmt.Println("File: " + path + " | Error in generating the hash name.")
				fmt.Println("File: " + path + " | Actual path is: " + tmpExecPath)
				return err
			}
			execName = hashName
		}
	}
	totalPath, err := filepath.Abs(dirName + `/` + execName)
	if err != nil {
		fmt.Println("File: " + path + " | Error in getting the absolute path.\nActual path is: " + tmpExecPath)
		return err
	}
	if err := os.MkdirAll(filepath.Dir(totalPath), 0777); err != nil {
		fmt.Println("File: " + path + " | Impossible to create the directory: " + filepath.Dir(totalPath))
		fmt.Println("Actual path is: " + tmpExecPath)
		return err
	}
	if err := os.Rename(tmpExecPath, totalPath); err != nil {
		fmt.Println(err)
		fmt.Println("File: " + path + " | Impossible to move the executable.\nActual path is: " + tmpExecPath)
	}
	fmt.Println("File: " + path + " | Everything went good, the file is been compiled.\nExecutable path: " + totalPath)
	return nil
}
compileFile is the entry point to compile an effe source.
The actual compilation is done by `compileSingleFile` but
`compileFile` takes care of move the binary where the user
is expecting.
It first compile the file (passed as path).
It execute the just compiled file to gather information
about name and version.
Finally it moves the executable.

`path` is where the effe source is located.
`dirName` rappresent in which directory save the executable,
it has a default value set on the flag to `out`.
`execName` is the name of the executable, if not given
`compileFile` try to use the effe convetion to provide a name.
package builder
import (
	"fmt"
	"github.com/codegangsta/cli"
	"github.com/siscia/effe-tool/commons"
	"github.com/siscia/effe-tool/sources"
	"os"
	"os/exec"
	"path/filepath"
)
func createFilenameExecutable(name, version string) string {
	return name + "_v" + version
}
func compileSingleFile(sourcePath string, cgoEnabled bool) (string, error) {
	dir := os.TempDir() + "/effebuild-" + commons.RandomSuffix()
	if err := os.Mkdir(dir, 0777); err != nil {
		fmt.Println(err)
		return "", err
	}
	dirEffe := dir + "/src/github.com/siscia/effe"
	if err := os.MkdirAll(dirEffe, 0777); err != nil {
		fmt.Println(err)
		return "", err
	}
	if err := os.Mkdir(dirEffe+"/logic", 0777); err != nil {
		fmt.Println(err)
		return "", err
	}
	if err := os.Link(sourcePath, dirEffe+"/logic/logic.go"); err != nil {
		fmt.Println(err)
		return "", err
	}
	if err := commons.NewFile(dirEffe+"/effe.go", sources.Core); err != nil {
		fmt.Println("Impossible to create file, exit.")
		fmt.Println(err)
		return "", err
	}
	gopath := os.Getenv("GOPATH")
	os.Setenv("GOPATH", dir+":"+gopath)
	defer os.Setenv("GOPATH", gopath)
	if cgoEnabled == false {
		cgoEnabled := os.Getenv("CGO_ENABLED")
		os.Setenv("CGO_ENABLED", "0")
		defer os.Setenv("CGO_ENABLED", cgoEnabled)
	}
	cmd := exec.Command("go", "build", "-a", "-ldflags", "'-s'", "-o", dir+"/out", "-buildmode=exe", dirEffe+"/effe.go")
	cmd.Stdout = os.Stdout
	cmd.Stderr = os.Stderr
	if err := cmd.Start(); err != nil {
		fmt.Println(err)
		return "", err
	}
	if err := cmd.Wait(); err != nil {
		fmt.Println(err)
		return "", err
	}
	return dir + "/out", nil
}