X-Git-Url: http://git.onelab.eu/?p=procprotect.git;a=blobdiff_plain;f=Makefile;h=97aa044ed31f8b0358d87ca18090ff5ffd2aef83;hp=1e4339a9d6be27c36f5f0931a8b45936ddf45f03;hb=HEAD;hpb=f1ced54bed3ef5efe0e3b4dbe77fedbb9a3c450c diff --git a/Makefile b/Makefile index 1e4339a..97aa044 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.10.6-100.$(DIST).$(ARCH) +endif + all: - make -C /usr/src/kernels/3.6.2-1.fc16.x86_64 M=$(PWD) modules + make -C /lib/modules/$(KVER)/build M=$(PWD) modules 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 + install -m 644 procprotect.service /usr/lib/systemd/system/procprotect.service + install -m 755 procprotect.init /usr/sbin/procprotect.init