diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2020-01-24 23:01:27 +0300 |
---|---|---|
committer | John Cai <jcai@gitlab.com> | 2020-01-24 23:01:27 +0300 |
commit | 532de44fad8f1147d07beec20d8c96090b7c33d7 (patch) | |
tree | 660490eeac1c4aa77b291d0ad639282f0065b802 | |
parent | 1b36528ba08c48fe1f2db2c45d62dbffe4f7c612 (diff) |
Clean up Makefile
-rw-r--r-- | Makefile | 17 | ||||
-rw-r--r-- | _support/Makefile.template | 1 |
2 files changed, 14 insertions, 4 deletions
@@ -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: |