forked from snabbco/snabb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
30 lines (23 loc) · 765 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
LUASRC = $(wildcard src/lua/*.lua)
LUAOBJ = $(LUASRC:.lua=.o)
CSRC = $(wildcard src/c/*.c)
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): check_luajit deps/luajit/Makefile
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)
check_luajit:
@if [ ! -f deps/luajit/Makefile ]; then \
echo "Can't find deps/luajit/. You might need to: git submodule update --init"; exit 1; \
fi
clean:
(cd deps/luajit && $(MAKE) clean)
(cd src; $(MAKE) clean)
.SERIAL: all