Skip to content

Commit

Permalink
Compile LuaJIT with LUAJIT_USE_PERFTOOLS and LUAJIT_USE_GDBJIT.
Browse files Browse the repository at this point in the history
These are valuable debugging tools and they have no immediately
obvious performance impact.

Particularly useful is LUAJIT_USE_PERFTOOLS so that Linux 'perf top'
will show individual traces.
  • Loading branch information
lukego committed Apr 20, 2014
1 parent 6dd9a29 commit cbed6e5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@ COBJ = $(CSRC:.c=.o)

LUAJIT_O := deps/luajit/src/libluajit.a

LUAJIT_CFLAGS := -DLUAJIT_USE_PERFTOOLS -DLUAJIT_USE_GDBJIT

all: $(LUAJIT_O)
cd src && $(MAKE)

$(LUAJIT_O): deps/luajit/Makefile
(echo 'Building LuaJIT\n'; cd deps/luajit && $(MAKE) PREFIX=`pwd`/usr/local && $(MAKE) DESTDIR=`pwd` install)
echo 'Building LuaJIT\n'
(cd deps/luajit && \
$(MAKE) PREFIX=`pwd`/usr/local \
CFLAGS="$(LUAJIT_CFLAGS)" && \
$(MAKE) DESTDIR=`pwd` install)
(cd deps/luajit/usr/local/bin; ln -fs luajit-2.1.0-alpha luajit)

clean:
Expand Down

0 comments on commit cbed6e5

Please sign in to comment.