Skip to content

Commit

Permalink
feat(makefile): add Makefile for goenv project
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitcharolia committed Jan 26, 2024
1 parent c441085 commit 8631ab8
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Makefile
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 ./...

0 comments on commit 8631ab8

Please sign in to comment.