-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(makefile): add Makefile for goenv project
- Loading branch information
1 parent
c441085
commit 8631ab8
Showing
1 changed file
with
25 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
BIN_NAME := goenv | ||
PKG := github.com/ankitcharolia/goenv | ||
GOFILES := $(shell go list -f '{{range .GoFiles}}{{.}} {{end}}' ./...) | ||
|
||
build: bin/$(BIN_NAME) | ||
|
||
bin/$(BIN_NAME): $(GOFILES) | ||
go build -o $@ $(PKG) | ||
|
||
build-cross: clean | ||
GOOS=linux GOARCH=amd64 go build -o dist/$(BIN_NAME)_amd64_linux $(PKG) | ||
GOOS=linux GOARCH=arm64 go build -o dist/$(BIN_NAME)_arm64_linux $(PKG) | ||
GOOS=linux GOARCH=arm go build -o dist/$(BIN_NAME)_arm_linux $(PKG) | ||
GOOS=darwin GOARCH=amd64 go build -o dist/$(BIN_NAME)_amd64_darwin $(PKG) | ||
GOOS=darwin GOARCH=arm64 go build -o dist/$(BIN_NAME)_arm64_darwin $(PKG) | ||
|
||
clean: | ||
rm -rf bin dist | ||
|
||
deps: | ||
go get -t ./... | ||
go mod tidy | ||
|
||
# test: | ||
# go test -race -v ./... |