generated from yamadharma/course-directory-student-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
28 lines (22 loc) · 815 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
27
28
COURSE =
.PHONY: all clean
#ifndef COURSE
#$(error "Usage: make COURSE=<course_name>")
#else
#include config/course/$(COURSE)
#endif
all: prepare
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