-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for mcs build to trim gopaths (#60)
also remove `version` sub-command as we don't use this anymore, just use `mcs --version`
- Loading branch information
1 parent
e197399
commit adcbf61
Showing
3 changed files
with
16 additions
and
44 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 |
---|---|---|
@@ -1,23 +1,33 @@ | ||
PWD := $(shell pwd) | ||
GOPATH := $(shell go env GOPATH) | ||
|
||
default: mcs | ||
|
||
.PHONY: mcs | ||
mcs: | ||
@echo "Building mcs binary to './mcs'" | ||
@(CGO_ENABLED=0 go build --tags=kqueue --ldflags "-s -w" -o mcs ./cmd/mcs) | ||
@(CGO_ENABLED=0 go build -trimpath --tags=kqueue --ldflags "-s -w" -o mcs ./cmd/mcs) | ||
|
||
install: mcs | ||
@echo "Installing mcs binary to '$(GOPATH)/bin/mcs'" | ||
@mkdir -p $(GOPATH)/bin && cp -f $(PWD)/mcs $(GOPATH)/bin/mcs | ||
@echo "Installation successful. To learn more, try \"mcs --help\"." | ||
|
||
swagger-gen: | ||
@echo "Generating swagger server code from yaml" | ||
@swagger generate server -A mcs --main-package=mcs --exclude-main -P models.Principal -f ./swagger.yml -r NOTICE | ||
|
||
build: | ||
assets: | ||
@(cd portal-ui; yarn install; make build-static; cd ..) | ||
@(CGO_ENABLED=0 go build --tags kqueue --ldflags "-s -w" -o mcs ./cmd/mcs) | ||
|
||
test: | ||
@(go test ./restapi -v) | ||
@(go test -race -v github.com/minio/mcs/restapi/...) | ||
|
||
coverage: | ||
@(go test ./restapi -v -coverprofile=coverage.out && go tool cover -html=coverage.out && open coverage.html) | ||
@(go test -v -coverprofile=coverage.out github.com/minio/mcs/restapi/... && go tool cover -html=coverage.out && open coverage.html) | ||
|
||
clean: | ||
@echo "Cleaning up all the generated files" | ||
@find . -name '*.test' | xargs rm -fv | ||
@find . -name '*~' | xargs rm -fv | ||
@rm -vf mcs |
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
This file was deleted.
Oops, something went wrong.