2025-04-16 18:38:09 +03:00
|
|
|
# Makefile for SDS Go Bindings
|
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:
|
|
|
|
|
@echo "Creating third_party directory..."
|
2025-08-25 17:06:04 +02:00
|
|
|
@mkdir -p ../third_party
|
2025-04-09 18:20:28 +03:00
|
|
|
|
2025-08-25 17:06:04 +02:00
|
|
|
@if [ ! -d "../third_party/nim-sds" ]; then \
|
2025-10-15 19:12:05 +02:00
|
|
|
@echo "Cloning nim-sds repository..."
|
2025-08-25 17:06:04 +02:00
|
|
|
cd ../third_party/ && \
|
2025-08-25 18:02:13 +02:00
|
|
|
git clone https://github.com/waku-org/nim-sds && \
|
|
|
|
|
cd nim-sds && \
|
2025-09-22 16:06:15 +02:00
|
|
|
git checkout master; \
|
2025-08-25 18:02:13 +02:00
|
|
|
make update; \
|
2025-04-09 18:20:28 +03:00
|
|
|
else \
|
|
|
|
|
echo "nim-sds repository already exists."; \
|
|
|
|
|
fi
|
|
|
|
|
|
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
|