-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
59 lines (44 loc) · 1.7 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
include local.mk
DISTNAME := $(MYNAME)-$(RELEASE)
TMP_WILD := $(TMP_WILD) *~ *.bak
TMP_PAT := $(subst *,%,$(TMP_WILD))
PROGS := $(PLAYER)
MANS := $(addprefix man/, $(PROGS:=.1))
DESKTOPS_IN := $(wildcard data/*.desktop.in)
DESKTOPS := $(DESKTOPS_IN:.in=)
CLEAN_FILES := $(MANS) $(DESKTOPS)
.PHONY: clean all srcdist
all: $(PROGS) $(MANS) $(DESKTOPS)
grep -q 'version = "%prog '"$(RELEASE)"'"' $(PLAYER)
man/%.1: % $(filter-out $(wildcard man), man) Makefile
help2man -N -o $@ $(abspath $<) || { $< --help || :; $< --version || :; false; }
%: %.in
sed -e 's!@RELEASE@!'"$(RELEASE)"'!g;s!@bindir@!'"$(bindir)"'!g;s!@PLAYER@!'"$(PLAYER)"'!g' <$< >$@
install: all installdirs
$(INSTALL_PROGRAM) $(PROGS) $(DESTDIR)$(bindir)
$(INSTALL_DATA) $(MANS) $(DESTDIR)$(man1dir)
$(INSTALL_DATA) $(DESKTOPS) $(DESTDIR)$(desktopdir)
$(INSTALL_DATA) LICENSE.txt $(DESTDIR)$(docdir)
$(INSTALL_DATA) README.org $(DESTDIR)$(docdir)
$(INSTALL_DATA) README.html $(DESTDIR)$(docdir)
clean:
set -f; for pat in $(TMP_WILD); do find . -iname $$pat -exec rm {} \; ; done; \
rm -rf $(CLEAN_FILES)
srcdist: clean
git archive --format=tar --prefix=$(DISTNAME)/ HEAD | \
gzip -c >/tmp/$(DISTNAME).tar.gz
showvars:
@echo "RELEASE := " $(RELEASE)
@echo "TMP_PAT := " $(TMP_PAT)
man:
mkdir man
debuild:
TMPDIR="/tmp/$(MYNAME)_$(RELEASE).orig"; \
rm -rf "$$TMPDIR"; cp -a . "$$TMPDIR"; cd "$$TMPDIR"; \
make clean; rm -rf debian; \
cd ..; tar cvzf "$$TMPDIR.tar.gz" "$${TMPDIR##*/}"; \
cd "$$TMPDIR"; cp -a mydebian debian; debuild -S; debuild -b
installdirs: mkinstalldirs
./mkinstalldirs $(DESTDIR)$(bindir) $(DESTDIR)$(datadir) \
$(DESTDIR)$(mandir) $(DESTDIR)$(man1dir) $(DESTDIR)$(desktopdir) \
$(DESTDIR)$(docdir)