mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-12 16:44:05 -08:00
Simplify GOPATH/dependency setup.
This commit is contained in:
parent
464524fa44
commit
13048b7468
36
Makefile
36
Makefile
|
@ -17,16 +17,16 @@ include Makefile.INCLUDE
|
||||||
|
|
||||||
all: binary test
|
all: binary test
|
||||||
|
|
||||||
$(GOCC): $(BUILD_PATH)/cache/$(GOPKG) $(FULL_GOPATH)
|
$(GOCC): $(BUILD_PATH)/cache/$(GOPKG)
|
||||||
tar -C $(BUILD_PATH)/root -xzf $<
|
tar -C $(BUILD_PATH)/root -xzf $<
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
advice:
|
advice: $(GOCC)
|
||||||
$(GO) vet ./...
|
$(GO) vet ./...
|
||||||
|
|
||||||
binary: build
|
binary: build
|
||||||
|
|
||||||
build: config dependencies tools web
|
build: config tools web $(GOPATH)
|
||||||
$(GO) build -o prometheus $(BUILDFLAGS) .
|
$(GO) build -o prometheus $(BUILDFLAGS) .
|
||||||
|
|
||||||
docker: build
|
docker: build
|
||||||
|
@ -49,7 +49,7 @@ tag:
|
||||||
$(BUILD_PATH)/cache/$(GOPKG):
|
$(BUILD_PATH)/cache/$(GOPKG):
|
||||||
$(CURL) -o $@ -L $(GOURL)/$(GOPKG)
|
$(CURL) -o $@ -L $(GOURL)/$(GOPKG)
|
||||||
|
|
||||||
benchmark: config dependencies tools
|
benchmark: config dependencies tools web
|
||||||
$(GO) test $(GO_TEST_FLAGS) -test.run='NONE' -test.bench='.*' -test.benchmem ./... | tee benchmark.txt
|
$(GO) test $(GO_TEST_FLAGS) -test.run='NONE' -test.bench='.*' -test.benchmem ./... | tee benchmark.txt
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
@ -62,17 +62,21 @@ clean:
|
||||||
-find . -type f -name '*#' -exec rm '{}' ';'
|
-find . -type f -name '*#' -exec rm '{}' ';'
|
||||||
-find . -type f -name '.#*' -exec rm '{}' ';'
|
-find . -type f -name '.#*' -exec rm '{}' ';'
|
||||||
|
|
||||||
config: dependencies
|
config:
|
||||||
$(MAKE) -C config
|
$(MAKE) -C config
|
||||||
|
|
||||||
dependencies: $(GOCC) $(FULL_GOPATH)
|
$(SELFLINK): $(GOPATH)
|
||||||
cp -a $(CURDIR)/Godeps/_workspace/src/* $(GOPATH)/src
|
ln -s $(CURDIR) $@
|
||||||
$(GO) get -d
|
|
||||||
|
$(GOPATH):
|
||||||
|
cp -a $(CURDIR)/Godeps/_workspace $(GOPATH)
|
||||||
|
|
||||||
|
dependencies: $(GOCC) | $(SELFLINK)
|
||||||
|
|
||||||
documentation: search_index
|
documentation: search_index
|
||||||
godoc -http=:6060 -index -index_files='search_index'
|
godoc -http=:6060 -index -index_files='search_index'
|
||||||
|
|
||||||
format:
|
format: dependencies
|
||||||
find . -iname '*.go' | egrep -v "^\./\.build|./generated|\./Godeps|\.(l|y)\.go" | xargs -n1 $(GOFMT) -w -s=true
|
find . -iname '*.go' | egrep -v "^\./\.build|./generated|\./Godeps|\.(l|y)\.go" | xargs -n1 $(GOFMT) -w -s=true
|
||||||
|
|
||||||
race_condition_binary: build
|
race_condition_binary: build
|
||||||
|
@ -87,22 +91,16 @@ run: binary
|
||||||
search_index:
|
search_index:
|
||||||
godoc -index -write_index -index_files='search_index'
|
godoc -index -write_index -index_files='search_index'
|
||||||
|
|
||||||
server: config dependencies
|
|
||||||
$(MAKE) -C server
|
|
||||||
|
|
||||||
# $(FULL_GOPATH) is responsible for ensuring that the builder has not done anything
|
|
||||||
# stupid like working on Prometheus outside of ${GOPATH}.
|
|
||||||
$(FULL_GOPATH):
|
|
||||||
-[ -d "$(FULL_GOPATH)" ] || { mkdir -vp $(FULL_GOPATH_BASE) ; ln -s "$(PWD)" "$(FULL_GOPATH)" ; }
|
|
||||||
[ -d "$(FULL_GOPATH)" ]
|
|
||||||
|
|
||||||
test: config dependencies tools web
|
test: config dependencies tools web
|
||||||
$(GO) test $(GO_TEST_FLAGS) ./...
|
$(GO) test $(GO_TEST_FLAGS) ./...
|
||||||
|
|
||||||
tools: dependencies
|
tools: dependencies
|
||||||
$(MAKE) -C tools
|
$(MAKE) -C tools
|
||||||
|
|
||||||
web: config dependencies
|
web: dependencies
|
||||||
$(MAKE) -C web
|
$(MAKE) -C web
|
||||||
|
|
||||||
|
rules: dependencies
|
||||||
|
$(MAKE) -C rules
|
||||||
|
|
||||||
.PHONY: advice binary build clean config dependencies documentation format race_condition_binary race_condition_run release run search_index tag tarball test tools
|
.PHONY: advice binary build clean config dependencies documentation format race_condition_binary race_condition_run release run search_index tag tarball test tools
|
||||||
|
|
|
@ -49,9 +49,8 @@ GOENV = TMPDIR=$(TMPDIR) GOROOT=$(GOROOT) GOPATH=$(GOPATH)
|
||||||
GO = $(GOENV) $(GOCC)
|
GO = $(GOENV) $(GOCC)
|
||||||
GOFMT = $(GOROOT)/bin/gofmt
|
GOFMT = $(GOROOT)/bin/gofmt
|
||||||
|
|
||||||
UNAME := $(shell uname)
|
UNAME := $(shell uname)
|
||||||
FULL_GOPATH := $(GOPATH)/src/github.com/prometheus/prometheus
|
SELFLINK = $(GOPATH)/src/github.com/prometheus/prometheus
|
||||||
FULL_GOPATH_BASE := $(GOPATH)/src/github.com/prometheus
|
|
||||||
|
|
||||||
export PREFIX=$(BUILD_PATH)/root
|
export PREFIX=$(BUILD_PATH)/root
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue