This repository was archived by the owner on Jan 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathglobals.mk
More file actions
59 lines (49 loc) · 1.38 KB
/
globals.mk
File metadata and controls
59 lines (49 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
export GO?=go
export GOFMT?=gofmt
INDENT_0:=""
INDENT_1:=" "
INDENT_2:="$(INDENT_1)$(INDENT_1)"
INDENT:="$(or $(INDENT_$(MAKELEVEL)),"... $(INDENT_2)")"
# go1.9 can just use "./..." - although gometalinter still includes the vendor
NO_VENDOR?=$(shell GOPATH=$(GOPATH) go list ./... | grep -v /vendor/)
#
# From any make rule, you can use this to let you know what's
# running .. helps to give more understandable console output.
#
# foo:
# $(call PROMPT,$@)
#
ifndef PROMPT
define PROMPT
@echo
@echo "$(INDENT)**********************************************************"
@echo "$(INDENT)*"
@echo "$(INDENT)* ($(notdir $(shell pwd))) $(1)"
@echo "$(INDENT)*"
@echo "$(INDENT)**********************************************************"
@echo
endef
endif
# for ldflags, see "go tool link -h"
STRIP_DEBUG:=-s -w
$(GOPATH)/bin:
$(call PROMPT,mkdir $@)
mkdir -p $@
PATH_GOPATHBIN:=$(subst ::,:,$(GOPATH)/bin:$(subst :$(GOPATH)/bin,:,$(PATH)))
# this allows you to run
#
# $ eval `make gopath`
#
.PHONY: gopath
gopath:
@echo export GOPATH=$(GOPATH)
@echo export PATH=$(PATH_GOPATHBIN)
OS:=$(shell uname -s)
#
# These are currently used for running tests. You could
# just unset the env var for the tests, but doing it like
# this allows you to override from the commandline if you
# want.
#
export GOHOSTOS:=$(shell $(GO) env GOHOSTOS)
export GOHOSTARCH:=$(shell $(GO) env GOHOSTARCH)