-
Notifications
You must be signed in to change notification settings - Fork 34
/
Makefile.dkms
39 lines (32 loc) · 889 Bytes
/
Makefile.dkms
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
modname := natcap
DKMS := dkms
modver := $(shell awk -F'"' '/define *NATCAP_VERSION/{print $$2}' < natcap.h)
# directory in which generated files are stored
DKMS_DEST := /usr/src/$(modname)-$(modver)
all: install
src_install:
mkdir -p '$(DKMS_DEST)'
cp \
natcap_main.c \
natcap.h \
natcap_common.c \
natcap_common.h \
natcap_client.c \
natcap_client.h \
natcap_server.c \
natcap_server.h \
natcap_knock.c \
natcap_knock.h \
natcap_peer.c \
natcap_peer.h \
'$(DKMS_DEST)'
cp Makefile '$(DKMS_DEST)/Makefile'
sed 's/#MODULE_VERSION#/$(modver)/' dkms.conf > '$(DKMS_DEST)/dkms.conf'
build: src_install
$(DKMS) add -m natcap -v $(modver) 2>/dev/null || true
$(DKMS) build -m natcap -v $(modver)
install: build
$(DKMS) install -m natcap -v $(modver)
uninstall:
$(DKMS) remove -m natcap -v $(modver) --all
.PHONY: all src_install build install uninstall