aboutsummaryrefslogtreecommitdiff
blob: 22f6d45c1f5880814d3f587050ad8946c15b87df (plain)
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
--- Makefile.old	2013-11-10 19:03:16.378355232 +0100
+++ Makefile	2013-11-10 19:25:54.165380558 +0100
@@ -1,20 +1,21 @@
 GTK_PIDGIN_INCLUDES= `pkg-config --cflags gtk+-2.0 pidgin`
 
+PLUGINNAME = xmpp-receipts.so
 CFLAGS= -O2 -Wall -fpic -g
 LDFLAGS= -shared
+PLUGIN_DIR_PIDGIN:=$(shell pkg-config --variable=plugindir pidgin)
 
 INCLUDES = \
       $(GTK_PIDGIN_INCLUDES)
 
-xmpp-receipts.so: xmpp-receipts.c
+$(PLUGINNAME): xmpp-receipts.c
 	gcc xmpp-receipts.c $(CFLAGS) $(INCLUDES) $(LDFLAGS) -o xmpp-receipts.so
 
-install: xmpp-receipts.so
-	mkdir -p ~/.purple/plugins
-	cp xmpp-receipts.so ~/.purple/plugins/
+install: $(PLUGINNAME)
+	install -D $(PLUGINNAME) $(DESTDIR)$(PLUGIN_DIR_PIDGIN)/$(PLUGINNAME)
 
 uninstall:
-	rm -f ~/.purple/plugins/xmpp-receipts.so
+	rm -f $(DESTDIR)$(PLUGIN_DIR_PIDGIN)/$(PLUGINNAME)
 
 clean:
-	rm -f xmpp-receipts.so
+	rm -f $(PLUGINNAME)