From b0f2718079d799555cfc63fda8039105dd23687a Mon Sep 17 00:00:00 2001 From: Harsh4902 Date: Sun, 23 Mar 2025 06:01:00 +0530 Subject: [PATCH] fixes #130 feat: Created a Makefile Signed-off-by: Harsh4902 --- .gitignore | 2 +- Makefile | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 7d8f8ea5..26a58739 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,7 @@ *.out # Ouput of the build-binaries script -build/_output +build/dist # .DS_Store file of MacOS .DS_Store \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..ce456653 --- /dev/null +++ b/Makefile @@ -0,0 +1,25 @@ +PACKAGE=github.com/microcks/microcks-cli +CURRENT_DIR=$(shell pwd) +DIST_DIR=${CURRENT_DIR}/build/dist +CLI_NAME=microcks +BIN_NAME=microcks + +HOST_OS=$(shell go env GOOS) +HOST_ARCH=$(shell go env GOARCH) + +.PHONY: build-local +build-local: + go build -o ${DIST_DIR}/${BIN_NAME} + +.PHONY: clean +clean: + rm -rf ${CURRENT_DIR}/build/dist + +.PHONY: build-binaries +build-binaries: + make BIN_NAME=${CLI_NAME}-linux-amd64 GOOS=linux build-local + make BIN_NAME=${CLI_NAME}-linux-arm64 GOOS=linux GOARCH=arm64 build-local + make BIN_NAME=${CLI_NAME}-darwin-amd64 GOOS=darwin build-local + make BIN_NAME=${CLI_NAME}-darwin-arm64 GOOS=darwin GOARCH=arm64 build-local + make BIN_NAME=${CLI_NAME}-windows-amd64.exe GOOS=windows build-local + make BIN_NAME=${CLI_NAME}-windows-386.exe GOOS=windows GOARCH=386 build-local