2025-04-16 18:38:09 +03:00
|
|
|
# Makefile for SDS Go Bindings
|
2025-04-09 18:20:28 +03:00
|
|
|
|
2025-10-22 00:49:05 +02:00
|
|
|
# The NIM_SDS_LIB_PATH and NIM_SDS_HEADER_PATH env vars should be defined beforehand
|
|
|
|
|
export CGO_CFLAGS="-I${NIM_SDS_HEADER_PATH}/"
|
|
|
|
|
export CGO_LDFLAGS="-L${NIM_SDS_LIB_PATH}/ -lsds -Wl,-rpath,${NIM_SDS_LIB_PATH}/"
|
2025-10-20 23:29:00 +02:00
|
|
|
|
2025-04-09 18:20:28 +03:00
|
|
|
.PHONY: all clean prepare build-libsds build
|
|
|
|
|
|
|
|
|
|
# Default target
|
|
|
|
|
all: build
|
|
|
|
|
|
|
|
|
|
# Prepare third_party directory and clone nim-sds
|
|
|
|
|
prepare:
|
2025-10-23 01:15:54 +02:00
|
|
|
@echo "Preparing third_party directory..."
|
2025-08-25 17:06:04 +02:00
|
|
|
@mkdir -p ../third_party
|
2025-04-09 18:20:28 +03:00
|
|
|
|
2025-10-23 01:15:54 +02:00
|
|
|
@echo "Setting up nim-sds..."
|
|
|
|
|
@if [ ! -d "../third_party/nim-sds/.git" ]; then \
|
|
|
|
|
echo "Cloning nim-sds repository..."; \
|
|
|
|
|
git clone https://github.com/waku-org/nim-sds ../third_party/nim-sds; \
|
2025-04-09 18:20:28 +03:00
|
|
|
else \
|
|
|
|
|
echo "nim-sds repository already exists."; \
|
|
|
|
|
fi
|
|
|
|
|
|
2025-10-23 01:15:54 +02:00
|
|
|
@echo "Updating nim-sds to get vendors and compile nim in nimbus-build-system..."
|
|
|
|
|
@cd ../third_party/nim-sds && \
|
|
|
|
|
git fetch origin && \
|
|
|
|
|
git checkout master && \
|
|
|
|
|
echo "Running 'make update'..." && \
|
|
|
|
|
make update
|
|
|
|
|
|
2025-08-25 17:06:04 +02:00
|
|
|
# Build SDS Go Bindings
|
|
|
|
|
build: prepare
|
2025-04-09 18:20:28 +03:00
|
|
|
@echo "Building libsds..."
|
2025-08-25 18:02:13 +02:00
|
|
|
@cd ../third_party/nim-sds && make libsds
|
2025-08-25 17:06:04 +02:00
|
|
|
@echo "Building SDS Go Bindings..."
|
|
|
|
|
go build ./...
|
2025-04-09 18:20:28 +03:00
|
|
|
|
2025-08-25 17:06:04 +02:00
|
|
|
build-android: prepare
|
2025-08-25 17:54:46 +02:00
|
|
|
@echo "Building libsds for Android..."
|
2025-08-25 18:02:13 +02:00
|
|
|
@cd ../third_party/nim-sds && make libsds-android
|
2025-08-25 17:54:46 +02:00
|
|
|
@echo "Building SDS Go Bindings for Android..."
|
2025-04-09 18:20:28 +03:00
|
|
|
go build ./...
|
|
|
|
|
|
|
|
|
|
# Clean up generated files
|
|
|
|
|
clean:
|
|
|
|
|
@echo "Cleaning up..."
|
2025-08-25 17:06:04 +02:00
|
|
|
@rm -rf ../third_party/
|
|
|
|
|
@rm -f sds-go-bindings
|