This repository has been archived by the owner on Jun 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
9a0e23e
commit 6e9a4be
Showing
1 changed file
with
45 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,45 @@ | ||
export CGO_ENABLED = 0 | ||
|
||
export GO111MODULE := on | ||
|
||
project_dir = $(shell pwd) | ||
builds_dir = $(shell echo $${builds_dir:-$(project_dir)/builds}) | ||
|
||
UNAME_S := $(shell uname -s) | ||
UNAME_P := $(shell uname -p) | ||
|
||
GOOS = linux | ||
ifeq ($(UNAME_S),Darwin) | ||
GOOS = darwin | ||
endif | ||
|
||
GOARCH = amd64 | ||
ifneq ($(UNAME_P),x86_64) | ||
GOARCH = 386 | ||
endif | ||
|
||
.PHONY: _build | ||
_build: | ||
@echo "=> building dockma via go build" | ||
@echo "" | ||
@builds_dir=${builds_dir} GOOS=${GOOS} GOARCH=${GOARCH} go build -o "$(builds_dir)/dockma_$(GOOS)_$(GOARCH)" cmd/dockma.go | ||
@echo "built $(builds_dir)/doctl_$(GOOS)_$(GOARCH)" | ||
|
||
.PHONY: native | ||
native: _build | ||
@echo "==> build local version" | ||
@echo "" | ||
@mv $(builds_dir)/doctl_$(GOOS)_$(GOARCH) $(builds_dir)/doctl | ||
@echo "installed as $(builds_dir)/doctl" | ||
|
||
.PHONY: clean | ||
clean: | ||
@echo "==> remove builds" | ||
@echo "" | ||
@rm -rf builds | ||
|
||
.PHONY: example | ||
example: | ||
@echo "==> test" | ||
@echo "" | ||
@echo "built $(builds_dir)/doctl_$(GOOS)_$(GOARCH)" |