summarylogtreecommitdiffstats
path: root/Makefile.patch
blob: ee4d15d8e7f03b9ebd77ace04a4ec17b6049e665 (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
31
--- Makefile.dist	2016-07-18 15:28:52.000000000 +0200
+++ Makefile	2017-05-27 13:56:10.325084225 +0200
@@ -5,8 +5,9 @@
 
 # try some automatic discovery
 OS = $(shell uname -s)
-LUAVERSION = $(shell lua -e "print(string.match(_VERSION, '%d+%.%d+'))")
-LUA_BINDIR = $(shell dirname `which lua`)
+LUA = lua5.1
+LUAVERSION = $(shell $(LUA) -e "print(string.match(_VERSION, '%d+%.%d+'))")
+LUA_BINDIR = $(shell dirname `which $(LUA)`)
 LUAROOT = $(shell dirname $(LUA_BINDIR))
 
 # Defaults
@@ -17,7 +18,6 @@
 CFLAGS = -fPIC -Wall $(DEBUG)
 LUA_INCDIR = $(LUAROOT)/include
 LUA_LIBDIR = $(LUAROOT)/lib
-LUA = lua
 
 # OS specialities
 ifeq ($(OS),Darwin)
@@ -47,7 +47,7 @@
 	cp $(TARGET) $(INST_LIBDIR)
 
 test: all
-	cd samples && LUA_CPATH=../\?.so lua lptytest.lua
+	cd samples && LUA_CPATH=../\?.so $(LUA) lptytest.lua
 
 clean:
 	find . -name "*~" -exec rm {} \;