forked from FiloSottile/Griffith
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
executable file
·129 lines (114 loc) · 4.2 KB
/
Makefile
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
# Griffith makefile
#
# (c) 2005-2009 Vasco Nunes, Piotr Ozarowski
#
# $Id$
PACKAGE=griffith
LANGUAGES=$(shell find i18n/ -maxdepth 1 -mindepth 1 -type d -not -name \.svn -printf "%f ")
VERSION=$(shell grep "^pversion" lib/version.py | cut -d \' -f 2)
TEMPLATES= $(shell cd export_templates >/dev/null; $(FIND) . -maxdepth 1 -mindepth 1 -type d -name "[^\.svn]*" -print)
.PHONY: help clean install
INSTALL ?= install
MAKE ?= make
RM ?= rm
MSGFMT ?= msgfmt
MSGMERGE ?= msgmerge
XGETTEXT ?= xgettext
FIND ?= find
DOC2MAN ?= docbook2x-man
PREFIX ?= $(DESTDIR)/usr
BINDIR = $(PREFIX)/bin
ETCDIR = $(DESTDIR)/etc
DATADIR = $(PREFIX)/share/griffith
LIBDIR = $(DATADIR)/lib
IMAGESDIR = $(DATADIR)/images
GLADEDIR = $(DATADIR)/glade
PLUGINSDIR = $(LIBDIR)/plugins
MOVIEPLUGINSDIR = $(PLUGINSDIR)/movie
EXPORTPLUGINSDIR = $(PLUGINSDIR)/export
IMPORTPLUGINSDIR = $(PLUGINSDIR)/imp
EXTENSIONSPLUGINSDIR = $(PLUGINSDIR)/extensions
TPLDIR = $(DATADIR)/export_templates
APPLICATIONSDIR = $(PREFIX)/share/applications
ICONDIR = $(PREFIX)/share/pixmaps
LOCALEDIR = $(PREFIX)/share/locale
BASHCOMPDIR = $(ETCDIR)/bash_completion.d
help:
@echo Usage:
@echo "make - not used"
@echo "make clean - delete built modules and object files"
@echo "make install - install binaries into the official directories"
@echo "make uninstall - uninstall binaries from the official directories"
@echo "make help - prints this help"
@echo "make dist - makes a distribution tarball"
@echo
install:
@echo
@echo "installing Griffith"
@echo "^^^^^^^^^^^^^^^^^^^"
$(INSTALL) -m 755 -d $(BINDIR) $(DATADIR) $(LIBDIR) $(LIBDIR)/db \
$(PLUGINSDIR) $(MOVIEPLUGINSDIR) $(EXPORTPLUGINSDIR) $(IMPORTPLUGINSDIR) $(EXTENSIONSPLUGINSDIR) \
$(FONTSDIR) $(APPLICATIONSDIR) $(ICONDIR) $(TPLDIR) \
$(IMAGESDIR) $(GLADEDIR) $(ETCDIR) $(BASHCOMPDIR)
$(INSTALL) -m 755 griffith $(LIBDIR)
$(INSTALL) -m 644 lib/*.py $(LIBDIR)
$(INSTALL) -m 644 lib/db/*.py $(LIBDIR)/db/
$(INSTALL) -m 644 lib/plugins/*.py $(PLUGINSDIR)
$(INSTALL) -m 644 lib/plugins/movie/*.py $(MOVIEPLUGINSDIR)
$(INSTALL) -m 644 lib/plugins/export/*.py $(EXPORTPLUGINSDIR)
$(INSTALL) -m 644 lib/plugins/imp/*.py $(IMPORTPLUGINSDIR)
$(INSTALL) -m 644 lib/plugins/extensions/*.py $(EXTENSIONSPLUGINSDIR)
$(INSTALL) -m 644 glade/*.glade $(GLADEDIR)
$(INSTALL) -m 644 glade/*.png $(GLADEDIR)
$(INSTALL) -m 644 images/*.png $(IMAGESDIR)
$(INSTALL) -m 644 images/griffith.png $(ICONDIR)
$(INSTALL) -m 644 images/griffith.xpm $(ICONDIR)
$(INSTALL) -m 644 data/griffith.desktop $(APPLICATIONSDIR)
$(INSTALL) -m 644 data/bash_completion $(BASHCOMPDIR)/griffith
# installing language files
for lang in $(LANGUAGES); do \
${INSTALL} -m 755 -d $(LOCALEDIR)/$$lang/LC_MESSAGES; \
$(INSTALL) -m 644 i18n/$$lang/LC_MESSAGES/*.mo $(LOCALEDIR)/$$lang/LC_MESSAGES; \
done
# installing export templates:
for dir in $(TEMPLATES); do \
${INSTALL} -m 755 -d ${TPLDIR}/$$dir; \
${FIND} export_templates/$$dir -maxdepth 1 -type f \
-exec ${INSTALL} -m 644 '{}' ${TPLDIR}/$$dir \;; \
done
if test -f $(PREFIX)/bin/griffith; then ${RM} $(PREFIX)/bin/griffith; fi
ln -s $(LIBDIR)/griffith $(BINDIR)/griffith
chmod +x $(BINDIR)/griffith
$(MAKE) -C docs install
uninstall:
@echo
@echo "uninstalling Griffith"
@echo "^^^^^^^^^^^^^^^^^^^^^"
${RM} -r $(TPLDIR)
${RM} -r $(MOVIEPLUGINSDIR)
${RM} -r $(EXPORTPLUGINSDIR)
${RM} -r $(IMPORTPLUGINSDIR)
${RM} -r $(EXTENSIONSPLUGINSDIR)
${RM} -r $(PLUGINSDIR)
${RM} -r $(LIBDIR)
${RM} -r $(IMAGESDIR)
${RM} -r $(GLADEDIR)
${RM} -r $(DATADIR)
${RM} -r $(ICONDIR)/griffith.png
${RM} -r $(ICONDIR)/griffith.xpm
${RM} -r $(APPLICATIONSDIR)/griffith.desktop
for lang in $(LANGUAGES); do \
${RM} -r $(LOCALEDIR)/$$lang/LC_MESSAGES/griffith.mo; \
done
${RM} -r $(BINDIR)/griffith
${RM} -r $(BASHCOMPDIR)/griffith
$(MAKE) -C docs uninstall
clean:
${FIND} . \( -iname '*\.py[co]' -or -iname '*~' -or -iname '*\.bak' \) -exec ${RM} '{}' \;
dist: clean
@tar --exclude=*.svn* --exclude=*.tar* --exclude=debian -cf griffith.tar ./
@mkdir $(PACKAGE)-$(VERSION)
@tar -xf griffith.tar -C $(PACKAGE)-$(VERSION)
@${RM} griffith.tar
@tar -czf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION) && echo File ./$(PACKAGE)-$(VERSION).tar.gz generated successfully
@${RM} -r $(PACKAGE)-$(VERSION)