@@ -0,0 +1,170 @@
1+[
2+ "("
3+ ")"
4+ "{"
5+ "}"
6+] @punctuation.bracket
7+
8+[
9+ ":"
10+ "&:"
11+ "::"
12+ "|"
13+ ";"
14+ "\""
15+ "'"
16+ ","
17+] @punctuation.delimiter
18+
19+[
20+ "$"
21+ "$$"
22+] @punctuation.special
23+
24+(automatic_variable
25+ [ "@" "%" "<" "?" "^" "+" "/" "*" "D" "F"] @punctuation.special)
26+
27+(automatic_variable
28+ "/" @error . ["D" "F"])
29+
30+[
31+ "="
32+ ":="
33+ "::="
34+ "?="
35+ "+="
36+ "!="
37+ "@"
38+ "-"
39+ "+"
40+] @operator
41+
42+[
43+ (text)
44+ (string)
45+ (raw_text)
46+] @string
47+
48+(variable_assignment (word) @string)
49+
50+[
51+ "ifeq"
52+ "ifneq"
53+ "ifdef"
54+ "ifndef"
55+ "else"
56+ "endif"
57+ "if"
58+ "or" ; boolean functions are conditional in make grammar
59+ "and"
60+] @keyword.control.conditional
61+
62+"foreach" @keyword.control.repeat
63+
64+[
65+ "define"
66+ "endef"
67+ "vpath"
68+ "undefine"
69+ "export"
70+ "unexport"
71+ "override"
72+ "private"
73+; "load"
74+] @keyword
75+
76+[
77+ "include"
78+ "sinclude"
79+ "-include"
80+] @keyword.control.import
81+
82+[
83+ "subst"
84+ "patsubst"
85+ "strip"
86+ "findstring"
87+ "filter"
88+ "filter-out"
89+ "sort"
90+ "word"
91+ "words"
92+ "wordlist"
93+ "firstword"
94+ "lastword"
95+ "dir"
96+ "notdir"
97+ "suffix"
98+ "basename"
99+ "addsuffix"
100+ "addprefix"
101+ "join"
102+ "wildcard"
103+ "realpath"
104+ "abspath"
105+ "call"
106+ "eval"
107+ "file"
108+ "value"
109+ "shell"
110+] @keyword.function
111+
112+[
113+ "error"
114+ "warning"
115+ "info"
116+] @keyword.control.exception
117+
118+;; Variable
119+(variable_assignment
120+ name: (word) @variable)
121+
122+(variable_reference
123+ (word) @variable)
124+
125+(comment) @comment
126+
127+((word) @clean @string.regexp
128+ (#match? @clean "[%\*\?]"))
129+
130+(function_call
131+ function: "error"
132+ (arguments (text) @error))
133+
134+(function_call
135+ function: "warning"
136+ (arguments (text) @warning))
137+
138+(function_call
139+ function: "info"
140+ (arguments (text) @info))
141+
142+;; Install Command Categories
143+;; Others special variables
144+;; Variables Used by Implicit Rules
145+[
146+ "VPATH"
147+ ".RECIPEPREFIX"
148+] @constant.builtin
149+
150+(variable_assignment
151+ name: (word) @clean @constant.builtin
152+ (#match? @clean "^(AR|AS|CC|CXX|CPP|FC|M2C|PC|CO|GET|LEX|YACC|LINT|MAKEINFO|TEX|TEXI2DVI|WEAVE|CWEAVE|TANGLE|CTANGLE|RM|ARFLAGS|ASFLAGS|CFLAGS|CXXFLAGS|COFLAGS|CPPFLAGS|FFLAGS|GFLAGS|LDFLAGS|LDLIBS|LFLAGS|YFLAGS|PFLAGS|RFLAGS|LINTFLAGS|PRE_INSTALL|POST_INSTALL|NORMAL_INSTALL|PRE_UNINSTALL|POST_UNINSTALL|NORMAL_UNINSTALL|MAKEFILE_LIST|MAKE_RESTARTS|MAKE_TERMOUT|MAKE_TERMERR|\.DEFAULT_GOAL|\.RECIPEPREFIX|\.EXTRA_PREREQS)$"))
153+
154+(variable_reference
155+ (word) @clean @constant.builtin
156+ (#match? @clean "^(AR|AS|CC|CXX|CPP|FC|M2C|PC|CO|GET|LEX|YACC|LINT|MAKEINFO|TEX|TEXI2DVI|WEAVE|CWEAVE|TANGLE|CTANGLE|RM|ARFLAGS|ASFLAGS|CFLAGS|CXXFLAGS|COFLAGS|CPPFLAGS|FFLAGS|GFLAGS|LDFLAGS|LDLIBS|LFLAGS|YFLAGS|PFLAGS|RFLAGS|LINTFLAGS|PRE_INSTALL|POST_INSTALL|NORMAL_INSTALL|PRE_UNINSTALL|POST_UNINSTALL|NORMAL_UNINSTALL|MAKEFILE_LIST|MAKE_RESTARTS|MAKE_TERMOUT|MAKE_TERMERR|\.DEFAULT_GOAL|\.RECIPEPREFIX|\.EXTRA_PREREQS\.VARIABLES|\.FEATURES|\.INCLUDE_DIRS|\.LOADED)$"))
157+
158+;; Standart targets
159+(targets
160+ (word) @constant.macro
161+ (#match? @constant.macro "^(all|install|install-html|install-dvi|install-pdf|install-ps|uninstall|install-strip|clean|distclean|mostlyclean|maintainer-clean|TAGS|info|dvi|html|pdf|ps|dist|check|installcheck|installdirs)$"))
162+
163+(targets
164+ (word) @constant.macro
165+ (#match? @constant.macro "^(all|install|install-html|install-dvi|install-pdf|install-ps|uninstall|install-strip|clean|distclean|mostlyclean|maintainer-clean|TAGS|info|dvi|html|pdf|ps|dist|check|installcheck|installdirs)$"))
166+
167+;; Builtin targets
168+(targets
169+ (word) @constant.macro
170+ (#match? @constant.macro "^\.(PHONY|SUFFIXES|DEFAULT|PRECIOUS|INTERMEDIATE|SECONDARY|SECONDEXPANSION|DELETE_ON_ERROR|IGNORE|LOW_RESOLUTION_TIME|SILENT|EXPORT_ALL_VARIABLES|NOTPARALLEL|ONESHELL|POSIX)$"))