Skip to content

Commit

Permalink
Merge pull request #46 from kost/kdir-support
Browse files Browse the repository at this point in the history
KDIR support (headers outside standard location)
  • Loading branch information
jtsylve committed May 6, 2018
2 parents ef34a17 + 0f04e19 commit 7eba65e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,19 @@ lime-objs := tcp.o disk.o main.o hash.o

KVER ?= $(shell uname -r)

KDIR ?= /lib/modules/$(KVER)/build

PWD := $(shell pwd)

.PHONY: modules modules_install clean distclean debug

default:
$(MAKE) -C /lib/modules/$(KVER)/build M="$(PWD)" modules
$(MAKE) -C $(KDIR) M="$(PWD)" modules
strip --strip-unneeded lime.ko
mv lime.ko lime-$(KVER).ko

debug:
KCFLAGS="-DLIME_DEBUG" $(MAKE) CONFIG_DEBUG_SG=y -C /lib/modules/$(KVER)/build M="$(PWD)" modules
KCFLAGS="-DLIME_DEBUG" $(MAKE) CONFIG_DEBUG_SG=y -C $(KDIR) M="$(PWD)" modules
strip --strip-unneeded lime.ko
mv lime.ko lime-$(KVER).ko

Expand All @@ -44,7 +46,7 @@ modules: main.c disk.c tcp.c hash.c lime.h
strip --strip-unneeded lime.ko

modules_install: modules
$(MAKE) -C /lib/modules/$(KVER)/build M="$(PWD)" $@
$(MAKE) -C $(KDIR) M="$(PWD)" $@

clean:
rm -f *.o *.mod.c Module.symvers Module.markers modules.order \.*.o.cmd \.*.ko.cmd \.*.o.d
Expand Down

0 comments on commit 7eba65e

Please sign in to comment.