File: Makefile

package info (click to toggle)
mpd-sima 0.9.2-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 700 kB
  • sloc: python: 2,766; xml: 921; sh: 329; makefile: 83
file content (67 lines) | stat: -rw-r--r-- 2,072 bytes parent folder | download | duplicates (2)
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
SHELL = /bin/sh
PREFIX = /usr/local
#DESTDIR = /tmp/mpd-sima
LIBDIR = $(DESTDIR)$(PREFIX)/lib
BIN = $(DESTDIR)$(PREFIX)/bin
ETC = $(DESTDIR)$(PREFIX)/etc
DATADIR = $(DESTDIR)$(PREFIX)/share
LOCALEDIR = $(DATADIR)/locale
MANDIR = $(DATADIR)/man

all: man bin
clean:
	rm -f mpd-sima.1.gz simadb_cli.1.gz mpd-sima.cfg.5.gz mpd-sima simadb_cli

mpd-sima.1.gz: data/mpd-sima.1
	cat data/mpd-sima.1 | gzip > mpd-sima.1.gz

mpd-sima.cfg.5.gz: data/mpd-sima.cfg.5
	cat data/mpd-sima.cfg.5 | gzip > mpd-sima.cfg.5.gz

simadb_cli.1.gz:
	cat data/simadb_cli.1 | gzip > simadb_cli.1.gz

simadb_cli:
	sed 's:%DESTDIR%%PREFIX%:${DESTDIR}${PREFIX}:' data/wrappers/simadb_cli > simadb_cli

mpd-sima:
	sed 's:%DESTDIR%%PREFIX%:${DESTDIR}${PREFIX}:' data/wrappers/mpd-sima > mpd-sima

bash_completion:
	install -d $(ETC)/bash_completion.d
	install -m644 data/mpd_sima.completion.sh $(ETC)/bash_completion.d/
	mv $(ETC)/bash_completion.d/mpd_sima.completion.sh $(ETC)/bash_completion.d/mpd-sima

man: mpd-sima.1.gz simadb_cli.1.gz mpd-sima.cfg.5.gz

bin: mpd-sima simadb_cli

install: man bin
	install -d $(BIN) $(DATADIR)/mpd-sima $(MANDIR)/man1 $(MANDIR)/man5

	install -m755 mpd-sima $(BIN)
	install -m755 simadb_cli $(BIN)

	install -m644 mpd-sima.1.gz simadb_cli.1.gz $(MANDIR)/man1
	install -m644 mpd-sima.cfg.5.gz $(MANDIR)/man5

	# listing all sub folder to install (prevent a remaining .svn directory to be install)
	for sourcedir in `find src/ -name .svn -prune -o -type d -print | sed 's:src/::g'` ; do \
		install -d $(DATADIR)/mpd-sima/$$sourcedir; \
		for sourcefile in `find src/$$sourcedir -maxdepth 1 -name *pyc -o -name .svn -prune -o -print` ; do \
			install -m644 $$sourcefile $(DATADIR)/mpd-sima/$$sourcedir; \
		done \
	done

	install -m755 src/mpd_sima $(DATADIR)/mpd-sima
	install -m755 src/simadb_cli $(DATADIR)/mpd-sima

uninstall:
	rm -f $(BIN)/mpd-sima
	rm -f $(BIN)/simadb_cli
	rm -f $(MANDIR)/man1/mpd-sima.1.gz
	rm -f $(MANDIR)/man1/simadb_cli.1.gz
	rm -f $(MANDIR)/man5/mpd-sima.cfg.5.gz
	rm -f $(ETC)/bash_completion.d/mpd-sima
	rm -rf $(DATADIR)/mpd-sima