From 239cfd9642607b02f39ba783d2306fc83fb1afba Mon Sep 17 00:00:00 2001 From: Thibault Martinez Date: Thu, 4 Sep 2025 11:30:45 +0200 Subject: [PATCH 1/5] chore(makefile): cleaner and less verbose output --- Makefile | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 952522c39..fc274c519 100644 --- a/Makefile +++ b/Makefile @@ -64,21 +64,21 @@ clean-all: clean ## Clean all generated files, including those ignored by Git. F .PHONY: bindings bindings: ## Build all bindings - $(MAKE) go - $(MAKE) kotlin - $(MAKE) python + @$(MAKE) go + @$(MAKE) kotlin + @$(MAKE) python .PHONY: bindings-examples bindings-examples: ## Run all bindings examples - $(MAKE) go-examples - $(MAKE) kotlin-examples - $(MAKE) python-examples + @$(MAKE) go-examples + @$(MAKE) kotlin-examples + @$(MAKE) python-examples .PHONY: bindings-example bindings-example: ## Run a specific example for all bindings. Usage: make bindings-example example - $(MAKE) go-example $(word 2,$(MAKECMDGOALS)) - $(MAKE) kotlin-example $(word 2,$(MAKECMDGOALS)) - $(MAKE) python-example $(word 2,$(MAKECMDGOALS)) + @$(MAKE) go-example $(word 2,$(MAKECMDGOALS)) + @$(MAKE) kotlin-example $(word 2,$(MAKECMDGOALS)) + @$(MAKE) python-example $(word 2,$(MAKECMDGOALS)) # Build ffi crate and detect platform define build_binding @@ -93,18 +93,21 @@ endef .PHONY: go go: ## Build Go bindings - $(build_binding) \ + @echo "Building Go bindings..." + @$(build_binding) \ uniffi-bindgen-go --library target/release/libiota_sdk_ffi$${LIB_EXT} --out-dir bindings/go --no-format .PHONY: kotlin kotlin: ## Build Kotlin bindings - $(build_binding) \ + @echo "Building Kotlin bindings..." + @$(build_binding) \ cargo run --bin iota_sdk_bindings -- generate --library "target/release/libiota_sdk_ffi$${LIB_EXT}" --language kotlin --out-dir bindings/kotlin/lib --no-format -c bindings/kotlin/uniffi.toml; \ cp target/release/libiota_sdk_ffi$${LIB_EXT} bindings/kotlin/lib/ .PHONY: python python: ## Build Python bindings - $(build_binding) \ + @echo "Building Python bindings..." + @$(build_binding) \ cargo run --bin iota_sdk_bindings -- generate --library "target/release/libiota_sdk_ffi$${LIB_EXT}" --language python --out-dir bindings/python/lib --no-format; \ cp target/release/libiota_sdk_ffi$${LIB_EXT} bindings/python/lib/ @@ -113,7 +116,7 @@ go-example: ## Run a specific Go example. Usage: make go-example example %: @true go-example: - cd bindings/go/examples; \ + @cd bindings/go/examples; \ LD_LIBRARY_PATH="../../../target/release" CGO_LDFLAGS="-liota_sdk_ffi -L../../../target/release" go run $(word 2,$(MAKECMDGOALS)).go \ cd - @@ -128,7 +131,7 @@ kotlin-example: ## Run a specific Kotlin example. Usage: make kotlin-example exa %: @true kotlin-example: - cd bindings/kotlin; \ + @cd bindings/kotlin; \ ./gradlew build clean; \ LD_LIBRARY_PATH=./lib ./gradlew example -Pexample=$(word 2,$(MAKECMDGOALS)) -q; \ cd - @@ -144,7 +147,7 @@ python-example: ## Run a specific Python example. Usage: make python-example exa %: @true python-example: - PYTHONPATH=bindings/python python3 bindings/python/examples/$(word 2,$(MAKECMDGOALS)).py + @PYTHONPATH=bindings/python python3 bindings/python/examples/$(word 2,$(MAKECMDGOALS)).py .PHONY: python-examples python-examples: ## Run all Python bindings examples From 62306f8245d054f5709c8ed0119b03a6fc637c21 Mon Sep 17 00:00:00 2001 From: Thibault Martinez Date: Thu, 4 Sep 2025 11:43:30 +0200 Subject: [PATCH 2/5] log examples being run --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index d1c70faab..90f7f9bfd 100644 --- a/Makefile +++ b/Makefile @@ -116,6 +116,7 @@ go-example: ## Run a specific Go example. Usage: make go-example example %: @true go-example: + @echo "\nRunning Go example: $(word 2,$(MAKECMDGOALS))" @cd bindings/go/examples; \ LD_LIBRARY_PATH="../../../target/release" CGO_LDFLAGS="-liota_sdk_ffi -L../../../target/release" go run $(word 2,$(MAKECMDGOALS)).go \ cd - @@ -131,6 +132,7 @@ kotlin-example: ## Run a specific Kotlin example. Usage: make kotlin-example exa %: @true kotlin-example: + @echo "\nRunning Kotlin example: $(word 2,$(MAKECMDGOALS))" @cd bindings/kotlin; \ ./gradlew build clean; \ LD_LIBRARY_PATH=./lib ./gradlew example -Pexample=$(word 2,$(MAKECMDGOALS)) -q; \ @@ -147,6 +149,7 @@ python-example: ## Run a specific Python example. Usage: make python-example exa %: @true python-example: + @echo "\nRunning Python example: $(word 2,$(MAKECMDGOALS))" @PYTHONPATH=bindings/python python3 bindings/python/examples/$(word 2,$(MAKECMDGOALS)).py .PHONY: python-examples From 32096fa323022d51bad3bf2064653ad48b88d811 Mon Sep 17 00:00:00 2001 From: Thibault Martinez Date: Thu, 4 Sep 2025 11:44:36 +0200 Subject: [PATCH 3/5] nit --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 90f7f9bfd..f301f8084 100644 --- a/Makefile +++ b/Makefile @@ -116,7 +116,7 @@ go-example: ## Run a specific Go example. Usage: make go-example example %: @true go-example: - @echo "\nRunning Go example: $(word 2,$(MAKECMDGOALS))" + @echo "\nRunning Go example \"$(word 2,$(MAKECMDGOALS))\"" @cd bindings/go/examples; \ LD_LIBRARY_PATH="../../../target/release" CGO_LDFLAGS="-liota_sdk_ffi -L../../../target/release" go run $(word 2,$(MAKECMDGOALS)).go \ cd - @@ -132,7 +132,7 @@ kotlin-example: ## Run a specific Kotlin example. Usage: make kotlin-example exa %: @true kotlin-example: - @echo "\nRunning Kotlin example: $(word 2,$(MAKECMDGOALS))" + @echo "\nRunning Kotlin example \"$(word 2,$(MAKECMDGOALS))\"" @cd bindings/kotlin; \ ./gradlew build clean; \ LD_LIBRARY_PATH=./lib ./gradlew example -Pexample=$(word 2,$(MAKECMDGOALS)) -q; \ @@ -149,7 +149,7 @@ python-example: ## Run a specific Python example. Usage: make python-example exa %: @true python-example: - @echo "\nRunning Python example: $(word 2,$(MAKECMDGOALS))" + @echo "\nRunning Python example \"$(word 2,$(MAKECMDGOALS))\"" @PYTHONPATH=bindings/python python3 bindings/python/examples/$(word 2,$(MAKECMDGOALS)).py .PHONY: python-examples From 14b95b9aa189214134893dd98e4968f0c8a94612 Mon Sep 17 00:00:00 2001 From: /alex/ Date: Fri, 5 Sep 2025 13:16:32 +0200 Subject: [PATCH 4/5] use printf instead of echo --- Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index f2aa68bdb..c011f9419 100644 --- a/Makefile +++ b/Makefile @@ -93,20 +93,20 @@ endef .PHONY: go go: ## Build Go bindings - @echo "Building Go bindings..." + @printf "Building Go bindings...\n" @$(build_binding) \ uniffi-bindgen-go --library target/release/libiota_sdk_ffi$${LIB_EXT} --out-dir bindings/go --no-format || exit $$? .PHONY: kotlin kotlin: ## Build Kotlin bindings - @echo "Building Kotlin bindings..." + @printf "Building Kotlin bindings...\n" @$(build_binding) \ cargo run --bin iota_sdk_bindings -- generate --library "target/release/libiota_sdk_ffi$${LIB_EXT}" --language kotlin --out-dir bindings/kotlin/lib --no-format -c bindings/kotlin/uniffi.toml || exit $$?; \ cp target/release/libiota_sdk_ffi$${LIB_EXT} bindings/kotlin/lib/ .PHONY: python python: ## Build Python bindings - @echo "Building Python bindings..." + @printf "Building Python bindings...\n" @$(build_binding) \ cargo run --bin iota_sdk_bindings -- generate --library "target/release/libiota_sdk_ffi$${LIB_EXT}" --language python --out-dir bindings/python/lib --no-format || exit $$?; \ cp target/release/libiota_sdk_ffi$${LIB_EXT} bindings/python/lib/ @@ -116,7 +116,7 @@ go-example: ## Run a specific Go example. Usage: make go-example example %: @true go-example: - @echo "\nRunning Go example \"$(word 2,$(MAKECMDGOALS))\"" + @printf "\nRunning Go example \"$(word 2,$(MAKECMDGOALS))\"" @cd bindings/go/examples; \ LD_LIBRARY_PATH="../../../target/release" CGO_LDFLAGS="-liota_sdk_ffi -L../../../target/release" go run $(word 2,$(MAKECMDGOALS)).go || exit $$?; \ cd - @@ -132,7 +132,7 @@ kotlin-example: ## Run a specific Kotlin example. Usage: make kotlin-example exa %: @true kotlin-example: - @echo "\nRunning Kotlin example \"$(word 2,$(MAKECMDGOALS))\"" + @printf "\nRunning Kotlin example \"$(word 2,$(MAKECMDGOALS))\"" @cd bindings/kotlin; \ ./gradlew build clean || exit $$?; \ LD_LIBRARY_PATH=./lib ./gradlew example -Pexample=$(word 2,$(MAKECMDGOALS)) -q || exit $$?; \ @@ -149,7 +149,7 @@ python-example: ## Run a specific Python example. Usage: make python-example exa %: @true python-example: - @echo "\nRunning Python example \"$(word 2,$(MAKECMDGOALS))\"" + @printf "\nRunning Python example \"$(word 2,$(MAKECMDGOALS))\"" @PYTHONPATH=bindings/python python3 bindings/python/examples/$(word 2,$(MAKECMDGOALS)).py|| exit $$?; .PHONY: python-examples @@ -160,5 +160,5 @@ python-examples: ## Run all Python bindings examples .PHONY: help help: ## Show this help - @echo "Available targets:" + @printf "Available targets:\n" @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) From cd9ea8b74a34320c5657cfafd847ee109e8796a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thoralf=20M=C3=BCller?= Date: Fri, 5 Sep 2025 14:14:04 +0200 Subject: [PATCH 5/5] add newline after example name --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c011f9419..70ef96927 100644 --- a/Makefile +++ b/Makefile @@ -116,7 +116,7 @@ go-example: ## Run a specific Go example. Usage: make go-example example %: @true go-example: - @printf "\nRunning Go example \"$(word 2,$(MAKECMDGOALS))\"" + @printf "\nRunning Go example \"$(word 2,$(MAKECMDGOALS))\"\n" @cd bindings/go/examples; \ LD_LIBRARY_PATH="../../../target/release" CGO_LDFLAGS="-liota_sdk_ffi -L../../../target/release" go run $(word 2,$(MAKECMDGOALS)).go || exit $$?; \ cd - @@ -132,7 +132,7 @@ kotlin-example: ## Run a specific Kotlin example. Usage: make kotlin-example exa %: @true kotlin-example: - @printf "\nRunning Kotlin example \"$(word 2,$(MAKECMDGOALS))\"" + @printf "\nRunning Kotlin example \"$(word 2,$(MAKECMDGOALS))" \n \" @cd bindings/kotlin; \ ./gradlew build clean || exit $$?; \ LD_LIBRARY_PATH=./lib ./gradlew example -Pexample=$(word 2,$(MAKECMDGOALS)) -q || exit $$?; \ @@ -149,7 +149,7 @@ python-example: ## Run a specific Python example. Usage: make python-example exa %: @true python-example: - @printf "\nRunning Python example \"$(word 2,$(MAKECMDGOALS))\"" + @printf "\nRunning Python example \"$(word 2,$(MAKECMDGOALS))\"\n" @PYTHONPATH=bindings/python python3 bindings/python/examples/$(word 2,$(MAKECMDGOALS)).py|| exit $$?; .PHONY: python-examples