一、geth makefile 以及编译逻辑

上篇提到用 make geth 来编译geth客户端。我们来看看make file做了什么:

.PHONY: geth android ios evm all test cleanGOBIN = ./build/binGO ?= latestGORUN = env GO111MODULE=on go rungeth:$(GORUN) build/ci.go install ./cmd/geth@echo "Done building."@echo "Run \"$(GOBIN)/geth\" to launch geth."all:$(GORUN) build/ci.go install

执行了 ci.go

func main() {log.SetFlags(log.Lshortfile)if !common.FileExist(filepath.Join("build", "ci.go")) {log.Fatal("this script must be run from the root of the repository")}if len(os.Args) < 2 {log.Fatal("need subcommand as first argument")}switch os.Args[1] {case "install":doInstall(os.Args[2:])}

里面做了两件事情
1,ln -s命令在build/_workspace/ 目录上生成了go-etherum的一个文件镜像,不占用磁盘空间,与源文件同步更新

2