forked from luainkernel/lunatik
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (44 loc) · 1.98 KB
/
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
46
47
48
49
50
51
52
53
54
55
MODULES_INSTALL_PATH = /lib/modules/${shell uname -r}
SCRIPTS_INSTALL_PATH = /lib/modules/lua
LUNATIK_INSTALL_PATH = /usr/local/sbin
LUA_API = lua/lua.h lua/lauxlib.h lua/lualib.h
KDIR ?= ${MODULES_INSTALL_PATH}/build
all: lunatik_sym.h
make -C ${KDIR} M=${PWD} CONFIG_LUNATIK=m \
CONFIG_LUNATIK_RUN=m CONFIG_LUNATIK_RUNTIME=y CONFIG_LUNATIK_DEVICE=m \
CONFIG_LUNATIK_LINUX=m CONFIG_LUNATIK_NOTIFIER=m CONFIG_LUNATIK_SOCKET=m \
CONFIG_LUNATIK_RCU=m CONFIG_LUNATIK_THREAD=m CONFIG_LUNATIK_FIB=m \
CONFIG_LUNATIK_DATA=m CONFIG_LUNATIK_PROBE=m CONFIG_LUNATIK_SYSCALL=m
clean:
make -C ${KDIR} M=${PWD} clean
rm lunatik_sym.h
scripts_install:
mkdir -p -m 0755 ${SCRIPTS_INSTALL_PATH} ${SCRIPTS_INSTALL_PATH}/socket
mkdir -p -m 0755 ${SCRIPTS_INSTALL_PATH} ${SCRIPTS_INSTALL_PATH}/syscall
install -m 0644 -o root -g root lunatik.lua ${SCRIPTS_INSTALL_PATH}
install -m 0644 -o root -g root lib/socket/*.lua ${SCRIPTS_INSTALL_PATH}/socket
install -m 0644 -o root -g root lib/syscall/*.lua ${SCRIPTS_INSTALL_PATH}/syscall
install -m 0755 -o root -g root lunatik ${LUNATIK_INSTALL_PATH}
scripts_uninstall:
rm ${SCRIPTS_INSTALL_PATH}/lunatik.lua
rm -r ${SCRIPTS_INSTALL_PATH}/socket
rm -r ${SCRIPTS_INSTALL_PATH}/syscall
rm ${LUNATIK_INSTALL_PATH}/lunatik
examples_install:
mkdir -p -m 0755 ${SCRIPTS_INSTALL_PATH}/examples
install -m 0644 -o root -g root examples/*.lua ${SCRIPTS_INSTALL_PATH}/examples
mkdir -p -m 0755 ${SCRIPTS_INSTALL_PATH}/examples/echod
install -m 0644 -o root -g root examples/echod/*.lua ${SCRIPTS_INSTALL_PATH}/examples/echod
examples_uninstall:
rm -r ${SCRIPTS_INSTALL_PATH}/examples
modules_install:
mkdir -p -m 0755 ${MODULES_INSTALL_PATH}/lunatik
install -m 0644 -o root -g root *.ko lib/*.ko ${MODULES_INSTALL_PATH}/lunatik
modules_uninstall:
rm -r ${MODULES_INSTALL_PATH}/lunatik
install: scripts_install modules_install
depmod -a
uninstall: scripts_uninstall modules_uninstall
depmod -a
lunatik_sym.h: $(LUA_API)
${shell ./gensymbols.sh $(LUA_API) > lunatik_sym.h}