mirror of
https://github.com/logos-storage/logos-storage-go-bindings-example.git
synced 2026-01-07 16:03:11 +00:00
Define BIN_NAME for windows
This commit is contained in:
parent
3f60ad501b
commit
3dd812b407
13
Makefile
13
Makefile
@ -12,6 +12,12 @@ else
|
|||||||
CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,$(LIBS_DIR)
|
CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,$(LIBS_DIR)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(OS),windows)
|
||||||
|
BIN_NAME := example.exe
|
||||||
|
else
|
||||||
|
BIN_NAME := example
|
||||||
|
endif
|
||||||
|
|
||||||
# Configuration for fetching the right binary
|
# Configuration for fetching the right binary
|
||||||
OS ?= "linux"
|
OS ?= "linux"
|
||||||
ARCH ?= "amd64"
|
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"
|
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"
|
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
|
all: run
|
||||||
|
|
||||||
fetch:
|
fetch:
|
||||||
@ -34,8 +37,8 @@ build:
|
|||||||
CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go build -o $(BIN) main.go
|
CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go build -o $(BIN) main.go
|
||||||
|
|
||||||
run:
|
run:
|
||||||
./example
|
./$(BIN_NAME)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(BIN)
|
rm -f $(BIN_NAME)
|
||||||
rm -Rf $(LIBS_DIR)/*
|
rm -Rf $(LIBS_DIR)/*
|
||||||
Loading…
x
Reference in New Issue
Block a user