summaryrefslogtreecommitdiffhomepage
path: root/src/Makefile
blob: 2ca55ecfef1f570a6a64222377a99975051768bb (plain)
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
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)

all: module tools
debug: module-debug tools

module:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules

module-debug:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) V=1 CONFIG_WIREGUARD_DEBUG=y modules

clean:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) clean
	$(MAKE) -C tools clean

install:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
	depmod -a
	$(MAKE) -C tools install

tools:
	$(MAKE) -C tools

check:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) C=2 CF="-D__CHECK_ENDIAN__" CONFIG_WIREGUARD_DEBUG=y
	$(MAKE) -C tools check

cloc: clean
	cloc $(filter-out compat.h, $(wildcard *.c) $(wildcard *.h))

include tests/debug.mk

.PHONY: all module module-debug tools install clean core-cloc check