generated from yamadharma/course-directory-student-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
26 lines (20 loc) · 980 Bytes
/
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
COURSE =
.PHONY: all clean
all: help
help:
@echo 'Usage:'
@echo ' make <target>'
@echo
@echo 'Targets:'
@grep -E '^[a-zA-Z_0-9.-]+:.*?##.*$$' $(MAKEFILE_LIST) | grep -v '###' | sort | cut -d: -f1- | awk 'BEGIN {FS = ":.*?##"}; {printf " \033[36m%-30s\033[0m %s\n", $$1, $$2}'
@grep -E '^###.*' $(MAKEFILE_LIST) | cut -d' ' -f2- | awk 'BEGIN {FS = "###"}; {printf "%s\n", $$1, $$2}'
@grep -E '^[a-zA-Z_0-9.-]+:.*?###.*$$' $(MAKEFILE_LIST) | sort | cut -d: -f2- | awk 'BEGIN {FS = ":.*?###"}; {printf " \033[36m%-30s\033[0m %s\n", $$1, $$2}'
@echo
list: ## List of courses
@./config/script/list-courses
prepare: ## Generate directories structure
@./config/script/prepare
@touch prepare
submodule: ## Update submules
git submodule update --init --recursive
git submodule foreach 'git fetch origin; git checkout $$(git rev-parse --abbrev-ref HEAD); git reset --hard origin/$$(git rev-parse --abbrev-ref HEAD); git submodule update --recursive; git clean -dfx'