-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (40 loc) · 1.42 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
# c: chapter缩写,表示章节编号
c=0
# e: exercise缩写,表示每个章节下的练习区编号
e=0
t=false
shell=/bin/bash
executable=./run-executable-darwin-arm64-go
default:
@command -v g++ > /dev/null
@if [[ $$? != 0 ]]; then\
echo "Sorry, please install g++ at first";\
echo "Suggestion: ";\
echo "";\
echo "MacOS: brew install g++ or install Xcode from App Store";\
echo "Linux: sudo apt-get install g++ or yum install g++";\
echo "Windows: get more information from the Internet";\
echo "";\
fi
@echo "\nrun 'make help' so that you can get more information\n"
help:
@echo "Welcome to use Step Cplusplus\n"
@echo "Usage:"
@echo " make <command> [arguments]\n\r"
@echo "commands:"
@echo ""
@echo " run c=<chapterID> e=<exerciseID>"
@echo " if you ignore c, c will be 0.So does e."
@echo " example: "
@echo " - make run c=1 e=3"
@echo " compile and run the cpps in 1-variable/exercise-3"
@echo ""
@echo " - make run c=0 e=0"
@echo " compile and run the cpps in 0-notes/"
@echo ""
@echo " - make run"
@echo " just like running make run c=0 e=0"
@echo "\n"
@echo " help show this message"
run:
@${executable} --chapter ${c} --exercise ${e} --showtime=${t}