From 01ba6abe75aa2afb77b2462adf5e54895955c3b2 Mon Sep 17 00:00:00 2001 From: William Ahern Date: Thu, 28 Feb 2013 14:18:09 -0800 Subject: -n use our new helper utility in Makefile --- Makefile | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'Makefile') 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 *~ -- cgit v1.2.3-59-g8ed1b