git://git.onelab.eu
/
procprotect.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
384193e
)
Make it possible to build and install out of the Makefile
author
Sapan Bhatia
<gwsapan@gmail.com>
Fri, 16 Aug 2013 21:28:24 +0000
(17:28 -0400)
committer
Sapan Bhatia
<gwsapan@gmail.com>
Fri, 16 Aug 2013 21:28:24 +0000
(17:28 -0400)
Makefile
patch
|
blob
|
history
diff --git
a/Makefile
b/Makefile
index
04471df
..
16b125b
100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-1,7
+1,22
@@
obj-m += procprotect.o
obj-m += procprotect.o
-all:
- make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
+KVER=$(shell uname -r)
+ARCH=$(shell uname -m)
+
+# Is there an easy way of fetching this automatically, short of mapping /etc/redhat-release
+DIST=fc18
+
+ifeq ($(wildcard /lib/modules/$(KVER)/build),)
+ KVER=3.10.6-100.$(DIST).$(ARCH)
+endif
+
+all:
+ make -C /lib/modules/$(KVER)/build M=$(PWD) modules
clean:
clean:
- make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
+ make -C /lib/modules/$(KVER)/build M=$(PWD) clean
+
+install:
+ install -D -m 755 procprotect.ko /lib/modules/$(KVER)/net/procprotect/procprotect.ko
+ mkdir -p /etc/modules-load.d
+ install -m 644 procprotect.conf /etc/modules-load.d/procprotect.conf