mirror of
https://github.com/logos-messaging/logos-messaging-go-bindings.git
synced 2026-01-04 06:53:11 +00:00
waku/Makefile now assumes lib already exists
This commit is contained in:
parent
3d5e8e550b
commit
5ec2ab11de
@ -1,30 +1,53 @@
|
|||||||
# Makefile for Waku Go Bindings
|
# Makefile for Waku Go Bindings
|
||||||
|
|
||||||
# Directories
|
# The LIBWAKU_LIB_PATH and LIBWAKU_HEADER_PATH env vars should be defined beforehand
|
||||||
THIRD_PARTY_DIR := $(shell pwd)/../third_party
|
# Therefore, we assume the libwaku library and headers are located in the specified paths
|
||||||
NWAKU_REPO := https://github.com/waku-org/nwaku
|
export CGO_CFLAGS="-I${LIBWAKU_HEADER_PATH}/"
|
||||||
NWAKU_DIR := $(THIRD_PARTY_DIR)/nwaku
|
export CGO_LDFLAGS="-L${LIBWAKU_LIB_PATH}/ -lsds -Wl,-rpath,${LIBWAKU_LIB_PATH}/"
|
||||||
|
|
||||||
.PHONY: all clean build-libwaku build
|
# Expected files
|
||||||
|
HEADER_FILE := $(LIBWAKU_HEADER_PATH)/libwaku.h
|
||||||
|
LIB_FILES := $(wildcard $(LIBWAKU_LIB_PATH)/libwaku.*)
|
||||||
|
|
||||||
|
.PHONY: all clean prepare build
|
||||||
|
|
||||||
# Default target
|
# Default target
|
||||||
all: build
|
all: build
|
||||||
|
|
||||||
# Build libwaku
|
# Validate necessary folders and files
|
||||||
build-libwaku:
|
check-folders:
|
||||||
@echo "Building libwaku..."
|
@echo Checking libwaku header directory ...
|
||||||
@cd $(NWAKU_DIR) && make libwaku
|
@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
|
||||||
|
|
||||||
# Build Waku Go Bindings
|
@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
|
||||||
|
|
||||||
build: export CGO_CFLAGS = "-I${NWAKU_DIR}/library/"
|
@echo Checking for libwaku.h ...
|
||||||
build: export CGO_LDFLAGS = "-L${NWAKU_DIR}/build/ -lwaku -L${NWAKU_DIR} -Wl,-rpath,${NWAKU_DIR}/build/"
|
@if [ ! -f "$(HEADER_FILE)" ]; then \
|
||||||
build:
|
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 SDS Go Bindings
|
||||||
|
build: check-folders
|
||||||
@echo "Building Waku Go Bindings..."
|
@echo "Building Waku Go Bindings..."
|
||||||
go build ./...
|
go build ./...
|
||||||
|
|
||||||
# Clean up generated files
|
# Clean up generated files
|
||||||
clean:
|
clean:
|
||||||
@echo "Cleaning up..."
|
@echo "Cleaning up..."
|
||||||
@rm -rf $(THIRD_PARTY_DIR)
|
@rm -f waku-go-bindings
|
||||||
@rm -f waku-go-bindings
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user