-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (24 loc) · 716 Bytes
/
Makefile
File metadata and controls
29 lines (24 loc) · 716 Bytes
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
KERNELRELEASE=$(shell uname -r)
KERNELDIR ?= /lib/modules/$(KERNELRELEASE)/build
PWD := $(shell pwd)
SOURCE := src
OBJ := zig-out/obj
# The zig main file name
ZIGMODULE := zigmodule
MODULENAME := $(ZIGMODULE)
obj-m := $(MODULENAME).o
$(MODULENAME)-y := $(SOURCE)/ffi.o
$(MODULENAME)-y += $(OBJ)/$(ZIGMODULE).o
ccflags-y += -I$(src)/include
default: zig.o
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
install:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
clean:
$(MAKE) -C $(KERNELDIR) M=$(PWD) clean
rm -rf zig-cache src/zig-cache
# In case this isn't auto generated, make an empty .cmd file
# See: https://github.com/dynup/kpatch/issues/1125
zig.o:
zig build \
&& touch $(PWD)/$(OBJ)/.$(ZIGMODULE).o.cmd