From e803e0c1dcb7dbb0c6cb85e3ae26925c2b687543 Mon Sep 17 00:00:00 2001 From: Thibault Charbonnier Date: Fri, 13 Nov 2015 18:50:48 -0800 Subject: chore(makefile) fixes --- Makefile | 21 +++++++++++++++++---- lua_uuid-0.1-7.rockspec | 5 +++-- test/lua_uuid_test.lua | 0 3 files changed, 20 insertions(+), 6 deletions(-) mode change 100644 => 100755 test/lua_uuid_test.lua diff --git a/Makefile b/Makefile index fb6e6ca..0e37c26 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,26 @@ +LUA ?= lua5.1 +LUA_LIBDIR ?= $(shell pkg-config $(LUA) --libs) +LUA_INCDIR ?= $(shell pkg-config $(LUA) --cflags) + +UUID_LIBDIR ?= $(shell pkg-config uuid --libs) +UUID_INCDIR ?= $(shell pkg-config uuid --cflags) + +LIBFLAG ?= -shared +CFLAGS ?= -O2 -Wall -Werror + +.PHONY: all clean install + all: lua_uuid.so lua_uuid.so: lua_uuid.o - $(CC) $(LIBFLAG) -luuid -o $@ -L$(LUA_LIBDIR) $< + $(CC) $(LIBFLAG) $(LUA_LIBDIR) $(UUID_LIBDIR) $< -o $@ + $(LUA) test/lua_uuid_test.lua -lua_uuid.o: lua_uuid.c - $(CC) -c $(CFLAGS) -I$(LUA_INCDIR) $< -o $@ +%.o: %.c + $(CC) -c $(CFLAGS) -fPIC $(LUA_INCDIR) $(UUID_INCDIR) $< -o $@ install: lua_uuid.so cp lua_uuid.so $(INST_LIBDIR) clean: - rm -f lua_uuid.so lua_uuid.o *.rock + rm -f *.so *.o *.rock diff --git a/lua_uuid-0.1-7.rockspec b/lua_uuid-0.1-7.rockspec index e0c12b5..8cc65ab 100644 --- a/lua_uuid-0.1-7.rockspec +++ b/lua_uuid-0.1-7.rockspec @@ -10,7 +10,7 @@ description = { This is an utility that leverages libuuid to generate UUID strings ]], homepage = "https://github.com/Mashape/lua-uuid", - license = "MIT" + license = "MIT" } dependencies = { "lua >= 5.1" @@ -18,6 +18,7 @@ dependencies = { build = { type = "make", build_variables = { + LUA="$(LUA)", CFLAGS="$(CFLAGS)", LIBFLAG="$(LIBFLAG)", LUA_LIBDIR="$(LUA_LIBDIR)", @@ -26,4 +27,4 @@ build = { install_variables = { INST_LIBDIR = "$(LIBDIR)" } -} \ No newline at end of file +} diff --git a/test/lua_uuid_test.lua b/test/lua_uuid_test.lua old mode 100644 new mode 100755 -- cgit v1.2.3-54-g00ecf From add6ec8ee5f6ce8104a79f90dc58f8e450ab11b8 Mon Sep 17 00:00:00 2001 From: Marco Palladino Date: Thu, 19 Nov 2015 13:31:19 -0800 Subject: Update Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0e37c26..1250f46 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ CFLAGS ?= -O2 -Wall -Werror all: lua_uuid.so lua_uuid.so: lua_uuid.o - $(CC) $(LIBFLAG) $(LUA_LIBDIR) $(UUID_LIBDIR) $< -o $@ + $(CC) $(LIBFLAG) $(LUA_LIBDIR) -o $@ $< $(UUID_LIBDIR) $(LUA) test/lua_uuid_test.lua %.o: %.c -- cgit v1.2.3-54-g00ecf From 4467053af8965775921d7212bcee6a095ea5740e Mon Sep 17 00:00:00 2001 From: Marco Palladino Date: Thu, 19 Nov 2015 13:36:18 -0800 Subject: Update lua_uuid-0.1-7.rockspec --- lua_uuid-0.1-7.rockspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua_uuid-0.1-7.rockspec b/lua_uuid-0.1-7.rockspec index 8cc65ab..e623d72 100644 --- a/lua_uuid-0.1-7.rockspec +++ b/lua_uuid-0.1-7.rockspec @@ -21,8 +21,8 @@ build = { LUA="$(LUA)", CFLAGS="$(CFLAGS)", LIBFLAG="$(LIBFLAG)", - LUA_LIBDIR="$(LUA_LIBDIR)", - LUA_INCDIR="$(LUA_INCDIR)" + LUA_LIBDIR="-L$(LUA_LIBDIR)", + LUA_INCDIR="-I$(LUA_INCDIR)" }, install_variables = { INST_LIBDIR = "$(LIBDIR)" -- cgit v1.2.3-54-g00ecf