{"id":112388,"date":"2020-02-16T10:24:38","date_gmt":"2020-02-16T02:24:38","guid":{"rendered":"http:\/\/4563.org\/?p=112388"},"modified":"2020-02-16T10:24:38","modified_gmt":"2020-02-16T02:24:38","slug":"%e5%88%86%e4%ba%ab%e4%b8%80%e4%b8%aa-go-%e7%9a%84-makefile%ef%bc%8c%e8%af%b7%e6%8c%87%e6%95%99","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=112388","title":{"rendered":"\u5206\u4eab\u4e00\u4e2a go \u7684 makefile\uff0c\u8bf7\u6307\u6559"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5206\u4eab\u4e00\u4e2a go \u7684 makefile\uff0c\u8bf7\u6307\u6559               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dafsic <\/span>  <span><i><\/i> 56<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u4e0d\u662f\u8bf4\u591a\u725b\u903c\uff0c\u4e5f\u662f\u4ece\u7f51\u4e0a\u5404\u79cd\u5730\u65b9\u6284\u6765\u7684\uff0c\u5c31\u662f\u81ea\u5df1\u5199\u4ee3\u7801\u591f\u7528\u4e86\uff0c\u9700\u8981\u7684\u53ef\u4ee5\u53c2\u8003\uff0c\u597d\u7684\u4f18\u5316\u5efa\u8bae\u4e5f\u63d0\u63d0\uff0c\u529b\u6c42\u7b80\u5355\u660e\u4e86\u3002<\/p>\n<pre><code>APP:=xxx PACKAGE:=github.com\/xxx\/xxx  GO_VERSION:=$(shell go version) BUILD_TIME:=$(shell date +%Y-%m-%dT%H:%M:%S%z) COMMIT_HASH:=$(shell git rev-parse --short=8 HEAD || echo unknown) GIT_BRANCH:=$(shell git rev-parse --abbrev-ref HEAD) GIT_TAG:=$(shell git tag)  GO_LDFLAGS += -X '$(PACKAGE)\/version.BUILD_TIME=$(BUILD_TIME)' GO_LDFLAGS += -X '$(PACKAGE)\/version.GO_VERSION=$(GO_VERSION)' GO_LDFLAGS += -X '$(PACKAGE)\/version.COMMIT_HASH=$(COMMIT_HASH)' GO_LDFLAGS += -X '$(PACKAGE)\/version.GIT_BRANCH=$(GIT_BRANCH)' GO_LDFLAGS += -X '$(PACKAGE)\/version.PROJECT_VERSION=$(GIT_TAG)' GO_LDFLAGS += -s -w  .PHONY: default darwin linux clean check  default: linux ## Build the default binary file (default: linux)  check: ## Check working tree is clean or not ifneq ($(shell git status -s),)  $(error You must run git commit) endif  linux: check ## Build the ELF binary file  GOOS=linux GOARCH=amd64 CGO_ENABLE=0 go build -mod=readonly -ldflags \"$(GO_LDFLAGS)\" -o $(APP) .  darwin: check ## Build the Mach-O binary file  GOOS=darwin GOARCH=amd64 CGO_ENABLE=0 go build -mod=readonly -ldflags \"$(GO_LDFLAGS)\" -o $(APP) .  clean: ## Remove previous build  go clean  help: ## Display this help screen  @grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = \":.*?## \"}; {printf \"\u000033[36m%-30s\u000033[0m %sn\", $$1, $$2}' <\/code><\/pre>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>11<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"276775\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : MeteorCat <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7528 markfile \u8c03 shell \u6765\u641e golang\uff0c\u4fc4\u7f57\u65af\u5957\u5a03\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"276776\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lhx2008 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6ca1\u770b\u660e\u767d\u548c\u76f4\u63a5\u8c03 go \u547d\u4ee4\u7684\u533a\u522b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"276777\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : dafsic <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u987a\u4fbf\u89e3\u91ca\u4e00\u53e5\u4f5c\u7528\uff0c1.mac \u4e0a\u5199\u4ee3\u7801\uff0c\u4ea4\u53c9\u7f16\u8bd1\u6210 elf \u6587\u4ef6\u30022.\u5c06 git \u7684\u5206\u652f\u3001commit id\u3001tag\u3001\u7f16\u8bd1\u65f6\u95f4\u3001go \u7248\u672c\u4fe1\u606f\u7f16\u8bd1\u5230 elf \u4e2d\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"276778\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : tiedan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u611f\u89c9\u76f4\u63a5\u7528 shell \u811a\u672c\u4f1a\u4e0d\u4f1a\u66f4\u597d                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"276779\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dreamerlv3ex <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u8fd8\u4ee5\u4e3a\u662f\u771f\u7684 makefile\uff0c\u5413\u6211\u4e00\u8df3\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"276780\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : tairan2006 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @lhx2008 \u7528\u811a\u672c\u5c11\u6253\u70b9\u5b57                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"276781\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : LANB0 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u4e00\u770b\u5c31\u662f\u4ece C\/C++\u8f6c\u8fc7\u53bb\u7684\uff0c\u548c\u767e\u5ea6\u90a3\u4e2a BFE \u4e00\u4e2a\u8def\u5b50                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"276782\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : petelin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5c31\u662f\u8d77\u4e2a\u522b\u540d                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"276783\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wakaka <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u64b8\u70b9\u590d\u6742\u7684\u5de5\u4f5c\u8fd8\u53ef\u4ee5\uff0c\u6bd4\u5982\u751f\u6210 grpc \u7684 pb \u6587\u4ef6\u7b49\u7b49                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"276784\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ppphp <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             GIT_TAG:=$(shell git tag) <br \/>\u8fd9\u4e2a\u80fd\u884c\u5417\u3002\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"276785\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dyrone <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u90e8\u95e8\u63cf\u8ff0\uff1a<\/p>\n<p>\u4ee3\u7801\u5e73\u53f0\uff08\u4ee3\u7801\u6258\u7ba1\u3001\u4ee3\u7801\u6548\u80fd\u3001\u4ee3\u7801\u667a\u80fd\uff09\u662f\u963f\u91cc\u5df4\u5df4\u4e00\u7ad9\u5f0f\u667a\u80fd\u7814\u53d1\u534f\u540c\u5e73\u53f0\u7684\u6838\u5fc3\u670d\u52a1\uff0c\u5bf9\u5185\u4e3a\u963f\u91cc\u51e0\u4e07\u4ea7\u54c1\u7814\u53d1\u76f8\u5173\u4eba\u5458\u63d0\u4f9b\u5de5\u5177\u652f\u6491\uff0c\u5bf9\u5916\u662f\u963f\u91cc\u4e91\u5f00\u53d1\u8005\u751f\u6001\u5173\u952e\u4e00\u73af\u3002\u201cWork Like Alibaba\u201d\u5c06\u6210\u4e3a\u4e2d\u56fd\u53ca\u81f3\u5168\u4e16\u754c\u5f00\u53d1\u8005\u6700\u6f6e\u6d41\u7684\u53e3\u53f7\u3002<\/p>\n<p>\u672c\u804c\u4f4d\u4e3b\u8981\u804c\u8d23\u662f\u8d1f\u8d23\u4ee3\u7801\u5e73\u53f0\u57fa\u7840\u8bbe\u65bd\u7684\u67b6\u6784\u6f14\u8fdb\u3001Git \u6838\u5fc3\u6280\u672f\u5f00\u53d1\uff0c\u4ee3\u7801\u9886\u57df\u6280\u672f\u8d8b\u52bf\u8ddf\u8e2a\u3001\u4e0b\u4e00\u4ee3\u4ee3\u7801\u5e73\u53f0\u9884\u8a00\u3002\u6211\u4eec\u662f\u4e00\u7fa4\u61c2\u4ee3\u7801\uff0c\u7231 Git\uff0c\u6709\u6280\u672f\u6709\u68a6\u60f3\u7684\u5de5\u7a0b\u5e08\u3002\u8ba9\u6211\u4eec\u4e00\u8d77\u643a\u624b\u89e3\u51b3\u8de8\u5730\u57df\u3001\u5206\u5e03\u5f0f\u3001\u6d77\u91cf\u4ee3\u7801\u6258\u7ba1\u7b49\u4e16\u754c\u7ea7\u4e1a\u52a1\u548c\u6280\u672f\u96be\u9898\uff0c\u4e3a\u963f\u91cc\u5df4\u5df4\u96c6\u56e2\u5185\u90e8\u3001\u751f\u6001\u4f19\u4f34\u4ee5\u53ca\u4e91\u4e0a\u5f00\u53d1\u8005\u670d\u52a1\u3002<\/p>\n<p>\u6211\u4eec\u7684\u4f7f\u547d\uff1a\u5e2e\u52a9\u4f01\u4e1a\u8ba9\u66f4\u591a\u7684\u5de5\u4f5c\u5185\u5bb9\u548c\u5de5\u4f5c\u884c\u4e3a \u201c\u6709\u610f\u4e49\u201d \u7684\u6570\u5b57\u5316\u3002<br \/>\u6211\u4eec\u7684\u613f\u666f\uff1a\u670d\u52a1\u4e00\u4ebf\u4eba\u7684\u6570\u5b57\u5316\u529e\u516c\u3002<\/p>\n<p>\u5c97\u4f4d\u63cf\u8ff0\uff1a<br \/>1\u3001\u4ee3\u7801\u5e73\u53f0\u540e\u7aef\u5927\u89c4\u6a21\u670d\u52a1\u5668\u96c6\u7fa4\u7684\u5206\u5e03\u5f0f\u67b6\u6784\u6f14\u8fdb\uff1b<br \/>2\u3001\u670d\u52a1\u5668\u8ba1\u7b97\u3001\u5b58\u50a8\u8d44\u6e90\u7684\u518d\u5e73\u8861\u3001\u6545\u969c\u4fee\u590d\u4e0e\u9694\u79bb\uff0c\u670d\u52a1\u5668\u667a\u80fd\u8fd0\u7ef4\uff1b<br \/>3\u3001\u57fa\u4e8e\u5206\u5e03\u5f0f\u5b58\u50a8\u7684\u4e0b\u4e00\u4ee3\u4ee3\u7801\u5e73\u53f0\uff0c\u5b9e\u73b0\u4f4e\u5ef6\u8fdf\u3001\u9ad8\u6548\u7387\u5728\u7ebf\u7f16\u7801\uff1b<br \/>4\u3001Git \u6838\u5fc3\u4ee3\u7801\u5f00\u53d1\uff0c\u4e1a\u754c\u8d8b\u52bf\u8ddf\u8e2a\uff0c\u4fdd\u6301\u6280\u672f\u9886\u5148\uff0c\u4f18\u5316\u7528\u6237\u4f53\u9a8c\u7b49\u7b49\u3002<\/p>\n<p>\u5c97\u4f4d\u8981\u6c42\uff1a<br \/>1\u30013 \u5230 8 \u5e74\u7684\u5de5\u4f5c\u7ecf\u9a8c\uff0c\u7cbe\u901a Go \u8bed\u8a00\u3001C \u8bed\u8a00\u6216 java \u8bed\u8a00\u7684\u4e00\u79cd\u3002<br \/>2\u3001\u719f\u6089\u5206\u5e03\u5f0f\u4e00\u81f4\u6027\u534f\u8bae\uff0c\u6709\u5206\u5e03\u5f0f\u7cfb\u7edf\u5f00\u53d1\u7ecf\u9a8c\u3002<br \/>3\u3001\u719f\u6089\u5fae\u670d\u52a1\u67b6\u6784\uff0cRPC \u7684\u57fa\u672c\u539f\u7406\u3001gRPC\u3001pb \u7b49\u539f\u7406\u548c\u4f7f\u7528\uff0c\u52a0\u5206\u3002<br \/>4\u3001\u70ed\u7231\u6280\u672f\uff0c\u6709\u8f83\u5f3a\u7684\u5b66\u4e60\u80fd\u529b\u3001\u826f\u597d\u7684\u56e2\u961f\u5408\u4f5c\u80fd\u529b\u3001\u6297\u538b\u80fd\u529b\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5206\u4eab\u4e00\u4e2a go \u7684 makefil&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/112388"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=112388"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/112388\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=112388"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=112388"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=112388"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}