-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
33 lines (24 loc) · 830 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
33
obj-m += serialsim.o
my_moddir = /lib/modules/$(shell uname -r)
ccflags-y += -I$(src)/include
all:
make -C $(my_moddir)/build M=$(PWD) modules
# Do our own clean, otherwise swig/serialsim.i gets removed
clean:
rm -f *.o* *.ko *.mod*
private_key.der: openssl.conf
openssl req -x509 -new -nodes -utf8 -sha256 -days 36500 \
-batch -config openssl.conf -outform DER \
-out public_key.der -keyout private_key.der
KERNELBASE=/usr/src/linux-headers-$(shell uname -r)
sign: all private_key.der
$(KERNELBASE)/scripts/sign-file sha256 \
private_key.der public_key.der serialsim.ko
prefix = /usr/local
includedir = $(prefix)/include
install:
mkdir -p $(DESTDIR)/$(includedir)/linux
cp include/linux/serialsim.h $(DESTDIR)/$(includedir)/linux
mkdir -p $(my_moddir)/local
cp serialsim.ko $(my_moddir)/local
depmod -a