aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-12-15 16:39:08 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2011-12-15 16:39:08 +0100
commit07fe398d8f6a9b74c0263d659859bf59d66d64d2 (patch)
tree427425bad7ec02f40ebaf0e17986ce602d35c63c /Makefile
parentaefa1f028fab71136d42fbc662eb8e20c4f60530 (diff)
downloadsircbot-07fe398d8f6a9b74c0263d659859bf59d66d64d2.tar.bz2
sircbot-07fe398d8f6a9b74c0263d659859bf59d66d64d2.tar.xz
make: make it convenient to build on mint/ubuntu
To build on ubuntu: echo "LUAPC=lua5.1" > config.mk make
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index d5dfcd7..f09f5dc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,5 @@
+-include config.mk
+
VERSION=0.2
GIT_VERSION := $(shell [ -d .git ] && echo "-$$(git describe --always)")
@@ -7,8 +9,12 @@ CFLAGS += -DVERSION=\"$(VERSION)$(GIT_VERSION)\"
TARGETS = sircbot sircbot-send
ifneq (NOLUA,)
+LUAPC ?= lua
+PKGCONFIG ?= pkg-config
TARGETS += sircbot.so
-LUA_LIBS=-llua
+LUA_CFLAGS = $(shell $(PKGCONFIG) --cflags $(LUAPC))
+LUA_LIBS = $(shell $(PKGCONFIG) --libs $(LUAPC))
+CFLAGS += $(LUA_CFLAGS)
endif
prefix ?= /usr/local