-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
74 lines (59 loc) · 1.58 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
project = muttqt
srcdir = .
mansubdir = man
binsubdir = bin
docsdir = docs
scriptsdir = scripts
prefix ?= /usr/local
mandir ?= $(prefix)/share/man/man1
mans = $(addprefix $(docsdir)/,*.1)
# distribution variables
# VERSIONNUM:=$(shell test -d .git && git describe --abbrev=0 --tags)
VERSIONNUM:=$(shell grep '^__version' muttqt | cut -d '"' -f2)
BUILDNUM:=$(shell test -d .git && git rev-parse --short HEAD)
distdir = $(project)-$(VERSIONNUM)
# ronn/man variables
rdate = `date +'%Y-%m-%d'`
rmanual = muttqt
rorg = protozoic
all: muttqt docs
docs: $(mans)
test:
echo $(VERSIONNUM)
echo ${prefix}
echo ${mandir}
gtag:
git tag -am "muttqt $(VERSIONNUM)" $(VERSIONNUM)
# make bin/
$(binsubdir):
-mkdir -p $(binsubdir)
# copy to bindir and replace version in file
muttqt: $(binsubdir)
cp muttqt $(binsubdir)/
./version.sh $(binsubdir)/muttqt
# install files to their proper locations.
install: all
-mkdir -p $(prefix)
-mkdir -p $(prefix)/bin
-mkdir -p $(prefix)/share/$(project)
-mkdir -p $(mandir)
install $(binsubdir)/* $(prefix)/bin/
install $(scriptsdir)/* $(prefix)/share/$(project)/
install -m 644 $(docsdir)/*.1 $(mandir)
# make the man files from the ronn files if needed
$(docsdir)/%.1: $(docsdir)/%.1.ronn
ronn -r --date=$(rdate) --manual="$(rmanual)" --organization="$(rorg)" $(docsdir)/$*.1.ronn
# remove generated man files
cleanman:
-rm $(docsdir)/*.1
dist: all
-mkdir -p $(distdir)
git archive master | tar -x -C $(distdir)
tar czf $(distdir).tgz $(distdir)
rm -rf $(distdir)
distclean: clean cleantgz
clean:
-rm -rf bin
-rm -f *~
cleantgz:
-rm -f $(distdir).tgz