-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
39 lines (27 loc) · 1.12 KB
/
Makefile
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
PROJECT_ROOT := src/
VERSION = $(shell git describe --tags 2>/dev/null || git rev-parse HEAD)
.DEFAULT_GOAL := all
# We want to add compliance for all built binaries
_CHECK_COMPLIANCE = $(shell find src/ -not -path '*/vendor/*' -name '*.go' | xargs -I{} dirname {} |sed 's/src\///g' | uniq | sort)
_TESTS = $(shell find src/ -not -path '*/vendor/*' -name '*_test.go' | xargs -I{} dirname {} | sed 's/src\///g'|uniq | sort)
BINARIES = \
ferryctl \
ferryd
# Build all binaries as static binary
BINS = $(addsuffix .build,$(BINARIES))
GO_TESTS = $(addsuffix .test,$(_TESTS))
include Makefile.gobuild
# Ensure our own code is compliant..
compliant: $(addsuffix .compliant,$(_CHECK_COMPLIANCE))
install: $(BINS)
test -d $(DESTDIR)/usr/bin || install -D -d -m 00755 $(DESTDIR)/usr/bin; \
install -m 00755 bin/* $(DESTDIR)/usr/bin/.;
ensure_modules:
@ ( \
git submodule init; \
git submodule update; \
);
# See: https://github.com/meitar/git-archive-all.sh/blob/master/git-archive-all.sh
release: ensure_modules
git-archive-all.sh --format tar.gz --prefix ferryd-$(VERSION)/ --verbose -t HEAD ferryd-$(VERSION).tar.gz
all: $(BINS)