-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.dkms.in
42 lines (31 loc) · 978 Bytes
/
Makefile.dkms.in
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
GIT_REV:=unknown
ifneq (, $(shell which git))
ifeq (, $(shell echo ${SUBDIRS}))
GIT_BRANCH=$(shell git branch --no-color|cut -d ' ' -f 2)
GIT_HASH=$(shell git rev-parse HEAD)
GIT_REV:=${GIT_BRANCH}:${GIT_HASH}
endif
endif
all: install
add: remove
\/bin/rm -rf /usr/src/pfring-@VERS@
mkdir /usr/src/pfring-@VERS@
cp -r Makefile dkms.conf pf_ring.c linux/ /usr/src/pfring-@VERS@
cat Makefile | sed -e "s/GIT_REV:=$$/GIT_REV:=${GIT_REV}/" > /usr/src/pfring-@VERS@/Makefile
dkms add -m pfring -v @VERS@
build: add
dkms build -m pfring -v @VERS@
install: build
dkms install -m pfring -v @VERS@
deb: add add_deb install
dkms mkdeb -m pfring -v @VERS@ --source-only
rpm: add add_rpm install
dkms mkrpm -m pfring -v @VERS@ --source-only
add_rpm:
cp -r pfring-dkms-*.spec /usr/src/pfring-@VERS@/
add_deb:
cp -r pfring-dkms-mkdeb /usr/src/pfring-@VERS@/
remove:
-dkms remove -m pfring -v @VERS@ --all
veryclean: remove
\/bin/rm -fr /usr/src/pfring-@VERS@