X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=Makefile;h=0a9e45eb0a6d290bb4ceae07ee8e6bdef4d44316;hb=45362125880411ebb94253979d98df1b04a3e02c;hp=f70351610529d82c4753d1a67783894a77cb3da6;hpb=bf048cb0aedb1a3ff8d1eb79a05559a9850ced95;p=procprotect.git diff --git a/Makefile b/Makefile index f703516..0a9e45e 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,24 @@ obj-m += procprotect.o +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.11.4-101.$(DIST).$(ARCH) +endif + all: - make -C /lib/modules/3.8.1-201.fc18.x86_64/build M=$(PWD) modules + make -C /lib/modules/$(KVER)/build M=$(PWD) modules clean: - make -C /lib/modules/3.8.1-201.fc18.x86_64/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 + install -m 644 procprotect.service /usr/lib/systemd/system/procprotect.service + install -m 755 procprotect.init /usr/sbin/procprotect.init