From 6bb9bca0504d721107a1959eb5359db239189c1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Flemstr=C3=B6m?= Date: Fri, 29 Mar 2024 19:00:10 +0100 Subject: [PATCH] Makefile: refactor somewhat to enable make arg propagation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: David Flemström --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index e4186d7..93678b3 100644 --- a/Makefile +++ b/Makefile @@ -2,21 +2,24 @@ # external KDIR specification is supported KDIR ?= /lib/modules/$(shell uname -r)/build +PWD ?= $(shell pwd) SOURCES := aquacomputer_d5next.c docs/aquacomputer_d5next.rst +.PHONY: all modules modules clean checkpatch dev + all: modules install: modules_install modules modules_install clean: - make -C $(KDIR) M=$$PWD $@ + $(MAKE) -C $(KDIR) M=$(PWD) $@ checkpatch: $(KDIR)/scripts/checkpatch.pl --strict --no-tree $(SOURCES) dev: - make clean - make + $(MAKE) clean + $(MAKE) sudo rmmod aquacomputer_d5next || true sudo insmod aquacomputer_d5next.ko