···11-# Out of the box, the build with this Makefile only works in FHS environments,
22-# such as on Ubuntu or Debian. On NixOS, you either need to open an FHS
33-# environment using a Nix shell or build this from a specially crafted Nix
44-# derivation.
55-#
66-# This file follows the conventions written down here:
77-# https://docs.kernel.org/kbuild/modules.html
88-# Make it possible to override the kernel src tree location from Nix derivation.
99-KERNEL ?= $(shell uname -r)
1010-KERNELDIR ?= /lib/modules/$(KERNEL)/build/
1111-ccflags-y := -std=gnu11 -Wno-declaration-after-statement
1212-.PHONY: default
1313-default: modules
1414-# -m: Build as module.
1515-obj-m = msi-ec.o
1616-.PHONY: modules
1717-modules:
1818- @#"M=": Module source. Special variable of the kernel's main Makefile.
1919- $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
2020-.PHONY: modules_install
2121-modules_install:
2222- $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
2323-6.11-kernel-patch:
2424- git apply 6.11-kernel.patch
2525-2626-older-kernel-patch:
2727- git apply older-kernel.patch