From 0373f863a9dbabbbe3e9aa74bea3e4b778f3a0cd Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Tue, 10 Jul 2012 21:43:32 +0200 Subject: one more step toward 5.2 compatibility * lua51-lanes renamed lanes.core * keeper state microcode is no longer embedded inside lanes.core, but located and loaded with package.loaders[2] * changed rockspec build type from "make" to "builtin" --- src/Makefile | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 03f5558..a16acce 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,8 +1,8 @@ # # Lanes/src/Makefile # -# make [LUA=... LUAC=...] Manual build -# make LUAROCKS=1 CFLAGS=... LIBFLAG=... LUA=... LUAC=... LuaRocks automated build +# make [LUA=...] Manual build +# make LUAROCKS=1 CFLAGS=... LIBFLAG=... LUA=... LuaRocks automated build # MODULE=lanes @@ -19,11 +19,10 @@ OPT_FLAGS=-O2 # -O0 -g LUA=lua -LUAC=luac -_SO=.so +_SO=so ifeq "$(findstring MINGW32,$(shell uname -s))" "MINGW32" - _SO=.dll + _SO=dll endif ifeq "$(LUAROCKS)" "" @@ -116,32 +115,21 @@ ifeq "$(shell uname -s)" "BSD" LIBS += -lpthread endif +MODULE_DIR=$(MODULE) + #--- -all: lua51-$(MODULE)$(_SO) +all: $(MODULE)/core.$(_SO) %.o: %.c *.h Makefile # Note: Don't put $(LUA_LIBS) ahead of $^; MSYS will not like that (I think) # -lua51-$(MODULE)$(_SO): $(OBJ) +$(MODULE_DIR)/core.$(_SO): $(OBJ) + mkdir -p $(MODULE_DIR) $(CC) $(LIBFLAG) $^ $(LIBS) $(LUA_LIBS) -o $@ clean: - -rm -rf lua51-$(MODULE)$(_SO) *.lch *.o *.tmp *.map - -lanes.o: keeper.lch - -# Note: 'luac -o -' could be used on systems other than Windows (where pipes -# are binary). We need to support MinGW as well, so a temporary file. -# -# mode 1: embed bytecode version -#%.lch: %.lua -# $(LUAC) -o $@.tmp $< -# $(LUA) ../tools/bin2c.lua $@.tmp -o $@ -# -rm $@.tmp -# mode 2: embed text version (LuaJIT2-compatible) -%.lch: %.lua - $(LUA) ../tools/bin2c.lua $< -o $@ + -rm -rf $(MODULE)/core.$(_SO) *.o *.map #--- # NSLU2 "slug" Linux ARM @@ -166,10 +154,9 @@ win32: $(WIN32_LUA51)/include/lua.h $(MAKE) build CC=$(MINGW_GCC) \ LUA_FLAGS=-I$(WIN32_LUA51)/include \ LUA_LIBS="-L$(WIN32_LUA51) -llua51" \ - _SO=.dll \ + _SO=dll \ SO_FLAGS=-shared \ - LUA=lua51 \ - LUAC=luac51 + LUA=lua51 $(WIN32_LUA51)/include/lua.h: @echo "Usage: make win32 WIN32_LUA51=" -- cgit v1.2.3-55-g6feb