From 32fd54f3efe5ade2ba9a6ca690e2011bb57c6aac Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 2 Dec 2021 20:22:50 -0800 Subject: [PATCH] fcst: Fix the Debian 10 build The line in /lib/modules/4.19.0-18-amd64/build/Makefile on Debian 10 with the path to the header files is as follows: MAKEARGS := -C /usr/src/linux-headers-4.19.0-18-common O=/usr/src/linux-headers-4.19.0-18-amd64 while on Debian 11 the contenst of /lib/modules/5.10.0-8-amd64/build/Makefile is as follows: include /usr/src/linux-headers-5.10.0-8-common/Makefile Add support for extracting the header file directory path from the Debian 10 Makefile. Fixes: https://github.com/bvanassche/scst/issues/52 --- fcst/Kbuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fcst/Kbuild b/fcst/Kbuild index 6f9a59674..be21875ad 100644 --- a/fcst/Kbuild +++ b/fcst/Kbuild @@ -1,5 +1,5 @@ KBUILD_EXTRA_SYMBOLS=$(src)/../scst/src/Module.symvers -ccflags-y += -I$(src)/../scst/include $(shell if [ -e include/scsi ]; then header_dir=.; else header_dir=$$(sed 's/^include[[:blank:]]\+\(.*\)\/Makefile$$/\1/' Makefile); fi; if false; then echo "header_dir=$${header_dir}" >&2; fi; grep -qw fc_fill_fc_hdr "$${header_dir}/include/scsi/fc_encode.h" 2>/dev/null && echo -DFC_FILL_FC_HDR_IN_SCSI_FC_ENCODE_H) +ccflags-y += -I$(src)/../scst/include $(shell if [ -e include/scsi ]; then header_dir=.; else header_dir=$$(sed -n 's/^include[[:blank:]]\+\(.*\)\/Makefile$$/\1/p;s/^MAKEARGS := -C \([^ ]*\) .*/\1/p' Makefile); fi; if false; then echo "header_dir=$${header_dir}" >&2; fi; grep -qw fc_fill_fc_hdr "$${header_dir}/include/scsi/fc_encode.h" 2>/dev/null && echo -DFC_FILL_FC_HDR_IN_SCSI_FC_ENCODE_H) obj-$(CONFIG_FCST) += fcst.o