diff options
author | Marco Palladino <marco@mashape.com> | 2015-11-19 13:38:12 -0800 |
---|---|---|
committer | Marco Palladino <marco@mashape.com> | 2015-11-19 13:38:12 -0800 |
commit | 0f5008269fc8c0b1996351ec71d7be991b160157 (patch) | |
tree | 4f085b107457fa44008fb9d5086747429abd4d05 | |
parent | 54af6a4aecdca9f0b8df5d2425da82b1e31b03d5 (diff) | |
parent | 4467053af8965775921d7212bcee6a095ea5740e (diff) | |
download | lua_uuid-0f5008269fc8c0b1996351ec71d7be991b160157.tar.gz lua_uuid-0f5008269fc8c0b1996351ec71d7be991b160157.tar.bz2 lua_uuid-0f5008269fc8c0b1996351ec71d7be991b160157.zip |
Merge pull request #2 from Mashape/chore/make
Chore/make
-rw-r--r-- | Makefile | 21 | ||||
-rw-r--r-- | lua_uuid-0.1-7.rockspec | 9 | ||||
-rwxr-xr-x[-rw-r--r--] | test/lua_uuid_test.lua | 0 |
3 files changed, 22 insertions, 8 deletions
@@ -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) -o $@ $< $(UUID_LIBDIR) + $(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..e623d72 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,12 +18,13 @@ dependencies = { build = { type = "make", build_variables = { + 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)" } -}
\ No newline at end of file +} diff --git a/test/lua_uuid_test.lua b/test/lua_uuid_test.lua index 19ebf67..19ebf67 100644..100755 --- a/test/lua_uuid_test.lua +++ b/test/lua_uuid_test.lua |