add emms
[emacs.git] / .emacs.d / elisp / emms / Makefile
1 GZIP=gzip
2 MAN1PAGES=emms-print-metadata.1
3 DOCDIR=doc/
4 LISPDIR=lisp
5 SRCDIR=src
6
7 ALLSOURCE=$(wildcard $(LISPDIR)/*.el)
8 ALLCOMPILED=$(wildcard $(LISPDIR)/*.elc)
9
10 DESTDIR=
11 PREFIX=$(DESTDIR)/usr/local
12 INFODIR=$(PREFIX)/info
13 MAN1DIR=$(PREFIX)/share/man/man1
14 SITELISP=$(PREFIX)/share/emacs/site-lisp/emms
15
16 INSTALLINFO = /usr/sbin/install-info --info-dir=$(INFODIR)
17 CHANGELOG_CMD = git log --pretty=medium --no-merges
18
19 # The currently released version of EMMS
20 VERSION=3.0
21
22 .PHONY: all install lisp docs deb-install clean
23 .PRECIOUS: %.elc
24 all: lisp docs
25
26 autoloads:
27 $(MAKE) -C $(LISPDIR) emms-auto.el
28
29 lisp:
30 $(MAKE) -C $(LISPDIR)
31
32 docs:
33 $(MAKE) -C $(DOCDIR)
34
35 emms-print-metadata: $(SRCDIR)/emms-print-metadata.c
36 $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(SRCDIR)/$@ $< `taglib-config --cflags --libs` -ltag_c
37
38 install:
39 test -d $(SITELISP) || mkdir -p $(SITELISP)
40 test -d $(INFODIR) || install -d $(INFODIR)
41 install -m 644 $(ALLSOURCE) $(SITELISP)
42 install -m 644 $(ALLCOMPILED) $(SITELISP)
43 install -m 0644 $(DOCDIR)emms.info $(INFODIR)/emms
44 for p in $(MAN1PAGES) ; do $(GZIP) -9c $$p > $(MAN1DIR)/$$p.gz ; done
45 $(INSTALLINFO) emms.info
46
47 remove-info:
48 $(INSTALLINFO) --remove emms.info
49
50 ChangeLog:
51 $(CHANGELOG_CMD) > $@
52
53 clean:
54 -rm -f *~ $(DOCDIR)emms.info $(DOCDIR)emms.html $(SRCDIR)/emms-print-metadata
55 $(MAKE) -C $(LISPDIR) clean
56
57 dist: clean autoloads
58 git archive --format=tar --prefix=emms-$(VERSION)/ HEAD | \
59 (cd .. && tar xf -)
60 rm -f ../emms-$(VERSION)/.gitignore
61 cp lisp/emms-auto.el ../emms-$(VERSION)/lisp
62 $(CHANGELOG_CMD) > ../emms-$(VERSION)/ChangeLog
63
64 release: dist
65 (cd .. && tar -czf emms-$(VERSION).tar.gz \
66 emms-$(VERSION) ; \
67 zip -r emms-$(VERSION).zip emms-$(VERSION) && \
68 gpg --detach emms-$(VERSION).tar.gz && \
69 gpg --detach emms-$(VERSION).zip)
70
71 upload:
72 (cd .. && echo "Directory: emms" | gpg --clearsign > \
73 emms-$(VERSION).tar.gz.directive.asc && \
74 cp emms-$(VERSION).tar.gz.directive.asc \
75 emms-$(VERSION).zip.directive.asc && \
76 echo open ftp://ftp-upload.gnu.org > upload.lftp ; \
77 echo cd /incoming/ftp >> upload.lftp ; \
78 echo mput emms-$(VERSION).zip* >> upload.lftp ; \
79 echo mput emms-$(VERSION).tar.gz* >> upload.lftp ; \
80 echo close >> upload.lftp ; \
81 lftp -f upload.lftp ; \
82 rm -f upload.lftp)