From 7563b95480e1de90bd5d33a2a4f51319e4f382ae Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Thu, 2 Nov 2023 15:54:27 +0100 Subject: [PATCH 1/6] Only build scsidump when building for the FULLSPEC board --- cpp/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cpp/Makefile b/cpp/Makefile index 425b6f9eed..f45721c6fe 100644 --- a/cpp/Makefile +++ b/cpp/Makefile @@ -67,9 +67,13 @@ BIN_ALL = \ $(BINDIR)/$(PISCSI) \ $(BINDIR)/$(SCSICTL) \ $(BINDIR)/$(SCSIMON) \ - $(BINDIR)/$(SCSIDUMP) \ $(BINDIR)/$(SCSILOOP) +# scsidump requires initiator support +ifeq ($(CONNECT_TYPE), FULLSPEC) +BIN_ALL += $(BINDIR)/$(SCSIDUMP) +endif + SRC_PROTOC = piscsi_interface.proto SRC_GENERATED = $(GENERATED_DIR)/piscsi_interface.pb.cpp From dfcee72b1063418f7fa53c60ff893a78f61fb67e Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Thu, 2 Nov 2023 15:56:53 +0100 Subject: [PATCH 2/6] Update formatting --- cpp/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/Makefile b/cpp/Makefile index f45721c6fe..b0e9869e30 100644 --- a/cpp/Makefile +++ b/cpp/Makefile @@ -71,7 +71,7 @@ BIN_ALL = \ # scsidump requires initiator support ifeq ($(CONNECT_TYPE), FULLSPEC) -BIN_ALL += $(BINDIR)/$(SCSIDUMP) + BIN_ALL += $(BINDIR)/$(SCSIDUMP) endif SRC_PROTOC = piscsi_interface.proto From d2b2050e67fcf785b32fd789d6554faad11f0412 Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Thu, 2 Nov 2023 15:57:41 +0100 Subject: [PATCH 3/6] Update formatting --- cpp/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/Makefile b/cpp/Makefile index b0e9869e30..3c9428a31f 100644 --- a/cpp/Makefile +++ b/cpp/Makefile @@ -39,7 +39,7 @@ CXXFLAGS += $(EXTRA_FLAGS) CONNECT_TYPE ?= FULLSPEC ifdef CONNECT_TYPE -CXXFLAGS += -DCONNECT_TYPE_$(CONNECT_TYPE) + CXXFLAGS += -DCONNECT_TYPE_$(CONNECT_TYPE) endif PISCSI = piscsi From 2ee02a432bb74594152f1dec8c301bd2e89654ea Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Thu, 2 Nov 2023 16:11:33 +0100 Subject: [PATCH 4/6] Only install scsidump manpage when building for the FULLSPEC board --- cpp/Makefile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/cpp/Makefile b/cpp/Makefile index 3c9428a31f..bda8df9012 100644 --- a/cpp/Makefile +++ b/cpp/Makefile @@ -132,6 +132,14 @@ OBJ_SHARED := $(addprefix $(OBJDIR)/,$(notdir $(SRC_SHARED:%.cpp=%.o))) OBJ_PROTOBUF := $(addprefix $(OBJDIR)/,$(notdir $(SRC_PROTOBUF:%.cpp=%.o))) OBJ_GENERATED := $(addprefix $(OBJDIR)/,$(notdir $(SRC_GENERATED:%.cpp=%.o))) +MAN_PAGES = $(MAN_PAGE_DIR)/piscsi.1 \ + $(MAN_PAGE_DIR)/scsictl.1 \ + $(MAN_PAGE_DIR)/scsimon.1 \ + $(MAN_PAGE_DIR)/scsiloop.1 +ifeq ($(CONNECT_TYPE), FULLSPEC) + MAN_PAGES += $(MAN_PAGE_DIR)/scsidump.1 +endif + GENERATED_DIR := generated # For the unit tests, the following functions will be "wrapped" by the linker, meaning the @@ -236,11 +244,7 @@ clean: ## * sudo systemctl start piscsi .PHONY: install install: \ - $(MAN_PAGE_DIR)/piscsi.1 \ - $(MAN_PAGE_DIR)/scsictl.1 \ - $(MAN_PAGE_DIR)/scsimon.1 \ - $(MAN_PAGE_DIR)/scsiloop.1 \ - $(MAN_PAGE_DIR)/scsidump.1 \ + $(MAN_PAGES) \ $(USR_LOCAL_BIN)/$(SCSICTL) \ $(USR_LOCAL_BIN)/$(PISCSI) \ $(USR_LOCAL_BIN)/$(SCSIMON) \ From ca7d80281bce5f455042a34bc8066ef5f5a20574 Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Thu, 2 Nov 2023 16:16:10 +0100 Subject: [PATCH 5/6] nly install scsidump binary when building for the FULLSPEC board --- cpp/Makefile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/cpp/Makefile b/cpp/Makefile index bda8df9012..5ed1278411 100644 --- a/cpp/Makefile +++ b/cpp/Makefile @@ -132,6 +132,14 @@ OBJ_SHARED := $(addprefix $(OBJDIR)/,$(notdir $(SRC_SHARED:%.cpp=%.o))) OBJ_PROTOBUF := $(addprefix $(OBJDIR)/,$(notdir $(SRC_PROTOBUF:%.cpp=%.o))) OBJ_GENERATED := $(addprefix $(OBJDIR)/,$(notdir $(SRC_GENERATED:%.cpp=%.o))) +BINARIES = $(USR_LOCAL_BIN)/$(SCSICTL) \ + $(USR_LOCAL_BIN)/$(PISCSI) \ + $(USR_LOCAL_BIN)/$(SCSIMON) \ + $(USR_LOCAL_BIN)/$(SCSILOOP) +ifeq ($(CONNECT_TYPE), FULLSPEC) + BINARIES += $(USR_LOCAL_BIN)/$(SCSIDUMP) +endif + MAN_PAGES = $(MAN_PAGE_DIR)/piscsi.1 \ $(MAN_PAGE_DIR)/scsictl.1 \ $(MAN_PAGE_DIR)/scsimon.1 \ @@ -245,11 +253,7 @@ clean: .PHONY: install install: \ $(MAN_PAGES) \ - $(USR_LOCAL_BIN)/$(SCSICTL) \ - $(USR_LOCAL_BIN)/$(PISCSI) \ - $(USR_LOCAL_BIN)/$(SCSIMON) \ - $(USR_LOCAL_BIN)/$(SCSILOOP) \ - $(USR_LOCAL_BIN)/$(SCSIDUMP) \ + $(BINARIES) \ $(SYSTEMD_CONF) \ $(RSYSLOG_CONF) \ $(RSYSLOG_LOG) From e26cf94be7984d0f4093a9a92cea5370acf8a08e Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Sat, 4 Nov 2023 22:25:36 +0100 Subject: [PATCH 6/6] Revert debug optimization back to -O0, -Og omits some information --- cpp/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/Makefile b/cpp/Makefile index 5ed1278411..c5d0b83d31 100644 --- a/cpp/Makefile +++ b/cpp/Makefile @@ -14,7 +14,7 @@ CXX = $(CROSS_COMPILE)g++ DEBUG ?= 0 ifeq ($(DEBUG), 1) # Debug compiler flags - CXXFLAGS += -Og -g -Wall -Wextra -DDEBUG + CXXFLAGS += -O0 -g -Wall -Wextra -DDEBUG else # Release compiler flags CXXFLAGS += -O3 -Wall -Werror -Wextra -DNDEBUG