aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorLibravatarLibravatar William Ahern <william@server.local> 2013-02-28 14:18:09 -0800
committerLibravatarLibravatar William Ahern <william@server.local> 2013-02-28 14:18:09 -0800
commit01ba6abe75aa2afb77b2462adf5e54895955c3b2 (patch)
treee858138522f702adac6acf4e7e5c168a67d1b07f /Makefile
parentcb2880129545b7af565d59bc0a3bae4fc17e2384 (diff)
downloadluaossl-01ba6abe75aa2afb77b2462adf5e54895955c3b2.tar.gz
luaossl-01ba6abe75aa2afb77b2462adf5e54895955c3b2.tar.bz2
luaossl-01ba6abe75aa2afb77b2462adf5e54895955c3b2.zip
-n
use our new helper utility in Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 15 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 368dc12..f1bb26d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,12 @@
-prefix = /usr/local/lua52
+prefix = /usr/local
bindir = $(prefix)/bin
libdir = $(prefix)/lib
datadir = $(prefix)/share
includedir = $(prefix)/include
-luainclude = $(includedir)/lua/5.2
-luapath = $(datadir)/lua/5.2
-luacpath = $(libdir)/lua/5.2
-
-LUAC = $(bindir)/luac
+luainclude =
+luapath =
+luacpath =
+LUAC =
# backwards compatibile install paths
ifneq ($(origin lua52include), undefined)
@@ -23,10 +22,19 @@ luacpath = $(lua52cpath)
endif
+# call helper to derive our Lua paths
+ENV = CC CPPFLAGS prefix bindir libdir datadir includedir \
+ luainclude luapath luacpath LUAC
+$(shell env $(foreach V, $(ENV), $(V)="$(call $(V))") ../mk/lua.path make > .config)
+include .config
+
+
VENDOR.OS = $(shell ../mk/vendor.os)
VENDOR.CC = $(shell env CC="${CC}" ../mk/vendor.cc)
+ifneq ($(luainclude),)
CPPFLAGS = -I$(luainclude)
+endif
ifeq ($(VENDOR.CC), sunpro)
DFLAGS = -g
@@ -121,6 +129,7 @@ $(DESTDIR)$(luapath)/openssl/hmac.lua: openssl.hmac.lua
clean:
rm -f *.so *.o
+ rm -f .config
clean~: clean
rm -f *~