-
Notifications
You must be signed in to change notification settings - Fork 161
/
Makefile
31 lines (26 loc) · 953 Bytes
/
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
PREFIX=/usr/local
BINDIR=$(PREFIX)/bin
RESOURCEDIR=$(PREFIX)/share/gitstats
RESOURCES=gitstats.css sortable.js *.gif
BINARIES=git-stats
VERSION=$(shell git describe 2>/dev/null || git rev-parse --short HEAD)
SEDVERSION=sed -ie 's/VERSION = 0/VERSION = "$(VERSION)"/'
all: help
help:
@echo "Usage:"
@echo
@echo "make install # install to ${PREFIX}"
@echo "make install PREFIX=~ # install to ~"
@echo "make release [VERSION=foo] # make a release tarball"
@echo
install:
install -d $(BINDIR) $(RESOURCEDIR)
install -v $(BINARIES) $(BINDIR)
install -v -m 644 $(RESOURCES) $(RESOURCEDIR)
$(SEDVERSION) $(BINDIR)/git-stats
release:
@cp git-stats git-stats.tmp
@$(SEDVERSION) git-stats.tmp
@tar --owner=0 --group=0 --transform 's!^!gitstats/!' --transform 's!gitstats.tmp!gitstats!' -zcf gitstats-$(VERSION).tar.gz git-stats.tmp $(RESOURCES) doc/ Makefile
@$(RM) git-stats.tmp
.PHONY: all help install release