-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
97 lines (86 loc) · 3.19 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
DESTDIR=
GRILO_VERSION=
VERSION=1.0.0
NAME=grilo-plugin-arte
PACKAGE=$(NAME)-$(VERSION)
VALAC=valac
# Detect and use the higher Grilo version available, if not set on the CLI
ifeq ($(GRILO_VERSION),)
ifeq ($(shell pkg-config --exists grilo-0.3; echo $$?),0)
GRILO_VERSION=3
else
GRILO_VERSION=2
endif
endif
# vala bindings are missing in Debian Jessie, ok in Stretch and Ubuntu >= 16.04
#VALA_DEPS=--pkg libsoup-2.4 --pkg gio-2.0 --pkg json-glib-1.0 --pkg gmodule-2.0 --pkg grilo-0.$(GRILO_VERSION)
VALA_DEPS=--pkg libsoup-2.4 --pkg gio-2.0 --pkg json-glib-1.0 --pkg gmodule-2.0
CC_ARGS=-X -fPIC -X -shared --Xcc="-D GETTEXT_PACKAGE=\"grilo-arte\"" -X -std=c99 -X -Wno-discarded-qualifiers
VALA_ARGS_EXTRA=
ifeq ($(GRILO_VERSION),2)
CC_ARGS+= --Xcc=-I/usr/include/grilo-0.2 grilo-0.2.vapi
else
# Grilo Version 0.3
VALA_DEPS+= --pkg grilo-0.3
CC_ARGS+= -X -DGRILO_VERSION_3
VALA_ARGS_EXTRA= -D GRILO_VERSION_3
endif
VALA_ARGS=-D DEBUG_MESSAGES $(CC_ARGS) -g $(VALA_ARGS_EXTRA)
VALA_SOURCE=\
arteparser.vala \
url-extractor.vala \
video.vala \
common.vala \
grl-arteplus7.vala \
grl-arteplus7-plugin.c
EXTRA_DIST=\
grilo-0.2.vapi \
grl-arteplus7.xml \
arteplus7.png \
org.gnome.totem.plugins.arteplus7.gschema.xml \
Makefile README AUTHORS COPYING NEWS ChangeLog
# This directory can be arch-specific. Let's autodetect it.
GRILO_PLUGIN_DIR=$(DESTDIR)/$(shell pkg-config --variable=plugindir grilo-0.$(GRILO_VERSION))
all:
$(VALAC) --library=arteplus7 $(VALA_SOURCE) $(VALA_DEPS) $(VALA_ARGS) -o libgrlarteplus7.so
msgfmt --output-file=po/de.mo po/de.po
msgfmt --output-file=po/fr.mo po/fr.po
install:
mkdir -p $(GRILO_PLUGIN_DIR) $(DESTDIR)/usr/share/grilo-plugins/grl-arteplus7
ifeq ($(GRILO_VERSION),2)
cp -f grl-arteplus7.xml $(GRILO_PLUGIN_DIR)
endif
cp -f libgrlarteplus7.so $(GRILO_PLUGIN_DIR)
cp -f arteplus7.png $(DESTDIR)/usr/share/grilo-plugins/grl-arteplus7/
mkdir -p $(DESTDIR)/usr/share/glib-2.0/schemas
cp -f org.gnome.totem.plugins.arteplus7.gschema.xml $(DESTDIR)/usr/share/glib-2.0/schemas
ifeq ($(DISABLE_SCHEMAS_COMPILE),)
glib-compile-schemas $(DESTDIR)/usr/share/glib-2.0/schemas/
endif
mkdir -p $(DESTDIR)/usr/share/locale/de/LC_MESSAGES
mkdir -p $(DESTDIR)/usr/share/locale/fr/LC_MESSAGES
cp -f po/de.mo $(DESTDIR)/usr/share/locale/de/LC_MESSAGES/grilo-arte.mo
cp -f po/fr.mo $(DESTDIR)/usr/share/locale/fr/LC_MESSAGES/grilo-arte.mo
uninstall:
rm -f $(GRILO_PLUGIN_DIR)/grl-arteplus7.xml $(GRILO_PLUGIN_DIR)/libgrlarteplus7.so
rm $(DESTDIR)/usr/share/glib-2.0/schemas/org.gnome.totem.plugins.arteplus7.gschema.xml
rm -r $(DESTDIR)/usr/share/grilo-plugins/grl-arteplus7/
ifeq ($(DISABLE_SCHEMAS_COMPILE),)
glib-compile-schemas $(DESTDIR)/usr/share/glib-2.0/schemas/
endif
rm $(DESTDIR)/usr/share/locale/de/LC_MESSAGES/grilo-arte.mo
rm $(DESTDIR)/usr/share/locale/fr/LC_MESSAGES/grilo-arte.mo
clean:
rm -f libgrlarteplus7.so
rm -f arteplus7.vapi
rm -f po/*mo
dist:
rm -f ChangeLog
git log --pretty=short > ChangeLog
mkdir $(PACKAGE)
mkdir $(PACKAGE)/po
cp -f $(VALA_SOURCE) $(PACKAGE)/
cp -f $(EXTRA_DIST) $(PACKAGE)/
cp -f po/POTFILES.in po/grilo-arte.pot po/de.po po/fr.po $(PACKAGE)/po/
tar -pcJf $(PACKAGE).tar.xz $(PACKAGE)/
rm -rf $(PACKAGE)