Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2020-01-24 23:01:27 +0300
committerJohn Cai <jcai@gitlab.com>2020-01-24 23:01:27 +0300
commit532de44fad8f1147d07beec20d8c96090b7c33d7 (patch)
tree660490eeac1c4aa77b291d0ad639282f0065b802
parent1b36528ba08c48fe1f2db2c45d62dbffe4f7c612 (diff)
Clean up Makefile
-rw-r--r--Makefile17
-rw-r--r--_support/Makefile.template1
2 files changed, 14 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 4c25507b8..10afe2289 100644
--- a/Makefile
+++ b/Makefile
@@ -5,16 +5,25 @@
# - re-generate _build/Makefile from makegen.go on each run
# - dispatch commands to _build/Makefile
#
-# "Magic" should happen in the makegen.go dynamic template. We want
-# _build/Makefile to be as static as possible.
+# Besides the targets that manage _build and _build/Makefile, all
+# targets in this Makefile should look like this:
+#
+# .PHONY: foobar
+# foobar: prepare-build
+# cd $(BUILD_DIR) && $(MAKE) $@
+#
+# All other logic should happen in _support/Makefile.template and
+# _support/makegen.go.
+#
BUILD_DIR = _build
PKG = gitlab.com/gitlab-org/gitaly
MAKEGEN = $(BUILD_DIR)/makegen
-# These variables are handed down to make in _build
-export PATH := $(BUILD_DIR)/bin:$(PATH)
+# These variables are used by makegen
export SOURCE_DIR := $(CURDIR)
+
+# Used to build _support/makegen.go
export GO111MODULE = on
all: build
diff --git a/_support/Makefile.template b/_support/Makefile.template
index 434d9d2f7..118100d6f 100644
--- a/_support/Makefile.template
+++ b/_support/Makefile.template
@@ -16,6 +16,7 @@ unexport GOROOT
export GOBIN = {{ .BuildDir }}/bin
export GO111MODULE=on
export GOPROXY ?= https://proxy.golang.org
+export PATH := {{ .BuildDir }}/bin:$(PATH)
.NOTPARALLEL: