🔧 Improve Makefile

This commit is contained in:
M. Mert Yildiran 2022-12-02 05:39:47 +03:00
parent 17baad57a6
commit 8954626547
No known key found for this signature in database
GPG Key ID: DA5D6DCBB758A461
2 changed files with 6 additions and 9 deletions

View File

@ -14,18 +14,15 @@ export VER?=0.0
help: ## This help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
install:
go install kubeshark.go
build-debug: ## Build kubeshark CLI for debug
build-debug: ## Build kubeshark CLI for debuging.
export GCLFAGS='-gcflags="all=-N -l"'
${MAKE} build-base
build:
build: ## Build kubeshark CLI.
export LDFLAGS_EXT='-s -w'
${MAKE} build-base
build-base: ## Build kubeshark CLI binary (select platform via GOOS / GOARCH env variables).
build-base: ## Build kubeshark CLI binary (select the platform via GOOS / GOARCH env variables).
go build ${GCLFAGS} -ldflags="${LDFLAGS_EXT} \
-X 'github.com/kubeshark/kubeshark/kubeshark.GitCommitHash=$(COMMIT_HASH)' \
-X 'github.com/kubeshark/kubeshark/kubeshark.Branch=$(GIT_BRANCH)' \
@ -35,7 +32,7 @@ build-base: ## Build kubeshark CLI binary (select platform via GOOS / GOARCH env
-o bin/kubeshark_$(SUFFIX) kubeshark.go && \
cd bin && shasum -a 256 kubeshark_${SUFFIX} > kubeshark_${SUFFIX}.sha256
build-all: ## Build for all supported platforms.
build-all: ## Build kubeshark CLI for all supported platforms.
echo "Compiling for every OS and Platform" && \
mkdir -p bin && sed s/_VER_/$(VER)/g RELEASE.md.TEMPLATE > bin/README.md && \
$(MAKE) build GOOS=linux GOARCH=amd64 && \
@ -54,5 +51,5 @@ clean: ## Clean all build artifacts.
test: ## Run cli tests.
@go test ./... -coverpkg=./... -race -coverprofile=coverage.out -covermode=atomic
lint: ## Run linter
lint: ## Lint the source code.
golangci-lint run

View File

@ -46,7 +46,7 @@ Kubeshark uses a ~45MB pre-compiled executable binary to communicate with the Ku
sh <(curl -Ls https://kubeshark.co/install)
```
- Compile it from source using `make cli` command.
- Compile it from source using `make` command then use `./bin/kubeshark__` executable.
## Run