Skip to content

Commit db134e3

Browse files
committed
Created a Makefile
Signed-off-by: Harsh4902 <harshparmar4902@gmail.com>
1 parent 1a3de0f commit db134e3

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*.out
1313

1414
# Ouput of the build-binaries script
15-
build/_output
15+
build/dist
1616

1717
# .DS_Store file of MacOS
1818
.DS_Store

Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
PACKAGE=github.com/microcks/microcks-cli
2+
CURRENT_DIR=$(shell pwd)
3+
DIST_DIR=${CURRENT_DIR}/build/dist
4+
CLI_NAME=microcks
5+
BIN_NAME=microcks
6+
7+
HOST_OS=$(shell go env GOOS)
8+
HOST_ARCH=$(shell go env GOARCH)
9+
10+
.PHONY: build-local
11+
build-local:
12+
go build -o ${DIST_DIR}/${BIN_NAME}
13+
14+
.PHONY: clean
15+
clean:
16+
rm -rf ${CURRENT_DIR}/build/dist
17+
18+
.PHONY: build-binaries
19+
build-binaries:
20+
make BIN_NAME=${CLI_NAME}-linux-amd64 GOOS=linux build-local
21+
make BIN_NAME=${CLI_NAME}-linux-arm64 GOOS=linux GOARCH=arm64 build-local
22+
make BIN_NAME=${CLI_NAME}-darwin-amd64 GOOS=darwin build-local
23+
make BIN_NAME=${CLI_NAME}-darwin-arm64 GOOS=darwin GOARCH=arm64 build-local
24+
make BIN_NAME=${CLI_NAME}-windows-amd64.exe GOOS=windows build-local
25+
make BIN_NAME=${CLI_NAME}-windows-386.exe GOOS=windows GOARCH=386 build-local

0 commit comments

Comments
 (0)