-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathMakefile
More file actions
78 lines (62 loc) · 1.91 KB
/
Copy pathMakefile
File metadata and controls
78 lines (62 loc) · 1.91 KB
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
75
76
77
78
PROGNM = pbpst
PREFIX ?= /usr/local
DOCDIR ?= $(DESTDIR)$(PREFIX)/share/man
LIBDIR ?= $(DESTDIR)$(PREFIX)/lib
BINDIR ?= $(DESTDIR)$(PREFIX)/bin
ZSHDIR ?= $(DESTDIR)$(PREFIX)/share/zsh
BASHDIR ?= $(DESTDIR)$(PREFIX)/share/bash-completion
LOCDIR ?= $(DESTDIR)$(PREFIX)/share/locale
include Makerules
.PHONY: all bin clean complexity clang-analyze cmp cov-build doc i18n pot install uninstall
all: dist bin cmp doc i18n
clang-analyze:
@(cd ./src; clang-check -analyze ./*.c)
clean:
@rm -rf -- dist cov-int $(PROGNM).tgz make.sh ./src/*.plist \
./i18n/$(PROGNM).pot
complexity:
@complexity -h ./src/*
cov-build: clean dist
@cov-build --dir cov-int ./make.sh
@tar czvf $(PROGNM).tgz cov-int
cmp: dist
@(for i in cmp/*sh*; do \
cp "$$i" dist/; \
done);
bin: dist
@(cd src; \
$(CC) $(CFLAGS) $(LDFLAGS) $(SOURCES) -o ../dist/pbpst \
)
dist:
@mkdir -p dist/locale
doc: dist
@(cd doc; \
sphinx-build -b man -Dversion=$(VER) \
-d doctree -E . ../dist $(PROGNM).rst $(PROGNM)_db.rst; \
rm -r -- doctree; \
)
i18n: dist
@(cd i18n; \
for i in *.po; do \
msgfmt "$$i" -o ../dist/locale/"$${i%.po}".mo; \
done)
pot:
@xgettext -k_ -c -d $(PROGNM) --no-wrap -o i18n/$(PROGNM).pot ./src/*.{c,h}
install:
@install -Dm755 dist/$(PROGNM) $(BINDIR)/$(PROGNM)
@install -Dm644 dist/$(PROGNM).1 $(DOCDIR)/man1/$(PROGNM).1
@install -Dm644 dist/pbpst_db.5 $(DOCDIR)/man5/pbpst_db.5
@install -Dm644 dist/zsh $(ZSHDIR)/site-functions/_$(PROGNM)
@install -Dm644 dist/bash $(BASHDIR)/completions/$(PROGNM)
@(for i in dist/locale/*.mo; do \
int="$$(basename "$$i" .mo)"; \
install -Dm644 $$i "$(LOCDIR)/$$int/LC_MESSAGES/$(PROGNM).mo"; \
done)
uninstall:
@rm -f $(BINDIR)/$(PROGNM)
@rm -f $(DOCDIR)/man1/$(PROGNM).1
@rm -f $(DOCDIR)/man5/pbpst_db.5
@rm -f $(ZSHDIR)/site-functions/_$(PROGNM)
@rm -f $(BASHDIR)/completions/$(PROGNM)
@rm -f $(LOCDIR)/*/LC_MESSAGES/$(PROGNM).mo
include Makeeaster