mirror of https://github.com/rocboss/paopao-ce
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.0 KiB
34 lines
1.0 KiB
.PHONY: all build run clean fmt help
|
|
BUILD_VERSION := $(shell cat version)
|
|
BUILD_DATE := $(shell date +'%Y-%m-%d %H:%M:%S')
|
|
SHA_SHORT := $(shell git rev-parse --short HEAD)
|
|
TAGS = ""
|
|
all: fmt build
|
|
build:
|
|
@go mod download
|
|
@echo Build paopao-ce
|
|
bash build.sh paopao-ce
|
|
run:
|
|
@go run -tags '$(TAGS)' -ldflags "-X 'main.version=${BUILD_VERSION}' -X 'main.buildDate=${BUILD_DATE}' -X 'main.commitID=${SHA_SHORT}'" .
|
|
clean:
|
|
@go clean
|
|
@find ./dist -type f -exec rm -r {} +
|
|
@find ./tmp -type f -exec rm -r {} +
|
|
fmt:
|
|
@echo Formatting...
|
|
@go fmt ./global/...
|
|
@go fmt ./internal/...
|
|
@go fmt ./pkg/...
|
|
@go vet -composites=false ./global/...
|
|
@go vet -composites=false ./internal/...
|
|
@go vet -composites=false ./pkg/...
|
|
help:
|
|
@echo "make: make"
|
|
@echo "make run: start api server"
|
|
@echo "make build: build executables"
|
|
@echo "make build: build executables"
|
|
@echo "make run TAGS='embed': start api server and serve embed web frontend"
|
|
@echo "make build TAGS='embed': build executables with embed web frontend"
|
|
.EXPORT_ALL_VARIABLES:
|
|
GO111MODULE = on
|