From 02c9a6afa63eddd16cb0fcdd07fabc335572dc0a Mon Sep 17 00:00:00 2001 From: darshankabariya Date: Sat, 20 Dec 2025 01:11:10 +0530 Subject: [PATCH] chore: update accordings to rename --- .gitmodules | 2 +- waku/Makefile | 30 ++++++++++++++++++------------ waku/nwaku.go | 3 +++ 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/.gitmodules b/.gitmodules index 9a9f5e7..7b76ddf 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "third_party/nwaku"] - path = third_party/nwaku + path = vendor/nwaku url = https://github.com/logos-messaging/logos-messaging-nim.git diff --git a/waku/Makefile b/waku/Makefile index 343d87b..e33fe63 100644 --- a/waku/Makefile +++ b/waku/Makefile @@ -1,7 +1,7 @@ # Makefile for Waku Go Bindings # Path to logos-messaging-nim (nwaku) submodule -LMN_DIR ?= $(shell pwd)/../third_party/nwaku +LMN_DIR ?= $(shell pwd)/../vendor/logos-messaging-nim/ # Default paths for libwaku library and headers (can be overridden) LIBWAKU_HEADER_PATH ?= $(LMN_DIR)/library @@ -14,10 +14,7 @@ export CGO_LDFLAGS := -L$(LIBWAKU_LIB_PATH)/ -lwaku -Wl,-rpath,$(LIBWAKU_LIB_PAT HEADER_FILE := $(LIBWAKU_HEADER_PATH)/libwaku.h LIB_FILES := $(wildcard $(LIBWAKU_LIB_PATH)/libwaku.*) -.PHONY: all clean prepare build build-libwaku - -# Default target -all: build +.PHONY: all clean prepare build build-auto build-manual test-auto test-manual build-libwaku # Validate necessary folders and files check-folders: @@ -47,13 +44,6 @@ check-folders: echo "ERROR: No libwaku library file found in: $(LIBWAKU_LIB_PATH)"; exit 1; \ fi -# Build SDS Go Bindings -build: build-libwaku - @echo "Building Waku Go Bindings..." - go build ./waku - -# Build libwaku from the nwaku submodule -# Build libwaku once (clone if needed). Skips work when headers & libs already exist. build-libwaku: @echo "Checking/Building libwaku ..." @if [ -f "$(HEADER_FILE)" ] && [ -n "$(LIB_FILES)" ]; then \ @@ -68,6 +58,22 @@ build-libwaku: $(MAKE) -C $(LMN_DIR) libwaku; \ fi +build-auto: build-libwaku check-folders + @echo "Building Waku Go Bindings (auto)..." + go build ./ + +build-manual: build-libwaku check-folders + @echo "Building Waku Go Bindings (manual)..." + go build ./waku + +test-auto: build-auto + @echo "Running tests (auto)..." + go test ./ + +test-manual: build-manual + @echo "Running tests (manual)..." + go test ./waku + # Clean up generated files clean: @echo "Cleaning up..." diff --git a/waku/nwaku.go b/waku/nwaku.go index 212cd09..a8545bf 100644 --- a/waku/nwaku.go +++ b/waku/nwaku.go @@ -1,6 +1,9 @@ package waku /* +#cgo CFLAGS: -I${SRCDIR}/../vendor/nwaku/library +#cgo LDFLAGS: -L${SRCDIR}/../vendor/nwaku/build -lwaku -Wl,-rpath,${SRCDIR}/../vendor/nwaku/build + #include #include #include