Igor Sirotin 4fd33b6121
refactor: adopt golang-standards/project-layout (#111)
* refactor: adopt golang-standards/project-layout

Move the legacy kernel wrapper `waku/*` to `pkg/kernel/*` and rename its
package `waku` -> `kernel`; nothing outside the package imported it, so this is
a mechanical import-path/prefix change. Update the relocated Makefile's
relative dep path, the legacy CI workflows (CI/endurance/repeated) build paths,
README, and .gitignore accordingly (preserving the libwaku-cache CI from #109).

Add scaffolding for the upcoming Messaging API work: `internal/ffi` (cgo
bridge), `pkg/messaging` (high-level Node API), and `examples/`. Document
`pkg/kernel` as legacy until logos-delivery#3851 consolidates the C libraries.

Also stop tracking the accidentally-committed `waku-bindings` build artifact
and gitignore the kernel build output.

No behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore: cleanup

* fix: repair references to removed utils package

nwaku_test_utils.go now uses pkg/kernel/utils.GetRSSKB; the memory_record
tool is self-contained (local helpers, missing mutex restored).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-10 10:13:55 +01:00

69 lines
2.2 KiB
Makefile

# Makefile for Waku Go Bindings
# Path to logos-delivery submodule
export LOGOS_DELIVERY_DIR ?= $(shell pwd)/../../vendor/logos-delivery
# Debugging output
print-paths:
@echo "LOGOS_DELIVERY_DIR: $(LOGOS_DELIVERY_DIR)"
@echo "HEADER_PATH: $(LIBWAKU_HEADER_PATH)"
@echo "LIB_PATH: $(LIBWAKU_LIB_PATH)"
# Default paths for libwaku library and headers (can be overridden)
export LIBWAKU_HEADER_PATH ?= $(LOGOS_DELIVERY_DIR)/library
export LIBWAKU_LIB_PATH ?= $(LOGOS_DELIVERY_DIR)/build
export CGO_CFLAGS := -I$(LIBWAKU_HEADER_PATH)/
export CGO_LDFLAGS := -L$(LIBWAKU_LIB_PATH)/ -lwaku -Wl,-rpath,$(LIBWAKU_LIB_PATH)/
# Expected files
HEADER_FILE := $(LIBWAKU_HEADER_PATH)/libwaku.h
LIB_FILES := $(wildcard $(LIBWAKU_LIB_PATH)/libwaku.*)
.PHONY: all clean prepare build test build-auto test-auto build-libwaku
# Validate necessary folders and files
check-folders:
@echo Checking libwaku header directory ...
@if [ -z "$(LIBWAKU_HEADER_PATH)" ]; then \
echo "ERROR: LIBWAKU_HEADER_PATH not set"; exit 1; \
fi
@if [ ! -d "$(LIBWAKU_HEADER_PATH)" ]; then \
echo "ERROR: Header path does not exist: $(LIBWAKU_HEADER_PATH)"; exit 1; \
fi
@echo Checking libwaku lib directory ...
@if [ -z "$(LIBWAKU_LIB_PATH)" ]; then \
echo "ERROR: LIBWAKU_LIB_PATH not set"; exit 1; \
fi
@if [ ! -d "$(LIBWAKU_LIB_PATH)" ]; then \
echo "ERROR: Library path does not exist: $(LIBWAKU_LIB_PATH)"; exit 1; \
fi
@echo Checking for libwaku.h ...
@if [ ! -f "$(HEADER_FILE)" ]; then \
echo "ERROR: libwaku.h not found at: $(HEADER_FILE)"; exit 1; \
fi
@echo Checking for libwaku library file ...
@if [ -z "$(LIB_FILES)" ]; then \
echo "ERROR: No libwaku library file found in: $(LIBWAKU_LIB_PATH)"; exit 1; \
fi
build:
@echo "Building Logos Messaging Go Bindings (manual)..."
CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go build -o kernel-bindings .
test: build
@echo "Running tests (manual)..."
@if [ -z "$(TEST)" ]; then \
CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go test .; \
else \
CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go test . -count=1 -run $(TEST) -v; \
fi
# Clean up generated files
clean:
@echo "Cleaning up..."
@rm -f kernel-bindings