-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile.mtsx
More file actions
170 lines (153 loc) · 5.8 KB
/
Copy pathmakefile.mtsx
File metadata and controls
170 lines (153 loc) · 5.8 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
// Makefile Syntax Highlighting for MT Manager
// Supports GNU Make syntax
// Author: MT-Syntax Team
// GitHub: https://github.com/MT-Syntax/makefile
// License: MIT License (https://github.com/MT-Syntax/makefile/blob/main/LICENSE)
{
name: ["Makefile", "Makefile", "makefile", "GNUmakefile", ".mk", ".make"]
comment: {startsWith: "#", addToContains: false}
bracketPairs: ["{}", "[]", "()"]
styles: [
"target" , #C77B2E, #E8BF6A
"directive" > "keyword", @B
"varDef" , #594DEE, #6ECB8A
"varRef" , #E65100, #64B5F6
"autoVar" > "constant"
"function" > "namespace"
"assignment" , #C02020, #FF6060
"special" > "keyword2"
"recipePrefix" > "meta"
"shellOperator", #B06020, #D09050
"escape" > "strEscape"
"todo" , #C08000, #FFD700, @B
]
defines: [
"function-names": keywordsToRegex(
"subst patsubst strip findstring filter-out filter sort"
"wordlist words firstword lastword word notdir dir suffix"
"basename addsuffix addprefix join wildcard realpath abspath"
"error warning info origin flavor foreach if or and call"
"eval file value shell intcmp let"
)
"special-target-names": keywordsToRegex(
"PHONY SUFFIXES DEFAULT PRECIOUS INTERMEDIATE"
"SECONDARY SECONDEXPANSION DELETE_ON_ERROR IGNORE"
"LOW_RESOLUTION_TIME SILENT EXPORT_ALL_VARIABLES"
"NOTPARALLEL ONESHELL POSIX WAIT"
)
"automatic-variables": [
{match: /\$\([\@\<\^\?\*\+\|\%][DF]\)/, 0: "autoVar"}
{match: /\$[\@\<\^\?\*\+\|\%]/, 0: "autoVar"}
]
"variable-references": [
{include: "automatic-variables"}
{match: /\$[\(\{][A-Za-z_][\w.-]*[\)\}]/, 0: "varRef"}
{match: /\$[A-Za-z_]/, 0: "varRef"}
]
"shell-variables": [
{match: /\$\$[\(\{][A-Za-z_][\w.-]*[\)\}]/, 0: "varRef"}
{match: /\$\$[A-Za-z_][\w.-]*/, 0: "varRef"}
]
"make-functions": [
{
start: {match: /\$\(/ + include("function-names") + /\s/}
end: {match: /\)/}
style: "function"
contains: [
{include: "variable-references"}
{include: "make-functions"}
]
}
]
"string-literals": [
{
start: {match: /"/}
end: {match: /(?m)"|$/}
style: "string"
contains: [
{include: "shell-variables"}
{include: "variable-references"}
{match: /\\./, 0: "escape"}
]
}
{
start: {match: /'/}
end: {match: /(?m)'|$/}
style: "string"
}
]
"#definition.variables": [
{include: "automatic-variables"}
{include: "shell-variables"}
{
start: {match: /\$\([A-Za-z_][\w.-]*:/}
end: {match: /\)/}
style: "varRef"
contains: [
{include: "variable-references"}
{match: /=/, 0: "assignment"}
]
}
{include: "variable-references"}
{
match: /(?m)(?<=^)([A-Za-z_][\w.-]*)(\s*(?:::=|\?=|\+=|!=|:=|=))/
1: "varDef"
2: "assignment"
}
]
"#definition.directives": [
{
start: {match: /(?m)(?<=^\s*)(?:override\s+)?define\s+(\S+)/, 1: "varDef"}
end: {match: /(?m)(?<=^\s*)endef\b/}
style: "directive"
contains: [
{include: "variable-references"}
{include: "make-functions"}
]
}
{match: /(?m)(?<=^\s*)(ifeq|ifneq)(?=\s*\()/, 0: "directive"}
{match: /(?m)(?<=^\s*)(ifdef|ifndef)\s+(\S+)/, 1: "directive", 2: "varRef"}
{match: /(?m)(?<=^\s*)(else|endif)\b/, 0: "directive"}
{match: /(?m)(?<=^\s*)(-include|sinclude|include)\b/, 0: "directive"}
{match: /(?m)(?<=^\s*)(export|unexport)\s+([A-Za-z_][\w.-]*)/, 1: "directive", 2: "varRef"}
{match: /(?m)(?<=^\s*)(export|unexport)\b/, 0: "directive"}
{match: /(?m)(?<=^\s*)(override|vpath|private)\b/, 0: "directive"}
{match: /(?m)(?<=^\s*)(undefine)\s+(\S+)/, 1: "directive", 2: "varRef"}
]
"#definition.targets": [
{match: /(?m)(?<=^)\./ + include("special-target-names") + /(?=\s*:)/, 0: "special"}
{match: /&&|\|\|/, 0: "shellOperator"}
{
match: /(?m)(?<=^)([^#\t\n][^#=\n]*?)(::?)(?=\s|$)/
1: "target"
2: "assignment"
}
{match: /(?m)(?<=^\t)([@\-\+])/, 0: "recipePrefix"}
{match: /%/, 0: "special"}
]
"#definition.comments": {
start: {match: /#/}
end: {match: /(?m)$/}
style: "comment"
contains: [
{match: keywordsToRegex("TODO FIXME XXX NOTE BUG HACK"), 0: "todo"}
]
}
"#definition.literals": [
{include: "string-literals"}
{match: /\\\n/, 0: "escape"}
{number: "10|16|F|E"}
]
"#definition.functions": [
{include: "make-functions"}
]
]
contains: [
{include: "#definition.comments"}
{include: "#definition.literals"}
{include: "#definition.functions"}
{include: "#definition.variables"}
{include: "#definition.directives"}
{include: "#definition.targets"}
]
}