summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPeter Hofmann <scm@uninformativ.de>2015-11-28 19:50:02 +0100
committerPeter Hofmann <scm@uninformativ.de>2015-11-28 20:03:25 +0100
commit7df7a3654f16ee04cc1756b8f8c4fc2d572287db (patch)
tree3a737d1ffe94be06777360a64094a3227223aff5 /Makefile
parent682cd872d8298d28562730b17c2a2977e4d35a22 (diff)
downloadlariza-7df7a3654f16ee04cc1756b8f8c4fc2d572287db.tar.gz
Extend Makefile to allow installation
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 23 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 6d1c811..4f8db20 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,20 @@ __NAME__ = lariza
__NAME_UPPERCASE__ = `echo $(__NAME__) | sed 's/.*/\U&/'`
__NAME_CAPITALIZED__ = `echo $(__NAME__) | sed 's/^./\U&\E/'`
-.PHONY: all
+INSTALL = install
+INSTALL_PROGRAM = $(INSTALL)
+INSTALL_DATA = $(INSTALL) -m 644
+
+prefix = /usr/local
+exec_prefix = $(prefix)
+bindir = $(exec_prefix)/bin
+datarootdir = $(prefix)/share
+mandir = $(datarootdir)/man
+man1dir = $(mandir)/man1
+
+
+.PHONY: all clean install installdirs
+
all: $(__NAME__) we_adblock.so
$(__NAME__): browser.c
@@ -22,5 +35,14 @@ we_adblock.so: we_adblock.c
-shared -o $@ -fPIC $< \
`pkg-config --cflags --libs glib-2.0 webkit2gtk-4.0`
+install: all installdirs
+ $(INSTALL_PROGRAM) $(__NAME__) $(DESTDIR)$(bindir)/$(__NAME__)
+ $(INSTALL_DATA) man1/$(__NAME__).1 $(DESTDIR)$(man1dir)/$(__NAME__).1
+ $(INSTALL_DATA) man1/$(__NAME__).usage.1 \
+ $(DESTDIR)$(man1dir)/$(__NAME__).usage.1
+
+installdirs:
+ mkdir -p $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir)
+
clean:
rm -f $(__NAME__) we_adblock.so