parameterize kernel directory
The directory for kernel headers can now be overridden through the KERNEL_DIR variable
This commit is contained in:
parent
23d2512131
commit
827f5d3424
1 changed files with 4 additions and 3 deletions
7
Makefile
7
Makefile
|
@ -1,4 +1,5 @@
|
||||||
KERNELRELEASE ?= $(shell uname -r)
|
KERNELRELEASE ?= $(shell uname -r)
|
||||||
|
KERNEL_DIR ?= /lib/modules/$(KERNELRELEASE)/build
|
||||||
|
|
||||||
DEBUG ?= n
|
DEBUG ?= n
|
||||||
ifeq ($(DEBUG),y)
|
ifeq ($(DEBUG),y)
|
||||||
|
@ -7,7 +8,7 @@ else
|
||||||
EXTRA_CFLAGS += -O2
|
EXTRA_CFLAGS += -O2
|
||||||
endif
|
endif
|
||||||
|
|
||||||
EXTRA_CFLAGS += -I$(PWD)/include
|
EXTRA_CFLAGS += "-I$(PWD)/include"
|
||||||
|
|
||||||
obj-m += keymash.o
|
obj-m += keymash.o
|
||||||
|
|
||||||
|
@ -16,10 +17,10 @@ keymash-sources = src/keymash.c
|
||||||
keymash-objs = $(keymash-sources:.c=.o)
|
keymash-objs = $(keymash-sources:.c=.o)
|
||||||
|
|
||||||
keymash.ko:
|
keymash.ko:
|
||||||
make -C "/lib/modules/$(KERNELRELEASE)/build" M="$(PWD)" modules
|
make -C "$(KERNEL_DIR)" M="$(PWD)" modules
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
make -C "/lib/modules/$(KERNELRELEASE)/build" M="$(PWD)" clean
|
make -C "$(KERNEL_DIR)" M="$(PWD)" clean
|
||||||
|
|
||||||
all: keymash.ko
|
all: keymash.ko
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue