forked from snabbco/snabb
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
32 lines (27 loc) · 948 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
LUASRC = $(wildcard src/lua/*.lua)
LUAOBJ = $(LUASRC:.lua=.o)
CSRC = $(wildcard src/c/*.c)
COBJ = $(CSRC:.c=.o)
PREFIX = /usr/local
LUAJIT_CFLAGS := -include $(CURDIR)/gcc-preinclude.h
all: $(LUAJIT) $(SYSCALL) $(PFLUA)
# LuaJIT
@(cd lib/luajit && \
$(MAKE) PREFIX=`pwd`/usr/local \
CFLAGS="$(LUAJIT_CFLAGS)" && \
$(MAKE) DESTDIR=`pwd` install)
(cd lib/luajit/usr/local/bin; ln -fs luajit-2.1.0-beta1 luajit)
# ljsyscall
@mkdir -p src/syscall/linux
@cp -p lib/ljsyscall/syscall.lua src/
@cp -p lib/ljsyscall/syscall/*.lua src/syscall/
@cp -p lib/ljsyscall/syscall/linux/*.lua src/syscall/linux/
@cp -pr lib/ljsyscall/syscall/linux/x64 src/syscall/linux/
@cp -pr lib/ljsyscall/syscall/shared src/syscall/
cd src && $(MAKE)
install: all
install -D src/snabb ${DESTDIR}${PREFIX}/bin/snabb
clean:
(cd lib/luajit && $(MAKE) clean)
(cd src; $(MAKE) clean; rm -rf syscall.lua syscall)
.SERIAL: all