-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMakefile
92 lines (75 loc) · 2.49 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Tencent is pleased to support the open source community by making TKEStack
# available.
#
# Copyright (C) 2012-2019 Tencent. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at
#
# https://opensource.org/licenses/Apache-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
.PHONY: all
all: test build
# ==============================================================================
# Build options
ROOT_PACKAGE=tkestack.io/lb-controlling-framework
VERSION_PACKAGE=tkestack.io/lb-controlling-framework/pkg/version
# ==============================================================================
# Includes
include build/lib/common.mk
include build/lib/golang.mk
include build/lib/image.mk
include build/lib/gen.mk
# ==============================================================================
# Usage
define USAGE_OPTIONS
Options:
DEBUG Whether to generate debug symbols. Default is 0.
IMAGES Backend images to make. All by default.
PLATFORMS The platform to build. Default is host platform and arch.
BINS The binaries to build. Default is all of cmd.
VERSION The version information compiled into binaries.
The default is obtained from git.
V Set to 1 enable verbose build. Default is 0.
endef
export USAGE_OPTIONS
# ==============================================================================
# Targets
## gen: Generate codes for API definitions.
.PHONY: gen
gen:
@$(MAKE) gen.run
## build: Build source code for host platform.
.PHONY: build
build:
@$(MAKE) go.build
## build.all: Build source code for all platforms.
.PHONY: build.all
build.all:
@$(MAKE) go.build.all
## image: Build docker images.
.PHONY: image
image:
@$(MAKE) image.build
## push: Build docker images and push to registry.
.PHONY: push
push:
@$(MAKE) image.push
## lint: Check syntax and styling of go sources.
.PHONY: lint
lint:
@$(MAKE) go.lint
## test: Run unit test.
.PHONY: test
test:
@$(MAKE) go.test
.PHONY: help
help: Makefile
@echo -e "\nUsage: make <TARGETS> <OPTIONS> ...\n\nTargets:"
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@echo "$$USAGE_OPTIONS"