github.com/polarismesh/polaris@v1.17.8/Makefile (about) 1 # Tencent is pleased to support the open source community by making Polaris available. 2 # 3 # Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. 4 # 5 # Licensed under the BSD 3-Clause License (the "License"); 6 # you may not use this file except in compliance with the License. 7 # You may obtain a copy of the License at 8 # 9 # https://opensource.org/licenses/BSD-3-Clause 10 # 11 # Unless required by applicable law or agreed to in writing, software distributed 12 # under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 13 # CONDITIONS OF ANY KIND, either express or implied. See the License for the 14 # specific language governing permissions and limitations under the License. 15 16 # VERSION defines the project version for the build. 17 # Update this value when you upgrade the version file of your project. 18 # To re-generate a bundle for another specific version without changing the standard setup, you can: 19 # - use the VERSION as arg of the build target (e.g make build VERSION=0.0.2) 20 # - use environment variables to overwrite this value (e.g export VERSION=0.0.2) 21 VERSION ?= $(shell cat version 2>/dev/null) 22 23 # IMAGE_TAG defines the image tag for the docker build. 24 # To re-generate a bundle for another specific version without changing the standard setup, you can: 25 # - use the IMAGE_TAG as arg of the build-docker target (e.g make build-docker IMAGE_TAG=v0.0.2) 26 # - use environment variables to overwrite this value (e.g export IMAGE_TAG=v0.0.2) 27 IMAGE_TAG ?= $(VERSION) 28 29 ARCH ?= "amd64" 30 31 all: build 32 33 ##@ General 34 35 # The help target prints out all targets with their descriptions organized 36 # beneath their categories. The categories are represented by '##@' and the 37 # target descriptions by '##'. The awk commands is responsible for reading the 38 # entire set of makefiles included in this invocation, looking for lines of the 39 # file as xyz: ## something, and then pretty-format the target and help. Then, 40 # if there's a line with ##@ something, that gets pretty-printed as a category. 41 # More info on the usage of ANSI control characters for terminal formatting: 42 # https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters 43 # More info on the awk command: 44 # http://linuxcommand.org/lc3_adv_awk.php 45 46 help: ## Display this help. 47 @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) 48 49 50 ##@ Build 51 52 .PHONY: build 53 build: ## Build binary and tarball. 54 bash ./release/build.sh $(VERSION) $(ARCH) 55 56 .PHONY: build-docker 57 build-docker: ## Build polaris-server docker images. 58 bash ./release/build_docker.sh $(IMAGE_TAG) 59 60 .PHONY: clean 61 clean: ## Clean polaris-server make data. 62 @rm -rf polaris-server-release_* 63 @rm -rf polaris-server-arm64 64 @rm -rf polaris-server-amd64