Skip to contentSkip to conversation

kirk: install only if sources are present

PATCH In review Andrea Cervesato 2 participants 2 messages Nov 10, 2025

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 kirk: install only if sources are present

From: Andrea Cervesato <[email protected]>

Fix kirk Makefile, so source code is copied during install process only if it's present.

Fixes 4db20e7d79 ("kirk: move kirk source code inside tools/kirk/kirk-src")

---
Changes in v2:
- git submodule --init if we are inside the folder or during make check
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 tools/kirk/Makefile | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
tools/kirk/Makefile +13 -3
index 1a09c43ce..10c45789c 100644
@@ -8,15 +8,25 @@ top_srcdir		?= ../..
 include $(top_srcdir)/include/mk/env_pre.mk
 
 BASE_DIR		:= $(abspath $(DESTDIR)/$(prefix))
+KIRK_SRC		?= kirk-src
+
+$(KIRK_SRC)/Makefile:
+ifeq ($(KIRK_SRC),sparse-src)
+	git submodule update --init
+else
+	$(error "Can't find $(KIRK_SRC)/Makefile")
+endif
 
 install:
+ifneq ($(wildcard $(abs_srcdir)/kirk-src/libkirk/*.py),)
 	mkdir -p $(BASE_DIR)/libkirk
 	mkdir -p $(BASE_DIR)/libkirk/channels
 
-	install -m 00644 $(top_srcdir)/tools/kirk/kirk-src/libkirk/*.py $(BASE_DIR)/libkirk
-	install -m 00644 $(top_srcdir)/tools/kirk/kirk-src/libkirk/channels/*.py $(BASE_DIR)/libkirk/channels
-	install -m 00775 $(top_srcdir)/tools/kirk/kirk-src/kirk $(BASE_DIR)/kirk
+	install -m 00644 $(abs_srcdir)/kirk-src/libkirk/*.py $(BASE_DIR)/libkirk
+	install -m 00644 $(abs_srcdir)/kirk-src/libkirk/channels/*.py $(BASE_DIR)/libkirk/channels
+	install -m 00775 $(abs_srcdir)/kirk-src/kirk $(BASE_DIR)/kirk
 
 	cd $(BASE_DIR) && ln -sf kirk runltp-ng
+endif
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk

---
base-commit: 9cde2740ccc86c464cc16862b74d1cb885e4220e
change-id: 20251110-kirk_makefile_install_fix-421196bbf687

Best regards,

Signature · 5 lines
Andrea Cervesato <[email protected]>


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

Hi Andrea,

Quoted 4 lines

Fix kirk Makefile, so source code is copied during install process only if it's present.

Fixes 4db20e7d79 ("kirk: move kirk source code inside tools/kirk/kirk-src")

+1, thank you.

Quoted 15 lines

---
Changes in v2:
- git submodule --init if we are inside the folder or during make check
- Link to v1: https://lore.kernel.org/r/[email protected]

---
 tools/kirk/Makefile | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
tools/kirk/Makefile +0 -0
index 1a09c43ce..10c45789c 100644

tools/kirk/Makefile top_srcdir ?= ../.. · line 11

Quoted 4 lines
tools/kirk/Makefile +1 -0
@@ -8,15 +8,25 @@ top_srcdir		?= ../..
 include $(top_srcdir)/include/mk/env_pre.mk
 
 BASE_DIR		:= $(abspath $(DESTDIR)/$(prefix))
+KIRK_SRC		?= kirk-src

Is it really useful to have directory optional? (I'm not sure this is useful for sparse).

tools/kirk/Makefile top_srcdir ?= ../.. · line 15

Quoted 4 lines
tools/kirk/Makefile +4 -0
+
+$(KIRK_SRC)/Makefile:
+ifeq ($(KIRK_SRC),sparse-src)
+	git submodule update --init

This will always run "git submodule update --init" even on top level make install. This requires "make install" to have internet connection. Therefore I would prefer to skip kirk on top level "make install".

-FILTER_OUT_DIRS += sparse
+FILTER_OUT_DIRS += kirk sparse

And what is the difference? I see slightly better having:
'cd tools/kirk && make && make install' than 'git submodule init tools/ltx/ltx-src' or
'git submodule update --init'.

If you don't agree, I'm not against the first version.

Kind regards,
Petr

Quoted 18 lines
tools/kirk/Makefile +8 -3
+else
+	$(error "Can't find $(KIRK_SRC)/Makefile")
+endif
 
 install:
+ifneq ($(wildcard $(abs_srcdir)/kirk-src/libkirk/*.py),)
 	mkdir -p $(BASE_DIR)/libkirk
 	mkdir -p $(BASE_DIR)/libkirk/channels
 
-	install -m 00644 $(top_srcdir)/tools/kirk/kirk-src/libkirk/*.py $(BASE_DIR)/libkirk
-	install -m 00644 $(top_srcdir)/tools/kirk/kirk-src/libkirk/channels/*.py $(BASE_DIR)/libkirk/channels
-	install -m 00775 $(top_srcdir)/tools/kirk/kirk-src/kirk $(BASE_DIR)/kirk
+	install -m 00644 $(abs_srcdir)/kirk-src/libkirk/*.py $(BASE_DIR)/libkirk
+	install -m 00644 $(abs_srcdir)/kirk-src/libkirk/channels/*.py $(BASE_DIR)/libkirk/channels
+	install -m 00775 $(abs_srcdir)/kirk-src/kirk $(BASE_DIR)/kirk
 
 	cd $(BASE_DIR) && ln -sf kirk runltp-ng
+endif
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp