-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
30 lines (26 loc) · 853 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
.PHONY: build
BIN_DIR := $(shell pwd)/bin
GO_BUILD_TAGS := -tags origin
GOOS := $(shell go env GOOS)
TARGET := github.com/dxfeed/dxfeed-graal-go-api/cmd/tools
define GO_BUILD_CMD
@echo "Building for $(1)..."
go build $(GO_BUILD_TAGS) -v ./...
GOBIN=$(BIN_DIR) go install $(GO_BUILD_TAGS) $(TARGET)
endef
define GO_BUILD_CMD_MACOS
@echo "Building for $(1)..."
CGO_LDFLAGS_ALLOW=-Wl,-rpath,@executable_path/ go build $(GO_BUILD_TAGS) -v ./...
GOBIN=$(BIN_DIR) CGO_LDFLAGS_ALLOW=-Wl,-rpath,@executable_path/ go install $(GO_BUILD_TAGS) $(TARGET)
codesign -f -s - $(BIN_DIR)/*
endef
# Main build target
build:
ifeq ($(GOOS),windows)
$(call GO_BUILD_CMD,windows)
else ifeq ($(GOOS),linux)
$(call GO_BUILD_CMD,linux)
else ifeq ($(GOOS),darwin)
$(call GO_BUILD_CMD_MACOS,macOS)
endif
cp internal/native/graal/*DxFeedGraalNativeSdk.* $(BIN_DIR)/