-
Notifications
You must be signed in to change notification settings - Fork 491
/
Makefile
34 lines (28 loc) · 1.05 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
PREFIX=/usr/local
BINDIR=$(PREFIX)/bin
RESOURCEDIR=$(PREFIX)/share/gitstats
RESOURCES=gitstats.css sortable.js *.gif
BINARIES=gitstats
VERSION=$(shell git describe 2>/dev/null || git rev-parse --short HEAD 2>/dev/null || date +%Y-%m-%d)
SEDVERSION=perl -pi -e '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)/gitstats
release:
@cp gitstats gitstats.tmp
@$(SEDVERSION) gitstats.tmp
@tar --owner=0 --group=0 --transform 's!^!gitstats/!' --transform 's!gitstats.tmp!gitstats!' -zcf gitstats-$(VERSION).tar.gz gitstats.tmp $(RESOURCES) doc/ Makefile
@$(RM) gitstats.tmp
man:
pod2man --center "User Commands" -r $(VERSION) doc/gitstats.pod > doc/gitstats.1
.PHONY: all help install release