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