Skip to content
This repository was archived by the owner on Mar 7, 2021. It is now read-only.

Parameterize the kernel module build dir in all makefiles. #68

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions example-sysctl/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
obj-m := examplesysctl.o
examplesysctl-objs := target/x86_64-linux-kernel-module/debug/libexample_sysctl.a
EXTRA_LDFLAGS += --entry=init_module
KDIR ?= /lib/modules/$(shell uname -r)/build

all:
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(CURDIR)
$(MAKE) -C $(KDIR) M=$(CURDIR)

clean:
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(CURDIR) clean
$(MAKE) -C $(KDIR) M=$(CURDIR) clean
5 changes: 3 additions & 2 deletions hello-world/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
obj-m := helloworld.o
helloworld-objs := target/x86_64-linux-kernel-module/debug/libhello_world.a
EXTRA_LDFLAGS += --entry=init_module
KDIR ?= /lib/modules/$(shell uname -r)/build

all:
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(CURDIR)
$(MAKE) -C $(KDIR) M=$(CURDIR)

clean:
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(CURDIR) clean
$(MAKE) -C $(KDIR) M=$(CURDIR) clean
5 changes: 3 additions & 2 deletions static-filesystem/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
obj-m := staticfilesystem.o
staticfilesystem-objs := target/x86_64-linux-kernel-module/debug/libstatic_filesystem.a
EXTRA_LDFLAGS += --entry=init_module
KDIR ?= /lib/modules/$(shell uname -r)/build

all:
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(CURDIR)
$(MAKE) -C $(KDIR) M=$(CURDIR)

clean:
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(CURDIR) clean
$(MAKE) -C $(KDIR) M=$(CURDIR) clean
5 changes: 3 additions & 2 deletions tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
obj-m := testmodule.o
testmodule-objs := $(TEST_LIBRARY)
EXTRA_LDFLAGS += --entry=init_module
KDIR ?= /lib/modules/$(shell uname -r)/build

all:
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(CURDIR)
$(MAKE) -C $(KDIR) M=$(CURDIR)

clean:
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(CURDIR) clean
$(MAKE) -C $(KDIR) M=$(CURDIR) clean