Fix another pathname encoding issue (bug 1570)
[gpodder.git] / makefile
blobe35c54bd7e598d1599c4f92fad013bd36c55da4d
2 # gPodder - A media aggregator and podcast client
3 # Copyright (c) 2005-2012 Thomas Perl and the gPodder Team
5 # gPodder is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # gPodder is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 ##########################################################################
22 BINFILE = bin/gpodder
23 MESSAGESPOT = po/messages.pot
24 POFILES = $(wildcard po/*.po)
25 MANPAGE = share/man/man1/gpodder.1
27 UIFILES=$(wildcard share/gpodder/ui/gtk/*.ui)
28 UIFILES_H=$(subst .ui,.ui.h,$(UIFILES))
29 QMLFILES=$(wildcard share/gpodder/ui/qml/*.qml)
30 TRANSLATABLE_SOURCE=$(wildcard src/gpodder/*.py \
31 src/gpodder/gtkui/*.py \
32 src/gpodder/gtkui/interface/*.py \
33 src/gpodder/gtkui/desktop/*.py \
34 src/gpodder/qmlui/*.py \
35 src/gpodder/webui/*.py \
36 src/gpodder/plugins/*.py \
37 share/gpodder/extensions/*.py)
39 GPODDER_SERVICE_FILE=share/dbus-1/services/org.gpodder.service
40 GPODDER_SERVICE_FILE_IN=$(addsuffix .in,$(GPODDER_SERVICE_FILE))
42 GPODDER_DESKTOP_FILE=share/applications/gpodder.desktop
43 GPODDER_DESKTOP_FILE_IN=$(addsuffix .in,$(GPODDER_DESKTOP_FILE))
44 GPODDER_DESKTOP_FILE_H=$(addsuffix .h,$(GPODDER_DESKTOP_FILE_IN))
46 DESTDIR ?= /
47 PREFIX ?= /usr
49 PYTHON ?= python
50 HELP2MAN ?= help2man
52 ##########################################################################
54 help:
55 @cat tools/make-help.txt
57 ##########################################################################
59 unittest:
60 PYTHONPATH=src/ $(PYTHON) -m gpodder.unittests
62 deb:
63 debuild
65 release: distclean
66 $(PYTHON) setup.py sdist
68 releasetest: unittest $(GPODDER_DESKTOP_FILE)
69 desktop-file-validate $(GPODDER_DESKTOP_FILE)
70 sh po/validate.sh
72 $(GPODDER_SERVICE_FILE): $(GPODDER_SERVICE_FILE_IN)
73 sed -e 's#__PREFIX__#$(PREFIX)#' $< >$@
75 $(GPODDER_DESKTOP_FILE): $(GPODDER_DESKTOP_FILE_IN) $(POFILES)
76 intltool-merge -d -u po $< $@
78 $(GPODDER_DESKTOP_FILE_IN).h: $(GPODDER_DESKTOP_FILE_IN)
79 intltool-extract --quiet --type=gettext/ini $<
81 install: messages $(GPODDER_SERVICE_FILE) $(GPODDER_DESKTOP_FILE)
82 $(PYTHON) setup.py install --root=$(DESTDIR) --prefix=$(PREFIX)
84 ##########################################################################
86 manpage: $(MANPAGE)
88 $(MANPAGE): src/gpodder/__init__.py $(BINFILE)
89 $(HELP2MAN) --name="$(shell $(PYTHON) setup.py --description)" -N $(BINFILE) >$(MANPAGE)
91 ##########################################################################
93 messages: $(MESSAGESPOT)
94 $(MAKE) -C po
96 %.ui.h: $(UIFILES)
97 intltool-extract --quiet --type=gettext/glade $(subst .ui.h,.ui,$@)
99 $(MESSAGESPOT): $(TRANSLATABLE_SOURCE) $(UIFILES_H) $(QMLFILES) $(BINFILE) $(GPODDER_DESKTOP_FILE_H)
100 xgettext -LPython -k_:1 -kN_:1 -kN_:1,2 -kn_:1,2 -o $(MESSAGESPOT) $^
102 ##########################################################################
104 # This only works in a Git working commit, and assumes that the local Git
105 # HEAD has already been pushed to the main repository. It's mainly useful
106 # for the gPodder maintainer to quickly generate a commit link that can be
107 # posted online in bug trackers and mailing lists.
109 headlink:
110 @echo http://gpodder.org/commit/`git show-ref HEAD | head -c8`
112 ##########################################################################
114 clean:
115 $(PYTHON) setup.py clean
116 find src/ '(' -name '*.pyc' -o -name '*.pyo' ')' -exec rm '{}' +
117 find src/ -type d -name '__pycache__' -exec rm -r '{}' +
118 find share/gpodder/ui/ -name '*.ui.h' -exec rm '{}' +
119 rm -f MANIFEST PKG-INFO .coverage messages.mo
120 rm -f $(GPODDER_SERVICE_FILE)
121 rm -f $(GPODDER_DESKTOP_FILE)
122 rm -f $(GPODDER_DESKTOP_FILE_H)
123 rm -rf build
124 $(MAKE) -C po clean
126 distclean: clean
127 rm -rf dist
129 ##########################################################################
131 .PHONY: help unittest release releasetest install manpage clean distclean messages headlink
133 ##########################################################################