From 7c3562737c377af51134fdec00c9dbd608cf8d6b Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Tue, 5 Aug 2025 15:38:08 +0200 Subject: [PATCH] Makefile added with new status and init concept --- .gitmodules | 3 -- Makefile | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++ journaliser | 2 +- loggy | 2 +- mqtt_sniffer | 2 +- nemo | 1 - netst | 2 +- ptpython | 2 +- pyrip | 2 +- starter | 2 +- 10 files changed, 86 insertions(+), 11 deletions(-) create mode 100644 Makefile delete mode 160000 nemo diff --git a/.gitmodules b/.gitmodules index 7a8d1d5..672efcd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,9 +4,6 @@ [submodule "starter"] path = starter url = https://git.mount-mockery.de/dirk/starter.git -[submodule "nemo"] - path = nemo - url = https://git.mount-mockery.de/dirk/nemo.git [submodule "loggy"] path = loggy url = https://git.mount-mockery.de/application/loggy.git diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a9a208a --- /dev/null +++ b/Makefile @@ -0,0 +1,79 @@ +# Version 1.1 (2025-08-05) +default: help + +.ONESHELL: +SHELL = /usr/bin/bash +.SILENT: + +GIT_FLAG = ./.git +VENV_FLAG = ./.venv_required +VENV_FOLDER = ./venv +INIT_FILE = ./init + +help: + echo "Possible options are: init, status, venv_flag, clean, cleanall" + +init: print_head + # Init git repo + if [[ -e $(GIT_FLAG) ]]; then + git submodule init + git submodule update + fi + # Create venv if needed + if [[ -e $(VENV_FLAG) ]]; then + if [[ ! -e $(VENV_FOLDER) ]]; then + mkvenv + fi + fi + if [[ -x $(INIT_FILE) ]]; then + $(INIT_FILE) + fi + +initall: + for subdir in $$(find . -maxdepth 2 -mindepth 2 -name Makefile | sort); do + $(MAKE) --no-print-directory -C $$(dirname $$subdir) init + done + +status: print_head + giti + echo "Submodules:" + echo "-----------" + git submodule --quiet foreach giti + +statusall: + for subdir in $$(find . -maxdepth 2 -mindepth 2 -name Makefile | sort); do + $(MAKE) --no-print-directory -C $$(dirname $$subdir) status + done + +clean: + if [[ ! -e $(VENV_FLAG) ]]; then + if [[ -d $(VENV_FOLDER) ]]; then + rm -rf $(VENV_FOLDER) + fi + fi + +cleanall: clean + for subdir in $$(find . -maxdepth 2 -mindepth 2 -name Makefile | sort); do + $(MAKE) --no-print-directory -C $$(dirname $$subdir) cleanall + done + + +venv_flag: + if [[ ! -e $(VENV_FLAG) ]]; then + touch $(VENV_FLAG) + if [[ -e $(GIT_FLAG) ]]; then + git add $(VENV_FLAG) + fi + fi + +print_head: + DIRNAME=$$(basename $$(pwd)) + DIRLENGTH=$${#DIRNAME} + echo -ne "\n\n\033[1;34m╔═" + for i in $$(seq 1 $$DIRLENGTH); do echo -n "═"; done + echo -e "═╗" + echo -e "║ $$DIRNAME ║" + echo -ne "╚═" + for i in $$(seq 1 $$DIRLENGTH); do echo -n "═"; done + echo -e "═╝\033[00m" + diff --git a/journaliser b/journaliser index d2f1d1d..d6ead58 160000 --- a/journaliser +++ b/journaliser @@ -1 +1 @@ -Subproject commit d2f1d1d0e1523a43c28742e9c1570b784ee6e01a +Subproject commit d6ead58012f892f4457f8f8fe68d1dcb837363f5 diff --git a/loggy b/loggy index c10d891..38f8e67 160000 --- a/loggy +++ b/loggy @@ -1 +1 @@ -Subproject commit c10d8911ce479b1dfd7415244f7993076f9add87 +Subproject commit 38f8e67c627c5213716959634c6a1769d613596e diff --git a/mqtt_sniffer b/mqtt_sniffer index fa7c63f..967894f 160000 --- a/mqtt_sniffer +++ b/mqtt_sniffer @@ -1 +1 @@ -Subproject commit fa7c63f74b2e9b29d895970b53ae24044a8a14ce +Subproject commit 967894f32f9b150b7e7a9b75c2950b9cb3929edc diff --git a/nemo b/nemo deleted file mode 160000 index 6f43baa..0000000 --- a/nemo +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6f43baa745ee0eeb7bf2caf894d6fc410d0330a3 diff --git a/netst b/netst index ce50842..5875c90 160000 --- a/netst +++ b/netst @@ -1 +1 @@ -Subproject commit ce50842e3b7b42a51678923fd3bd8fb8d4560e35 +Subproject commit 5875c90998b1b7202764520e1dd62bc1f8d1ef59 diff --git a/ptpython b/ptpython index d540958..dd45f65 160000 --- a/ptpython +++ b/ptpython @@ -1 +1 @@ -Subproject commit d540958e7efb8b88597efd130bc91ed0219c3dcb +Subproject commit dd45f657ae496ab84e4169f8c6c254097607d7a0 diff --git a/pyrip b/pyrip index 91d40d7..7165e74 160000 --- a/pyrip +++ b/pyrip @@ -1 +1 @@ -Subproject commit 91d40d7eaf07fbc7269cdfee30a62e37c37b696c +Subproject commit 7165e74a00823a1756f9938e8b45ec8109236948 diff --git a/starter b/starter index 13a4afc..64a1e13 160000 --- a/starter +++ b/starter @@ -1 +1 @@ -Subproject commit 13a4afc3c73ddd87b474228583205b307d1aa439 +Subproject commit 64a1e13d6486954c23814c31bf0524f43b834ea6