Skip to content

Commit 3dd812b

Browse files
committed
Define BIN_NAME for windows
1 parent 3f60ad5 commit 3dd812b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,19 @@ else
1212
CGO_LDFLAGS := -L$(LIBS_DIR) -lcodex -Wl,-rpath,$(LIBS_DIR)
1313
endif
1414

15+
ifeq ($(OS),windows)
16+
BIN_NAME := example.exe
17+
else
18+
BIN_NAME := example
19+
endif
20+
1521
# Configuration for fetching the right binary
1622
OS ?= "linux"
1723
ARCH ?= "amd64"
1824
VERSION ?= "v0.0.16"
1925
LATEST_URL := "https://github.com/codex-storage/codex-go-bindings/releases/latest/download/codex-${OS}-${ARCH}.zip"
2026
VERSIONED_URL := "https://github.com/codex-storage/codex-go-bindings/releases/download/$(VERSION)/codex-${OS}-${ARCH}.zip"
2127

22-
# Just for the example
23-
BIN=example
24-
2528
all: run
2629

2730
fetch:
@@ -34,8 +37,8 @@ build:
3437
CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" go build -o $(BIN) main.go
3538

3639
run:
37-
./example
40+
./$(BIN_NAME)
3841

3942
clean:
40-
rm -f $(BIN)
43+
rm -f $(BIN_NAME)
4144
rm -Rf $(LIBS_DIR)/*

0 commit comments

Comments
 (0)