-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (31 loc) · 1.46 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
# === Makefile Helper ===
# Styles
YELLOW=$(shell echo "\033[00;33m")
RED=$(shell echo "\033[00;31m")
RESTORE=$(shell echo "\033[0m")
.DEFAULT_GOAL := list
.PHONY: list
list:
@echo "******************************"
@echo "${YELLOW}Available targets${RESTORE}:"
@grep -E '^[a-zA-Z-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " ${YELLOW}%-15s${RESTORE} > %s\n", $$1, $$2}'
@echo "${RED}==============================${RESTORE}"
.PHONY: add-component
add-component: ## Create an empty structure for a new Component
@mkdir -p components/$(COMPONENT)
@cp -rp .github/readonly components/$(COMPONENT)/.github
@cp LICENSE components/$(COMPONENT)/LICENSE
@cp components/README.template.md components/$(COMPONENT)/README.md
@echo "Created component: ${YELLOW}$(COMPONENT)${RESTORE}"
@echo "${RED}WAIT: ${RESTORE} If not already done, you still need create the Github sub-repository and add an entry in ${YELLOW}components/manifest.json${RESTORE}"
.PHONY: add-component-compliance-files
add-component-compliance-files: ## Add the compliance files into all the component if they don't existß
@for COMPONENT in $(shell ls components); do \
if [ -d "components/$${COMPONENT}" ]; then \
rsync -uavzcC .github/readonly/ components/$${COMPONENT}/.github/; \
cp LICENSE components/$${COMPONENT}/LICENSE; \
if [ ! -f components/$${COMPONENT}/README.md ]; then \
cp components/README.template.md components/$${COMPONENT}/README.md; \
fi; \
fi; \
done