aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <natanael.copa@gmail.com>2010-09-10 10:38:19 +0200
committerNatanael Copa <natanael.copa@gmail.com>2010-09-10 10:38:19 +0200
commitf18a88bb8a5c1835339084c87f541123a17056f3 (patch)
tree160e8e4f6ec712b980e3de65eccd0c2421754b9e
parent855ccd6c97cc29efd494abe56608f44a7974d3fe (diff)
downloadsircbot-f18a88bb8a5c1835339084c87f541123a17056f3.tar.bz2
sircbot-f18a88bb8a5c1835339084c87f541123a17056f3.tar.xz
make: install target
-rw-r--r--Makefile16
1 files changed, 16 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index e0956f8..d95ce5a 100644
--- a/Makefile
+++ b/Makefile
@@ -11,6 +11,13 @@ TARGETS += sircbot.so
LUA_LIBS=-llua
endif
+prefix ?= /usr/local
+bindir ?= $(prefix)/bin
+DESTDIR ?=
+LUA_LIBDIR ?= $(prefix)/lib/lua/5.1
+LUA_LUADIR ?= $(prefix)/share/lua/5.1
+INSTALL ?= install
+
all: $(TARGETS)
sircbot: sircbot.o irc.o
@@ -27,3 +34,12 @@ sircbot.so: lsircbot.o
clean:
rm -f *.o $(TARGETS)
+
+install: $(TARGETS)
+ $(INSTALL) -d $(DESTDIR)$(bindir)
+ $(INSTALL) sircbot $(DESTDIR)$(bindir)
+ $(INSTALL) sircbot-send $(DESTDIR)$(bindir)
+ifneq (NOLUA,)
+ $(INSTALL) -d $(DESTDIR)$(LUA_LIBDIR)
+ $(INSTALL) sircbot.so $(DESTDIR)$(LUA_LIBDIR)
+endif