File: Makefile

package info (click to toggle)
gpodder 2.20.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 5,228 kB
  • sloc: python: 16,951; makefile: 183; ansic: 140; sh: 97
file content (164 lines) | stat: -rw-r--r-- 5,404 bytes parent folder | download
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#
# gPodder - A media aggregator and podcast client
# Copyright (c) 2005-2012 Thomas Perl and the gPodder Team
#
# gPodder is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# gPodder is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#

##########################################################################

BINFILE=bin/gpodder
MESSAGESPOT=data/messages.pot

UIFILES=$(wildcard data/ui/*.ui \
	           data/ui/desktop/*.ui \
		   data/ui/maemo/*.ui \
		   data/ui/frmntl/*.ui)
UIFILES_H=$(subst .ui,.ui.h,$(UIFILES))
TRANSLATABLE_SOURCE=$(wildcard src/gpodder/*.py \
		               src/gpodder/gtkui/*.py \
		               src/gpodder/gtkui/interface/*.py \
			       src/gpodder/gtkui/desktop/*.py \
			       src/gpodder/gtkui/maemo/*.py \
			       src/gpodder/gtkui/frmntl/*.py)

HELP2MAN=help2man
MANPAGE=doc/man/gpodder.1

GPODDER_ICON_THEME=dist/gpodder

GPODDER_SERVICE_FILE=data/org.gpodder.service
GPODDER_SERVICE_FILE_IN=$(addsuffix .in,$(GPODDER_SERVICE_FILE))

DESTDIR ?= /
PREFIX ?= /usr

PYTHON ?= python

##########################################################################

all: help

help:
	@echo 'make test            run gpodder in local directory'
	@echo 'make unittest        run doctests + unittests'
	@echo 'make release         create source tarball in "dist/"'
	@echo 'make releasetest     run some tests before the release'
	@echo 'make install         install gpodder into "$(PREFIX)"'
	@echo 'make manpage         update manpage (on release)'
	@echo 'make messages        update messages.pot + .po files + .mo files'
	@echo 'make clean           remove generated+temp+*.py{c,o} files'
	@echo 'make distclean       do a "make clean" + remove "dist/"'
	@echo 'make headlink        print URL for the current Git head'
	@echo ''
	@echo 'make install-git-menuitem   Add shortcuts to your menu for this git checkout'
	@echo 'make remove-git-menuitem    Remove shortcuts created by "install-git-menuitem"'

##########################################################################

test:
	@# set xterm title to know what this window does ;)
	@echo -ne '\033]0;gPodder console (make test)\007'
	$(BINFILE) --verbose

unittest:
	PYTHONPATH=src/ $(PYTHON) -m gpodder.unittests

deb:
	debuild

release: distclean
	$(PYTHON) setup.py sdist

releasetest: unittest
	desktop-file-validate data/gpodder.desktop
	make -C data/po validate

$(GPODDER_SERVICE_FILE): $(GPODDER_SERVICE_FILE_IN)
	sed -e 's#__PREFIX__#$(PREFIX)#' $< >$@

install: messages $(GPODDER_SERVICE_FILE)
	$(PYTHON) setup.py install --root=$(DESTDIR) --prefix=$(PREFIX)

##########################################################################

manpage: $(MANPAGE)

$(MANPAGE): src/gpodder/__init__.py $(BINFILE)
	$(HELP2MAN) --name="A Media aggregator and Podcast catcher" -N $(BINFILE) >$(MANPAGE)

##########################################################################

messages: $(MESSAGESPOT)
	make -C data/po

data/ui/%.ui.h: $(UIFILES)
	intltool-extract --quiet --type=gettext/glade $(subst .ui.h,.ui,$@)

$(MESSAGESPOT): $(TRANSLATABLE_SOURCE) $(UIFILES_H) $(BINFILE)
	xgettext -k_:1 -kN_:1 -kN_:1,2 -o $(MESSAGESPOT) $(TRANSLATABLE_SOURCE) $(UIFILES_H) $(BINFILE)

##########################################################################

install-git-menuitem:
	doc/dev/install-desktopentry.sh

remove-git-menuitem:
	doc/dev/install-desktopentry.sh --remove

gpodder-icon-theme:
	rm -rf $(GPODDER_ICON_THEME)
	mkdir -p $(GPODDER_ICON_THEME)
	$(PYTHON) doc/dev/icon-theme/list-icon-names.py >$(GPODDER_ICON_THEME)/names
	(cd $(GPODDER_ICON_THEME) && \
	    $(PYTHON) ../../doc/dev/icon-theme/pack-icons.py && \
	    $(PYTHON) ../../doc/dev/icon-theme/create-index.py >index.theme && \
	    rm -f names)

##########################################################################

# This only works in a Git working commit, and assumes that the local Git
# HEAD has already been pushed to the main repository. It's mainly useful
# for the gPodder maintainer to quickly generate a commit link that can be
# posted online in bug trackers and mailing lists.

headlink:
	@echo http://gpodder.org/commit/`git show-ref HEAD | head -c8`

##########################################################################

clean:
	$(PYTHON) setup.py clean
	find src/ -name '*.pyc' -exec rm '{}' \;
	find src/ -name '*.pyo' -exec rm '{}' \;
	find data/ui/ -name '*.ui.h' -exec rm '{}' \;
	rm -f MANIFEST PKG-INFO data/messages.pot~
	rm -f data/gpodder-??x??.png .coverage $(GPODDER_SERVICE_FILE)
	rm -rf build
	make -C data/po clean

debclean:
	fakeroot debian/rules clean

distclean: clean
	rm -rf dist

##########################################################################

.PHONY: all test unittest release releasetest install manpage clean distclean messages help install-git-menuitem remove-git-menuitem headlink

##########################################################################