# SPDX-License-Identifier: GPL-2.0-only
ifneq ($(KERNELRELEASE),)
obj-m := rng90.o
else
KDIR ?= /lib/modules/$(shell uname -r)/build

.PHONY: all modules clean check
all: modules
modules:
	$(MAKE) -C $(KDIR) M=$(CURDIR) W=1 modules
clean:
	$(MAKE) -C $(KDIR) M=$(CURDIR) clean
check:
	@test -n "$(KERNEL_SRC)" || { echo 'Set KERNEL_SRC to a Linux source tree'; exit 1; }
	perl $(KERNEL_SRC)/scripts/checkpatch.pl --no-tree --strict --file rng90.c rng90-kunit.c
endif
