diff options
| author | Benoit Germain <bnt.germain@gmail.com> | 2012-07-10 21:43:32 +0200 |
|---|---|---|
| committer | Benoit Germain <bnt.germain@gmail.com> | 2012-07-10 21:43:32 +0200 |
| commit | 0373f863a9dbabbbe3e9aa74bea3e4b778f3a0cd (patch) | |
| tree | 52dfb987d5ee12ef4668e875d19a70a6c77cebe1 /Makefile | |
| parent | 4468ec94e354a9f6d8d7ea2859afa757bb934617 (diff) | |
| download | lanes-3.1.5.tar.gz lanes-3.1.5.tar.bz2 lanes-3.1.5.zip | |
one more step toward 5.2 compatibilityv3.1.5
* 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"
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 36 |
1 files changed, 19 insertions, 17 deletions
| @@ -17,39 +17,40 @@ MODULE = lanes | |||
| 17 | 17 | ||
| 18 | N=1000 | 18 | N=1000 |
| 19 | 19 | ||
| 20 | _SO=.so | 20 | _TARGET_DIR=src/lanes |
| 21 | _TARGET_SO=src/lua51-lanes.so | ||
| 22 | TIME=time | 21 | TIME=time |
| 23 | 22 | ||
| 24 | ifeq "$(findstring MINGW32,$(shell uname -s))" "MINGW32" | 23 | ifeq "$(findstring MINGW32,$(shell uname -s))" "MINGW32" |
| 25 | # MinGW MSYS on XP | 24 | # MinGW MSYS on XP |
| 26 | # | 25 | # |
| 27 | LUA=lua.exe | 26 | _SO=dll |
| 28 | LUAC=luac.exe | 27 | _LUAEXT=.exe |
| 29 | _SO=.dll | ||
| 30 | _TARGET_SO=./lua51-lanes.dll | ||
| 31 | TIME=timeit.exe | 28 | TIME=timeit.exe |
| 32 | else | 29 | else |
| 33 | # Autodetect LUA & LUAC | 30 | _SO=so |
| 34 | # | 31 | _LUAEXT= |
| 35 | LUA=$(word 1,$(shell which lua5.1) $(shell which lua51) lua) | ||
| 36 | LUAC=$(word 1,$(shell which luac5.1) $(shell which luac51) luac) | ||
| 37 | endif | 32 | endif |
| 38 | 33 | ||
| 39 | _PREFIX=LUA_CPATH="./src/?$(_SO)" LUA_PATH="./src/?.lua;./tests/?.lua" | 34 | # Autodetect LUA |
| 35 | # | ||
| 36 | LUA=$(word 1,$(shell which lua5.1$(_LUAEXT)) $(shell which lua51$(_LUAEXT)) lua$(_LUAEXT)) | ||
| 37 | |||
| 38 | _TARGET_SO=$(_TARGET_DIR)/core.$(_SO) | ||
| 39 | |||
| 40 | _PREFIX=LUA_CPATH="./src/?.$(_SO)" LUA_PATH="./src/?.lua;./tests/?.lua" | ||
| 40 | 41 | ||
| 41 | #--- | 42 | #--- |
| 42 | all: $(_TARGET_SO) | 43 | all: $(_TARGET_SO) |
| 43 | 44 | ||
| 44 | $(_TARGET_SO): src/*.lua src/*.c src/*.h | 45 | $(_TARGET_SO): src/*.lua src/*.c src/*.h |
| 45 | cd src && $(MAKE) LUA=$(LUA) LUAC=$(LUAC) | 46 | cd src && $(MAKE) LUA=$(LUA) |
| 46 | 47 | ||
| 47 | clean: | 48 | clean: |
| 48 | cd src && $(MAKE) clean | 49 | cd src && $(MAKE) clean |
| 49 | 50 | ||
| 50 | debug: | 51 | debug: |
| 51 | $(MAKE) clean | 52 | $(MAKE) clean |
| 52 | cd src && $(MAKE) LUA=$(LUA) LUAC=$(LUAC) OPT_FLAGS="-O0 -g" | 53 | cd src && $(MAKE) LUA=$(LUA) OPT_FLAGS="-O0 -g" |
| 53 | @echo "" | 54 | @echo "" |
| 54 | @echo "** Now, try 'make repetitive' or something and if it crashes, 'gdb $(LUA) ...core file...'" | 55 | @echo "** Now, try 'make repetitive' or something and if it crashes, 'gdb $(LUA) ...core file...'" |
| 55 | @echo " Then 'bt' for a backtrace." | 56 | @echo " Then 'bt' for a backtrace." |
| @@ -65,7 +66,7 @@ gdb: | |||
| 65 | #--- LuaRocks automated build --- | 66 | #--- LuaRocks automated build --- |
| 66 | # | 67 | # |
| 67 | rock: | 68 | rock: |
| 68 | cd src && $(MAKE) LUAROCKS=1 CFLAGS="$(CFLAGS)" LIBFLAG="$(LIBFLAG)" LUA=$(LUA) LUAC=$(LUAC) | 69 | cd src && $(MAKE) LUAROCKS=1 CFLAGS="$(CFLAGS)" LIBFLAG="$(LIBFLAG)" LUA=$(LUA) |
| 69 | 70 | ||
| 70 | 71 | ||
| 71 | #--- Testing --- | 72 | #--- Testing --- |
| @@ -196,10 +197,11 @@ LUA_SHAREDIR=$(DESTDIR)/share/lua/5.1 | |||
| 196 | # | 197 | # |
| 197 | # AKa 17-Oct: changed to use 'install -m 644' and 'cp -p' | 198 | # AKa 17-Oct: changed to use 'install -m 644' and 'cp -p' |
| 198 | # | 199 | # |
| 199 | install: $(_TARGET_SO) src/lanes.lua | 200 | install: $(_TARGET_SO) src/lanes.lua src/lanes-keeper.lua |
| 200 | mkdir -p $(LUA_LIBDIR) $(LUA_SHAREDIR) | 201 | mkdir -p $(LUA_LIBDIR) $(LUA_LIBDIR)/lanes $(LUA_SHAREDIR) |
| 201 | install -m 644 $(_TARGET_SO) $(LUA_LIBDIR) | 202 | install -m 644 $(_TARGET_SO) $(LUA_LIBDIR)/lanes |
| 202 | cp -p src/lanes.lua $(LUA_SHAREDIR) | 203 | cp -p src/lanes.lua $(LUA_SHAREDIR) |
| 204 | cp -p src/lanes-keeper.lua $(LUA_SHAREDIR) | ||
| 203 | 205 | ||
| 204 | 206 | ||
| 205 | #--- Packaging --- | 207 | #--- Packaging --- |
