-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
46 lines (31 loc) · 881 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
LUVIT=deps/luvit/build/luvit
ifeq ($(shell uname -sm | sed -e s,x86_64,i386,),Darwin i386)
#osx
export CC=gcc #-arch i386
CFLAGS=$(shell $(LUVIT) --cflags) -g -O3 -I./deps/luvit/deps/luajit/src
LIBS=$(shell $(LUVIT) --libs)
LDFLAGS=
else
# linux
CFLAGS=$(shell $(LUVIT) --cflags) -g -O3 -I./deps/luvit/deps/luajit/src -fno-strict-aliasing
LIBS=$(shell $(LUVIT) --libs) -lm -ldl
LDFLAGS=
endif
# workaround for luvit build script bug: bad symlink to luajit have to be a directory for gcc
LUAJITBIN=deps/luvit/include/luvit/luajit
all: test
mp.o: mp.c
echo $(LUVITCONFIG)
$(CC) -c mp.c $(CFLAGS)
msgpack.luvit: mp.o
echo $(LIBS)
$(CC) -o msgpack.luvit mp.o $(LIBS)
test: $(LUVIT) msgpack.luvit
$(LUVIT) test.lua
$(LUVIT) :
git submodule init
git submodule update
cd deps/luvit; ./configure; make
rm $(LUAJITBIN)
clean:
rm -rf *.o *.luvit deps/luvit/build/*