2 # gPodder - A media aggregator and podcast client
3 # Copyright (c) 2005-2018 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 ##########################################################################
23 MANPAGES
= share
/man
/man1
/gpodder
.1 share
/man
/man1
/gpo
.1
25 GPODDER_SERVICE_FILE
=share
/dbus-1
/services
/org.gpodder.service
26 GPODDER_SERVICE_FILE_IN
=$(addsuffix .in
,$(GPODDER_SERVICE_FILE
))
28 DESKTOP_FILES_IN
=$(wildcard share
/applications
/*.desktop.in
)
29 DESKTOP_FILES_IN_H
=$(patsubst %.desktop.in
,%.desktop.in.h
,$(DESKTOP_FILES_IN
))
30 DESKTOP_FILES
=$(patsubst %.desktop.in
,%.desktop
,$(DESKTOP_FILES_IN
))
32 MESSAGES
= po
/messages.pot
33 POFILES
= $(wildcard po
/*.po
)
34 LOCALEDIR
= share
/locale
35 MOFILES
= $(patsubst po
/%.po
,$(LOCALEDIR
)/%/LC_MESSAGES
/gpodder.mo
, $(POFILES
))
37 UIFILES
=$(wildcard share
/gpodder
/ui
/gtk
/*.ui
)
38 UIFILES_H
=$(subst .ui
,.ui.h
,$(UIFILES
))
39 GETTEXT_SOURCE
=$(wildcard src
/gpodder
/*.py \
40 src
/gpodder
/gtkui
/*.py \
41 src
/gpodder
/gtkui
/interface
/*.py \
42 src
/gpodder
/gtkui
/desktop
/*.py \
43 src
/gpodder
/plugins
/*.py \
44 share
/gpodder
/extensions
/*.py
)
46 GETTEXT_SOURCE
+= $(UIFILES_H
)
47 GETTEXT_SOURCE
+= $(wildcard bin
/*[^~
])
48 GETTEXT_SOURCE
+= $(DESKTOP_FILES_IN_H
)
56 PYTEST ?
= $(shell which pytest || which pytest-3
)
58 ##########################################################################
61 @cat tools
/make-help.txt
63 ##########################################################################
66 LC_ALL
=C PYTHONPATH
=src
/ $(PYTEST
) --ignore
=tests
--ignore
=src
/gpodder
/utilwin32ctypes.py
--doctest-modules src
/gpodder
/util.py src
/gpodder
/jsonconfig.py
67 LC_ALL
=C PYTHONPATH
=src
/ $(PYTEST
) tests
--ignore
=src
/gpodder
/utilwin32ctypes.py
--ignore
=src
/mygpoclient
--cov
=gpodder
69 ISORTOPTS
:= -c share src
/gpodder tools bin
/* *.py
71 pycodestyle share src
/gpodder tools bin
/* *.py
72 isort
-q
$(ISORTOPTS
) || isort
--df
$(ISORTOPTS
)
75 $(PYTHON
) setup.py sdist
77 releasetest
: unittest
$(DESKTOP_FILES
) $(POFILES
)
78 for f in
$(DESKTOP_FILES
); do desktop-file-validate
$$f || exit
1; done
79 for f in
$(POFILES
); do msgfmt
--check $$f || exit
1; done
81 $(GPODDER_SERVICE_FILE
): $(GPODDER_SERVICE_FILE_IN
)
82 sed
-e
's#__PREFIX__#$(PREFIX)#' $< >$@
84 %.desktop
: %.desktop.in
$(POFILES
)
85 sed
-e
's#__PREFIX__#$(PREFIX)#' $< >$@.tmp
86 intltool-merge
-d
-u po
$@.tmp
$@
89 %.desktop.in.h
: %.desktop.in
90 intltool-extract
--quiet
--type
=gettext
/ini
$<
92 install: messages
$(GPODDER_SERVICE_FILE
) $(DESKTOP_FILES
)
93 $(PYTHON
) setup.py
install --root
=$(DESTDIR
) --prefix=$(PREFIX
) --optimize
=1
95 install-win
: messages
$(GPODDER_SERVICE_FILE
) $(DESKTOP_FILES
)
96 $(PYTHON
) setup.py
install
98 ##########################################################################
101 LC_ALL
=C sed
-i
"s/\(__version__\s*=\s*'\).*'/\1$(VERSION)'/" src
/gpodder
/__init__.py
102 LC_ALL
=C sed
-i
"s/\(__date__\s*=\s*'\).*'/\1$(shell date "+%Y-
%m-
%d
")'/" src
/gpodder
/__init__.py
103 LC_ALL
=C sed
-i
"s/\(__copyright__\s*=.*2005-\)[0-9]*\(.*\)/\1$(shell date "+%Y
")\2/" src
/gpodder
/__init__.py
104 $(MAKE
) messages manpages
107 @echo
"Usage: make revbump VERSION=x.y.z"
109 ##########################################################################
111 manpages
: $(MANPAGES
)
113 share
/man
/man1
/gpodder
.1: src
/gpodder
/__init__.py
$(BINFILE
)
114 LC_ALL
=C
$(HELP2MAN
) --name
="$(shell $(PYTHON) setup.py --description)" -N
$(BINFILE
) >$@
116 share
/man
/man1
/gpo
.1: src
/gpodder
/__init__.py
117 sed
-i
's/^\.TH.*/.TH GPO "1" "$(shell LANG=en date "+%B %Y")" "gpodder $(shell $(PYTHON) setup.py --version)" "User Commands"/' $@
119 ##########################################################################
124 msgmerge
--previous
--silent
$@
$< --output-file
=$@
125 msgattrib
--set-obsolete
--ignore-file
=$< -o
$@
$@
126 msgattrib
--no-obsolete
-o
$@
$@
128 $(LOCALEDIR
)/%/LC_MESSAGES
/gpodder.mo
: po
/%.po
133 intltool-extract
--quiet
--type
=gettext
/glade
$<
135 $(MESSAGES
): $(GETTEXT_SOURCE
)
136 xgettext
--from-code
=utf-8
-LPython
-k_
:1 -kN_
:1 -kN_
:1,2 -kn_
:1,2 -o
$(MESSAGES
) $^
139 xgettext
--from-code
=utf-8
-LPython
-k_
:1 -kN_
:1 -kN_
:1,2 -kn_
:1,2 -o
$(MESSAGES
) $(GETTEXT_SOURCE
)
141 ##########################################################################
143 # This only works in a Git working commit, and assumes that the local Git
144 # HEAD has already been pushed to the main repository. It's mainly useful
145 # for the gPodder maintainer to quickly generate a commit link that can be
146 # posted online in bug trackers and mailing lists.
149 @echo http
://gpodder.org
/commit
/`git show-ref HEAD | head -c8`
151 ##########################################################################
154 $(PYTHON
) setup.py
clean
155 find src
/ '(' -name
'*.pyc' -o
-name
'*.pyo' ')' -exec
rm '{}' +
156 find src
/ -type d
-name
'__pycache__' -exec
rm -r
'{}' +
157 find share
/gpodder
/ui
/ -name
'*.ui.h' -exec
rm '{}' +
158 rm -f MANIFEST .coverage messages.mo po
/*.mo
159 rm -f
$(GPODDER_SERVICE_FILE
)
160 rm -f
$(DESKTOP_FILES
) $(DESKTOP_FILES_IN_H
)
161 rm -rf build
$(LOCALEDIR
)
166 ##########################################################################
168 .PHONY
: help unittest release releasetest
install manpages
clean distclean messages headlink lint revbump
170 ##########################################################################