-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
rockset-mongo | ||
dump | ||
state.json | ||
bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
BINARY=rockset-mongo | ||
VERSION=0.0.1 | ||
BUILD=`git rev-parse HEAD` | ||
PLATFORMS=darwin linux windows | ||
ARCHITECTURES=amd64 arm64 | ||
|
||
# Setup linker flags option for build that interoperate with variable names in src code | ||
LDFLAGS=-ldflags "-X main.VersionStr=${VERSION} -X main.GitCommit=${BUILD}" | ||
|
||
default: build | ||
|
||
all: clean build_all | ||
|
||
build: | ||
go build ${LDFLAGS} -o ${BINARY} | ||
|
||
build_all: | ||
mkdir -p bin | ||
$(foreach GOOS, $(PLATFORMS),\ | ||
$(foreach GOARCH, $(ARCHITECTURES), $(shell export GOOS=$(GOOS); export GOARCH=$(GOARCH); go build $(LDFLAGS) -o bin/$(BINARY)-$(GOOS)-$(GOARCH)-$(VERSION) .))) | ||
|
||
clean: | ||
go clean | ||
rm -rf bin | ||
|
||
.PHONY: check clean install build_all all |