-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
56 lines (41 loc) · 1.29 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
SHELL := /bin/bash
VERSION := $(shell cat VERSION)
BUILDDIR ?= .build
.DEFAULT_GOAL := build
.PHONY: all build bumpversionminor bumpversionmajor clean format install scan-build srpm srpm-release tag
$(BUILDDIR):
@echo $(BUILDDIR) not existing run \'meson $(BUILDDIR)\'
@exit -1
all: format build
build: $(BUILDDIR)
ninja -C $(BUILDDIR)
clean: $(BUILDDIR)
ninja -C $(BUILDDIR) clean
install: $(BUILDDIR)
DESTDIR=$(DESTDIR) ninja -C $(BUILDDIR) install
format: $(BUILDDIR)
ninja -C $(BUILDDIR) clang-format
scan-build: $(BUILDDIR)
ninja -C $(BUILDDIR) scan-build
srpm: $(BUILDDIR)
make -C pkg/testing/rpm outdir=$(CURDIR)
srpm-release: $(BUILDDIR)
make -C pkg/release/rpm outdir=$(CURDIR)
bumpversionminor bumpversionmajor:
$(eval BUMP = $(shell echo $@ | sed 's/bumpversion//'))
@IFS='.' read -r -a ver <<< "$(VERSION)"; \
if [ "$(BUMP)" = "major" ]; then \
ver[0]=$$(($${ver[0]} + 1)); \
elif [ "$(BUMP)" = "minor" ]; then \
ver[1]=$$(($${ver[1]} + 1)); \
else \
echo invalid bump target \'$(BUMP)\'; \
exit -1; \
fi; \
BUMPED_VER="$${ver[0]}.$${ver[1]}"; \
echo "$$BUMPED_VER" > VERSION; \
git commit -vsam "Bump version to $$BUMPED_VER"
@echo "Don't forget to run 'make tag'"
tag:
git tag -sa $(VERSION) -m "$(VERSION)"
@echo "now run \'git push origin $(VERSION)\'"