-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
99 lines (74 loc) · 2.19 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#需要注意的是,我们在每个target内使用制表符而不是空格是非常重要的。复制和粘贴内容时尤其如此。如果我们添加空格而不是制表符,我们将收到错误消息;
#log
NOCOLOR=\033[0m
RED=\033[0;31m
GREEN=\033[0;32m
ORANGE=\033[0;33m
BLUE=\033[0;34m
PURPLE=\033[0;35m
CYAN=\033[0;36m
LIGHTGRAY=\033[0;37m
DARKGRAY=\033[1;30m
LIGHTRED=\033[1;31m
LIGHTGREEN=\033[1;32m
YELLOW=\033[33m
LIGHTBLUE=\033[1;34m
LIGHTPURPLE=\033[1;35m
LIGHTCYAN=\033[1;36m
WHITE=\033[1;37m
#define echo_blue
# @echo "${BLUE} $$(date +"%Y-%m-%d %H:%M:%S %z") $@: $(1)"
#endef
define echo_color
@echo "$1 $$(date +"%Y-%m-%d %H:%M:%S %z") $@: $2"
endef
define echo_blue
$(call echo_color, ${BLUE}, $1)
endef
define echo_yellow
$(call echo_color, ${YELLOW}, $1)
endef
define echo_green
$(call echo_color, ${GREEN}, $1)
endef
define echo_red
$(call echo_color, ${RED}, $1)
endef
PROJECT_NAME = SwiftTemplet
SCHEME_NAME = SwiftTemplet
#.PHONY
.PHONY: all
all: podinstall xcodebuild
.PHONY: help
help: ## This help dialog.
@IFS=$$'\n' ; \
help_lines=(`fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//'`); \
for help_line in $${help_lines[@]}; do \
IFS=$$'#' ; \
help_split=($$help_line) ; \
help_command=`echo $${help_split[0]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \
help_info=`echo $${help_split[2]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \
printf "%-30s %s\n" $$help_command $$help_info ; \
done
.PHONY: podinstall
podinstall: ## podinstall
@echo "\033[32m >>> pod install..."
pod install
.PHONY: xcodebuild
xcodebuild: ## xcodebuild
@echo "\033[32m >>> xcodebuild..."
xcodebuild -project $(PROJECT_NAME).xcodeproj -scheme $(SCHEME_NAME) -destination 'platform=iOS Simulator,name=iPhone 12 Pro,OS=15.0'
.PHONY: path
path: ## path
@echo "\033[32m >>> path..."
echo `pwd`
.PHONY: test
test: ## test
# @echo "\033[34m >>> test..."
# @echo "${BLUE} >>> this is a test .PHONY target"
# @echo "--- ${username}"
# echo -e "The first five colors of the rainbow are ${RED}red ${ORANGE}orange ${YELLOW}yellow ${GREEN}green ${NOCOLOR}and ${BLUE}blue${NOCOLOR}"
$(call echo_blue, __ this is a test log.)
$(call echo_green, __ this is a test log.)
$(call echo_yellow, __ this is a test log.)
$(call echo_red, __ this is a test log.)