forked from Percona-Lab/pmm-submodules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (32 loc) · 1.55 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
.PHONY: all submodules server client clean purge test help default fb
default: help
help: ## Display this help message.
@echo "Please use \`make <target>\` where <target> is one of:"
@grep '^[a-zA-Z]' $(MAKEFILE_LIST) | \
awk -F ':.*?## ' 'NF==2 {printf " %-26s%s\n", $$1, $$2}'
all: client server ## Build client and server.
submodules: ## Update all sumodules .
git submodule update --init --remote --jobs 10
git submodule status
server: ## Build the server.
./build/bin/build-server
client: ## Build the client.
./build/bin/build-client
clean: ## Clean build results.
rm -rf tmp results sources/pmm-submodules
purge: ## Clean cache and leftovers. Please run this when starting a new feature build.
git reset --hard && git clean -xdff
git submodule update
git submodule foreach 'git reset --hard && git clean -xdff'
fb: ## Creates feature build branch.
# Usage: make fb mainBranch=PMM-2.0 featureBranch=PMM-XXXX-name submodules="pmm pmm-managed"
$(eval MAIN_BRANCH = $(or $(mainBranch),PMM-2.0))
git checkout $(MAIN_BRANCH)
make purge
git pull origin $(MAIN_BRANCH)
git checkout -b $(featureBranch)
$(foreach submodule,$(submodules),git config -f .gitmodules submodule.$(submodule).branch $(featureBranch);)
make submodules
git add .gitmodules
$(foreach submodule,$(submodules),git add sources/$(submodule);)
git commit -m "$(shell awk -F- '{print $$1 FS $$2}' <<< $(featureBranch)) Update submodules"