From 3dd812b407fa03536c82c32b53d4bf25a570b9a8 Mon Sep 17 00:00:00 2001 From: Arnaud Date: Wed, 15 Oct 2025 08:24:14 +0200 Subject: [PATCH] Define BIN_NAME for windows --- Makefile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 24999cc..7871efe 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,12 @@ else CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,$(LIBS_DIR) endif +ifeq ($(OS),windows) + BIN_NAME := example.exe +else + BIN_NAME := example +endif + # Configuration for fetching the right binary OS ?= "linux" ARCH ?= "amd64" @@ -19,9 +25,6 @@ VERSION ?= "v0.0.16" LATEST_URL := "https://github.com/codex-storage/codex-go-bindings/releases/latest/download/codex-${OS}-${ARCH}.zip" VERSIONED_URL := "https://github.com/codex-storage/codex-go-bindings/releases/download/$(VERSION)/codex-${OS}-${ARCH}.zip" -# Just for the example -BIN=example - all: run fetch: @@ -34,8 +37,8 @@ build: CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go build -o $(BIN) main.go run: - ./example + ./$(BIN_NAME) clean: - rm -f $(BIN) + rm -f $(BIN_NAME) rm -Rf $(LIBS_DIR)/* \ No newline at end of file