mirror of
https://github.com/prometheus/alertmanager
synced 2025-04-11 03:31:55 +00:00
Merge pull request #25 from prometheus/makefile-cleanup
Makefile cleanup
This commit is contained in:
commit
ae70ec3ac5
41
Makefile
41
Makefile
@ -1,6 +1,4 @@
|
|||||||
# -*- Mode: makefile -*-
|
# Copyright 2013 The Prometheus Authors
|
||||||
|
|
||||||
# Copyright 2013 Prometheus Team
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
@ -15,10 +13,22 @@
|
|||||||
|
|
||||||
include Makefile.INCLUDE
|
include Makefile.INCLUDE
|
||||||
|
|
||||||
all: build test
|
default: $(BINARY)
|
||||||
|
|
||||||
build: config web
|
.deps/$(GOPKG):
|
||||||
$(GO) build $(BUILDFLAGS)
|
mkdir -p .deps
|
||||||
|
curl -o .deps/$(GOPKG) -L $(GOURL)/$(GOPKG)
|
||||||
|
|
||||||
|
$(GOCC): .deps/$(GOPKG)
|
||||||
|
tar -C .deps -xzf .deps/$(GOPKG)
|
||||||
|
touch $@
|
||||||
|
|
||||||
|
$(SELFLINK):
|
||||||
|
mkdir -p $(GOPATH)/src/github.com/prometheus
|
||||||
|
ln -s $(CURDIR) $(SELFLINK)
|
||||||
|
|
||||||
|
dependencies: $(SELFLINK) web config
|
||||||
|
$(GO) get -d
|
||||||
|
|
||||||
config:
|
config:
|
||||||
$(MAKE) -C config
|
$(MAKE) -C config
|
||||||
@ -26,11 +36,22 @@ config:
|
|||||||
web:
|
web:
|
||||||
$(MAKE) -C web
|
$(MAKE) -C web
|
||||||
|
|
||||||
test: build
|
$(BINARY): $(GOCC) dependencies
|
||||||
$(GO) test -v ./...
|
$(GO) build $(BUILDFLAGS) -o $@
|
||||||
|
|
||||||
|
$(ARCHIVE): $(BINARY)
|
||||||
|
tar -czf $@ $<
|
||||||
|
|
||||||
|
release: REMOTE ?= $(error "can't release, REMOTE not set")
|
||||||
|
release: REMOTE_DIR ?= $(error "can't release, REMOTE_DIR not set")
|
||||||
|
release: $(ARCHIVE)
|
||||||
|
scp $< $(REMOTE):$(REMOTE_DIR)/$(ARCHIVE)
|
||||||
|
|
||||||
|
test: $(GOCC) dependencies
|
||||||
|
$(GO) test ./...
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(MAKE) -C web clean
|
$(MAKE) -C web clean
|
||||||
-rm alertmanager
|
-rm -rf alertmanager .deps
|
||||||
|
|
||||||
.PHONY: clean config web
|
.PHONY: clean config default dependencies release test web
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
# -*- Mode: makefile -*-
|
# Copyright 2013 The Prometheus Authors
|
||||||
|
|
||||||
# Copyright 2013 Prometheus Team
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
@ -13,11 +11,39 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
.SUFFIXES:
|
VERSION := 0.1.0
|
||||||
|
|
||||||
GO := $(GOROOT)/bin/go
|
TARGET := alertmanager
|
||||||
|
|
||||||
|
OS := $(subst Darwin,darwin,$(subst Linux,linux,$(shell uname)))
|
||||||
|
ARCH := $(subst x86_64,amd64,$(shell uname -m))
|
||||||
|
|
||||||
|
# The release engineers apparently need to key their binary artifacts to the
|
||||||
|
# Mac OS X release family.
|
||||||
|
MAC_OS_X_VERSION ?= 10.8
|
||||||
|
|
||||||
|
GOOS ?= $(OS)
|
||||||
|
GOARCH ?= $(ARCH)
|
||||||
|
|
||||||
|
ifeq ($(GOOS),darwin)
|
||||||
|
RELEASE_SUFFIX ?= -osx$(MAC_OS_X_VERSION)
|
||||||
|
else
|
||||||
|
RELEASE_SUFFIX ?=
|
||||||
|
endif
|
||||||
|
|
||||||
|
GO_VERSION ?= 1.4.1
|
||||||
|
GOURL ?= https://golang.org/dl
|
||||||
|
GOPKG ?= go$(GO_VERSION).$(GOOS)-$(GOARCH)$(RELEASE_SUFFIX).tar.gz
|
||||||
|
GOROOT := $(PWD)/.deps/go
|
||||||
|
GOPATH := $(PWD)/.deps/gopath
|
||||||
|
GOCC := $(GOROOT)/bin/go
|
||||||
|
GO := GOROOT=$(GOROOT) GOPATH=$(GOPATH) $(GOCC)
|
||||||
GOFMT := $(GOROOT)/bin/gofmt
|
GOFMT := $(GOROOT)/bin/gofmt
|
||||||
GO_VERSION := 1.1
|
|
||||||
|
SUFFIX := $(GOOS)-$(GOARCH)
|
||||||
|
BINARY := $(TARGET)
|
||||||
|
ARCHIVE := $(TARGET)-$(VERSION).$(SUFFIX).tar.gz
|
||||||
|
SELFLINK := $(GOPATH)/src/github.com/prometheus/alertmanager
|
||||||
|
|
||||||
REV := $(shell git rev-parse --short HEAD)
|
REV := $(shell git rev-parse --short HEAD)
|
||||||
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
|
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
|
||||||
|
16
web/Makefile
16
web/Makefile
@ -1,4 +1,4 @@
|
|||||||
# Copyright 2013 Prometheus Team
|
# Copyright 2013 The Prometheus Authors
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
# You may obtain a copy of the License at
|
# You may obtain a copy of the License at
|
||||||
@ -11,14 +11,16 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
all: blob-stamp
|
include ../Makefile.INCLUDE
|
||||||
|
|
||||||
blob-stamp: templates/*
|
all: blob/files.go
|
||||||
$(MAKE) -C blob
|
|
||||||
touch $@
|
SUFFIXES:
|
||||||
|
|
||||||
|
blob/files.go: $(shell find templates/ static/ -type f)
|
||||||
|
./blob/embed-static.sh static templates | $(GOFMT) > $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(MAKE) -C blob clean
|
-rm -f blob/files.go
|
||||||
-rm -f *-stamp
|
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
# Copyright 2013 Prometheus Team
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
all: files.go
|
|
||||||
|
|
||||||
SUFFIXES:
|
|
||||||
|
|
||||||
files.go: $(shell find ../templates/ ../static/ -type f)
|
|
||||||
./embed-static.sh ../static ../templates | gofmt > $@
|
|
||||||
|
|
||||||
clean:
|
|
||||||
-rm files.go
|
|
||||||
-rm -rf generated
|
|
||||||
|
|
||||||
.PHONY: clean
|
|
1109
web/static/vendor/bootstrap/css/bootstrap-responsive.css
vendored
1109
web/static/vendor/bootstrap/css/bootstrap-responsive.css
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
6167
web/static/vendor/bootstrap/css/bootstrap.css
vendored
6167
web/static/vendor/bootstrap/css/bootstrap.css
vendored
File diff suppressed because it is too large
Load Diff
2280
web/static/vendor/bootstrap/js/bootstrap.js
vendored
2280
web/static/vendor/bootstrap/js/bootstrap.js
vendored
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user