22 lines
405 B
Makefile
22 lines
405 B
Makefile
SWAG := $(shell go env GOPATH)/bin/swag
|
|
|
|
.PHONY: run build build-linux test tidy swag
|
|
|
|
run:
|
|
go run ./cmd/server
|
|
|
|
build: swag
|
|
go build -o bin/server ./cmd/server
|
|
|
|
build-linux: swag
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o bin/server-linux ./cmd/server
|
|
|
|
test:
|
|
go test ./...
|
|
|
|
tidy:
|
|
go mod tidy
|
|
|
|
swag:
|
|
$(SWAG) init -g cmd/server/main.go -o docs --parseDependency --parseGoList
|