aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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