From: Gleb C. <lna...@ya...> - 2023-06-14 13:50:10
|
Commit: 85e8086 GitHub URL: https://github.com/SCST-project/scst/commit/85e8086a7e49428666df6b139d53f1364a979b51 Author: Gleb Chesnokov Date: 2023-06-14T16:49:36+03:00 Log Message: ----------- Makefile: Implement several improvements to SCST Makefiles 1. Correct a typo, changing `make release` to `make 2release`. 2. Add information about package-related targets to the help section. 3. Remove `dev_handler` directory during the uninstall process. 4. Eliminate the non-existent `tgt` target from the PHONY targets. 5. Introduce SCST_MOD_DIR and SCST_DH_MOD_DIR as helper variables. Modified Paths: -------------- INSTALL.md | 2 +- Makefile | 7 +++++++ fcst/Makefile | 2 +- qla2x00t-32gbit/Makefile | 2 +- qla2x00t-32gbit/qla2x00-target/Makefile | 2 +- qla2x00t/Makefile | 2 +- qla2x00t/qla2x00-target/Makefile | 2 +- scst/src/Makefile | 15 +++++++++------ scst/src/dev_handlers/Makefile | 1 + scst_local/Makefile | 2 +- 10 files changed, 24 insertions(+), 13 deletions(-) =================================================================== diff --git a/INSTALL.md b/INSTALL.md index ce7c6b2..80c3472 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -22,7 +22,7 @@ If the following packages have not yet been installed, install these now: The next step is to build and install SCST. How to do that depends on whether or not your Linux distribution supports a package manager: - make release + make 2release if rpm -q glibc >/dev/null 2>&1; then rm -rf {,scstadmin/}rpmbuilddir make rpm diff --git a/Makefile b/Makefile index e81abe2..bdcca82 100644 --- a/Makefile +++ b/Makefile @@ -146,6 +146,13 @@ help: @echo " usr_install : usr target: install" @echo " usr_uninstall : usr target: uninstall" @echo "" + @echo " scst-rpm : make SCST RPM packages" + @echo " scst-dkms-rpm : make SCST DKMS RPM packages" + @echo " rpm : make both SCST and scstadmin RPM packages" + @echo " rpm-dkms : make both SCST DKMS and scstadmin RPM packages" + @echo "" + @echo " dpkg : make SCST dpkg packages" + @echo "" @echo " 2perf : changes debug state to full performance" @echo " 2release : changes debug state to release" @echo " 2debug : changes debug state to full debug" diff --git a/fcst/Makefile b/fcst/Makefile index 8c82d4a..7c39044 100644 --- a/fcst/Makefile +++ b/fcst/Makefile @@ -87,4 +87,4 @@ extraclean: clean release-archive: ../scripts/generate-release-archive fcst "$$(sed -n 's/^#define[[:blank:]]FT_VERSION[[:blank:]]*\"\([^\"]*\)\".*/\1/p' fcst.h)" -.PHONY: all tgt install uninstall clean extraclean release-archive +.PHONY: all install uninstall clean extraclean release-archive diff --git a/qla2x00t-32gbit/Makefile b/qla2x00t-32gbit/Makefile index ddcaafc..cf4cea8 100644 --- a/qla2x00t-32gbit/Makefile +++ b/qla2x00t-32gbit/Makefile @@ -71,7 +71,7 @@ clean: extraclean: clean rm -f *.orig *.rej -.PHONY: all tgt install uninstall clean extraclean +.PHONY: all install uninstall clean extraclean endif diff --git a/qla2x00t-32gbit/qla2x00-target/Makefile b/qla2x00t-32gbit/qla2x00-target/Makefile index 886494d..574527e 100644 --- a/qla2x00t-32gbit/qla2x00-target/Makefile +++ b/qla2x00t-32gbit/qla2x00-target/Makefile @@ -102,4 +102,4 @@ endif extraclean: clean rm -f *.orig *.rej -.PHONY: all tgt install uninstall clean extraclean qla2xxx_scst +.PHONY: all install uninstall clean extraclean qla2xxx_scst diff --git a/qla2x00t/Makefile b/qla2x00t/Makefile index dfaa980..9806a81 100644 --- a/qla2x00t/Makefile +++ b/qla2x00t/Makefile @@ -69,7 +69,7 @@ clean: extraclean: clean rm -f *.orig *.rej -.PHONY: all tgt install uninstall clean extraclean +.PHONY: all install uninstall clean extraclean endif diff --git a/qla2x00t/qla2x00-target/Makefile b/qla2x00t/qla2x00-target/Makefile index b976e17..0fe34e1 100644 --- a/qla2x00t/qla2x00-target/Makefile +++ b/qla2x00t/qla2x00-target/Makefile @@ -101,4 +101,4 @@ endif extraclean: clean rm -f *.orig *.rej -.PHONY: all tgt install uninstall clean extraclean qla2xxx_scst +.PHONY: all install uninstall clean extraclean qla2xxx_scst diff --git a/scst/src/Makefile b/scst/src/Makefile index 236d1d2..9975a1f 100644 --- a/scst/src/Makefile +++ b/scst/src/Makefile @@ -35,6 +35,9 @@ SHELL=/bin/bash DEV_HANDLERS_DIR = dev_handlers +SCST_MOD_DIR := $(shell pwd) +SCST_DH_MOD_DIR := $(shell pwd)/$(DEV_HANDLERS_DIR) + ifeq ($(KVER),) ifeq ($(KDIR),) KVER := $(shell uname -r) @@ -73,13 +76,13 @@ $(SCST_INTF_VER_FILE): $(SCST_INC_DIR)/scst.h $(SCST_INC_DIR)/scst_const.h $(SCS all: $(SCST_INTF_VER_FILE) $(MAKE) -C certs KDIR=$(KDIR) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") - $(MAKE) -C $(KDIR) M=$(shell pwd) \ + $(MAKE) -C $(KDIR) M=$(SCST_MOD_DIR) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") - $(MAKE) -C $(KDIR) M=$(shell pwd)/dev_handlers \ + $(MAKE) -C $(KDIR) M=$(SCST_DH_MOD_DIR) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") scst: - $(MAKE) -C $(KDIR) M=$(shell pwd) \ + $(MAKE) -C $(KDIR) M=$(SCST_MOD_DIR) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") install: all @@ -89,12 +92,12 @@ install: all false; fi -rm -f $(INSTALL_DIR)/scsi_tgt.ko KDIR=$(KDIR) ../../scripts/sign-modules - $(MAKE) -C $(KDIR) M=$(shell pwd)/dev_handlers \ + $(MAKE) -C $(KDIR) M=$(SCST_DH_MOD_DIR) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ INSTALL_MOD_DIR=extra/dev_handlers \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install - $(MAKE) -C $(KDIR) M=$(shell pwd) \ + $(MAKE) -C $(KDIR) M=$(SCST_MOD_DIR) \ $(shell [ -n "$(PASS_CC_TO_MAKE)" ] && echo CC="$(CC)") \ $$([ -n "$(DEPMOD)" ] && echo "DEPMOD=$(DEPMOD)") \ CONFIG_MODULE_SIG_ALL= modules_install @@ -135,7 +138,7 @@ INSTALL_DIR_H := $(DESTDIR)$(PREFIX)/include/scst clean: rm -f $(SCST_INTF_VER_FILE) - $(MAKE) -C $(KDIR) M=$(shell pwd) $@ + $(MAKE) -C $(KDIR) M=$(SCST_MOD_DIR) $@ $(MAKE) -C $(DEV_HANDLERS_DIR) $@ extraclean: clean diff --git a/scst/src/dev_handlers/Makefile b/scst/src/dev_handlers/Makefile index 2be974b..4ecbb5f 100644 --- a/scst/src/dev_handlers/Makefile +++ b/scst/src/dev_handlers/Makefile @@ -68,6 +68,7 @@ install: all uninstall: rm -f $(INSTALL_DIR)/dev_handlers/scst_*.ko + -rmdir $(INSTALL_DIR)/dev_handlers 2>/dev/null clean: $(MAKE) -C $(KDIR) M=$(shell pwd) $@ diff --git a/scst_local/Makefile b/scst_local/Makefile index 4e7626f..f53473c 100644 --- a/scst_local/Makefile +++ b/scst_local/Makefile @@ -57,5 +57,5 @@ extraclean: clean release-archive: ../scripts/generate-release-archive scst_local "$$(sed -n 's/^#define[[:blank:]]SCST_LOCAL_VERSION[[:blank:]]*\"\([^\"]*\)\".*/\1/p' scst_local.c)" -.PHONY: all tgt install uninstall clean extraclean +.PHONY: all install uninstall clean extraclean |