| 1 | { |
| 2 | "fileTypes": [ |
| 3 | "Makefile", |
| 4 | "makefile", |
| 5 | "GNUmakefile", |
| 6 | "OCamlMakefile" |
| 7 | ], |
| 8 | "name": "Makefile", |
| 9 | "patterns": [ |
| 10 | { |
| 11 | "include": "#comment" |
| 12 | }, |
| 13 | { |
| 14 | "include": "#variable-assignment" |
| 15 | }, |
| 16 | { |
| 17 | "include": "#recipe" |
| 18 | }, |
| 19 | { |
| 20 | "include": "#directives" |
| 21 | } |
| 22 | ], |
| 23 | "repository": { |
| 24 | "comment": { |
| 25 | "begin": "(^[ \\t]+)?(?=#)", |
| 26 | "beginCaptures": { |
| 27 | "1": { |
| 28 | "name": "punctuation.whitespace.comment.leading.makefile" |
| 29 | } |
| 30 | }, |
| 31 | "end": "(?!\\G)", |
| 32 | "patterns": [ |
| 33 | { |
| 34 | "begin": "#", |
| 35 | "beginCaptures": { |
| 36 | "0": { |
| 37 | "name": "punctuation.definition.comment.makefile" |
| 38 | } |
| 39 | }, |
| 40 | "end": "\\n", |
| 41 | "name": "comment.line.number-sign.makefile", |
| 42 | "patterns": [ |
| 43 | { |
| 44 | "match": "\\\\\\n", |
| 45 | "name": "constant.character.escape.continuation.makefile" |
| 46 | } |
| 47 | ] |
| 48 | } |
| 49 | ] |
| 50 | }, |
| 51 | "directives": { |
| 52 | "patterns": [ |
| 53 | { |
| 54 | "begin": "^[ ]*([s\\-]?include)\\b", |
| 55 | "beginCaptures": { |
| 56 | "1": { |
| 57 | "name": "keyword.control.include.makefile" |
| 58 | } |
| 59 | }, |
| 60 | "end": "^", |
| 61 | "patterns": [ |
| 62 | { |
| 63 | "include": "#comment" |
| 64 | }, |
| 65 | { |
| 66 | "include": "#variables" |
| 67 | }, |
| 68 | { |
| 69 | "match": "%", |
| 70 | "name": "constant.other.placeholder.makefile" |
| 71 | } |
| 72 | ] |
| 73 | }, |
| 74 | { |
| 75 | "begin": "^[ ]*(vpath)\\b", |
| 76 | "beginCaptures": { |
| 77 | "1": { |
| 78 | "name": "keyword.control.vpath.makefile" |
| 79 | } |
| 80 | }, |
| 81 | "end": "^", |
| 82 | "patterns": [ |
| 83 | { |
| 84 | "include": "#comment" |
| 85 | }, |
| 86 | { |
| 87 | "include": "#variables" |
| 88 | }, |
| 89 | { |
| 90 | "match": "%", |
| 91 | "name": "constant.other.placeholder.makefile" |
| 92 | } |
| 93 | ] |
| 94 | }, |
| 95 | { |
| 96 | "begin": "^(?:(override)\\s*)?(define)\\s*([^\\s]+)\\s*(=|\\?=|:=|\\+=)?(?=\\s)", |
| 97 | "captures": { |
| 98 | "1": { |
| 99 | "name": "keyword.control.override.makefile" |
| 100 | }, |
| 101 | "2": { |
| 102 | "name": "keyword.control.define.makefile" |
| 103 | }, |
| 104 | "3": { |
| 105 | "name": "variable.other.makefile" |
| 106 | }, |
| 107 | "4": { |
| 108 | "name": "punctuation.separator.key-value.makefile" |
| 109 | } |
| 110 | }, |
| 111 | "end": "^(endef)\\b", |
| 112 | "name": "meta.scope.conditional.makefile", |
| 113 | "patterns": [ |
| 114 | { |
| 115 | "begin": "\\G(?!\\n)", |
| 116 | "end": "^", |
| 117 | "patterns": [ |
| 118 | { |
| 119 | "include": "#comment" |
| 120 | } |
| 121 | ] |
| 122 | }, |
| 123 | { |
| 124 | "include": "#variables" |
| 125 | }, |
| 126 | { |
| 127 | "include": "#comment" |
| 128 | } |
| 129 | ] |
| 130 | }, |
| 131 | { |
| 132 | "begin": "^[ ]*(export)\\b", |
| 133 | "beginCaptures": { |
| 134 | "1": { |
| 135 | "name": "keyword.control.$1.makefile" |
| 136 | } |
| 137 | }, |
| 138 | "end": "^", |
| 139 | "patterns": [ |
| 140 | { |
| 141 | "include": "#comment" |
| 142 | }, |
| 143 | { |
| 144 | "include": "#variable-assignment" |
| 145 | }, |
| 146 | { |
| 147 | "match": "[^\\s]+", |
| 148 | "name": "variable.other.makefile" |
| 149 | } |
| 150 | ] |
| 151 | }, |
| 152 | { |
| 153 | "begin": "^[ ]*(override|private)\\b", |
| 154 | "beginCaptures": { |
| 155 | "1": { |
| 156 | "name": "keyword.control.$1.makefile" |
| 157 | } |
| 158 | }, |
| 159 | "end": "^", |
| 160 | "patterns": [ |
| 161 | { |
| 162 | "include": "#comment" |
| 163 | }, |
| 164 | { |
| 165 | "include": "#variable-assignment" |
| 166 | } |
| 167 | ] |
| 168 | }, |
| 169 | { |
| 170 | "begin": "^[ ]*(unexport|undefine)\\b", |
| 171 | "beginCaptures": { |
| 172 | "1": { |
| 173 | "name": "keyword.control.$1.makefile" |
| 174 | } |
| 175 | }, |
| 176 | "end": "^", |
| 177 | "patterns": [ |
| 178 | { |
| 179 | "include": "#comment" |
| 180 | }, |
| 181 | { |
| 182 | "match": "[^\\s]+", |
| 183 | "name": "variable.other.makefile" |
| 184 | } |
| 185 | ] |
| 186 | }, |
| 187 | { |
| 188 | "begin": "^(ifdef|ifndef)\\s*([^\\s]+)(?=\\s)", |
| 189 | "captures": { |
| 190 | "1": { |
| 191 | "name": "keyword.control.$1.makefile" |
| 192 | }, |
| 193 | "2": { |
| 194 | "name": "variable.other.makefile" |
| 195 | }, |
| 196 | "3": { |
| 197 | "name": "punctuation.separator.key-value.makefile" |
| 198 | } |
| 199 | }, |
| 200 | "end": "^(endif)\\b", |
| 201 | "name": "meta.scope.conditional.makefile", |
| 202 | "patterns": [ |
| 203 | { |
| 204 | "begin": "\\G(?!\\n)", |
| 205 | "end": "^", |
| 206 | "patterns": [ |
| 207 | { |
| 208 | "include": "#comment" |
| 209 | } |
| 210 | ] |
| 211 | }, |
| 212 | { |
| 213 | "include": "$self" |
| 214 | } |
| 215 | ] |
| 216 | }, |
| 217 | { |
| 218 | "begin": "^(ifeq|ifneq)(?=\\s)", |
| 219 | "captures": { |
| 220 | "1": { |
| 221 | "name": "keyword.control.$1.makefile" |
| 222 | } |
| 223 | }, |
| 224 | "end": "^(endif)\\b", |
| 225 | "name": "meta.scope.conditional.makefile", |
| 226 | "patterns": [ |
| 227 | { |
| 228 | "begin": "\\G", |
| 229 | "end": "^", |
| 230 | "name": "meta.scope.condition.makefile", |
| 231 | "patterns": [ |
| 232 | { |
| 233 | "include": "#variables" |
| 234 | }, |
| 235 | { |
| 236 | "include": "#comment" |
| 237 | } |
| 238 | ] |
| 239 | }, |
| 240 | { |
| 241 | "begin": "^else(?=\\s)", |
| 242 | "beginCaptures": { |
| 243 | "0": { |
| 244 | "name": "keyword.control.else.makefile" |
| 245 | } |
| 246 | }, |
| 247 | "end": "^" |
| 248 | }, |
| 249 | { |
| 250 | "include": "$self" |
| 251 | } |
| 252 | ] |
| 253 | } |
| 254 | ] |
| 255 | }, |
| 256 | "interpolation": { |
| 257 | "begin": "(?=`)", |
| 258 | "end": "(?!\\G)", |
| 259 | "name": "meta.embedded.line.shell", |
| 260 | "patterns": [ |
| 261 | { |
| 262 | "begin": "`", |
| 263 | "beginCaptures": { |
| 264 | "0": { |
| 265 | "name": "punctuation.definition.string.makefile" |
| 266 | } |
| 267 | }, |
| 268 | "contentName": "source.shell", |
| 269 | "end": "(`)", |
| 270 | "endCaptures": { |
| 271 | "0": { |
| 272 | "name": "punctuation.definition.string.makefile" |
| 273 | }, |
| 274 | "1": { |
| 275 | "name": "source.shell" |
| 276 | } |
| 277 | }, |
| 278 | "name": "string.interpolated.backtick.makefile", |
| 279 | "patterns": [ |
| 280 | { |
| 281 | "include": "source.shell" |
| 282 | } |
| 283 | ] |
| 284 | } |
| 285 | ] |
| 286 | }, |
| 287 | "recipe": { |
| 288 | "begin": "^(?!\\t)([^:]*)(:)(?!\\=)", |
| 289 | "beginCaptures": { |
| 290 | "1": { |
| 291 | "patterns": [ |
| 292 | { |
| 293 | "captures": { |
| 294 | "1": { |
| 295 | "name": "support.function.target.$1.makefile" |
| 296 | } |
| 297 | }, |
| 298 | "match": "^\\s*(\\.(PHONY|SUFFIXES|DEFAULT|PRECIOUS|INTERMEDIATE|SECONDARY|SECONDEXPANSION|DELETE_ON_ERROR|IGNORE|LOW_RESOLUTION_TIME|SILENT|EXPORT_ALL_VARIABLES|NOTPARALLEL|ONESHELL|POSIX))\\s*$" |
| 299 | }, |
| 300 | { |
| 301 | "begin": "(?=\\S)", |
| 302 | "end": "(?=\\s|$)", |
| 303 | "name": "entity.name.function.target.makefile", |
| 304 | "patterns": [ |
| 305 | { |
| 306 | "include": "#variables" |
| 307 | }, |
| 308 | { |
| 309 | "match": "%", |
| 310 | "name": "constant.other.placeholder.makefile" |
| 311 | } |
| 312 | ] |
| 313 | } |
| 314 | ] |
| 315 | }, |
| 316 | "2": { |
| 317 | "name": "punctuation.separator.key-value.makefile" |
| 318 | } |
| 319 | }, |
| 320 | "end": "^(?!\\t)", |
| 321 | "name": "meta.scope.target.makefile", |
| 322 | "patterns": [ |
| 323 | { |
| 324 | "begin": "\\G", |
| 325 | "end": "^", |
| 326 | "name": "meta.scope.prerequisites.makefile", |
| 327 | "patterns": [ |
| 328 | { |
| 329 | "match": "\\\\\\n", |
| 330 | "name": "constant.character.escape.continuation.makefile" |
| 331 | }, |
| 332 | { |
| 333 | "match": "%|\\*", |
| 334 | "name": "constant.other.placeholder.makefile" |
| 335 | }, |
| 336 | { |
| 337 | "include": "#comment" |
| 338 | }, |
| 339 | { |
| 340 | "include": "#variables" |
| 341 | } |
| 342 | ] |
| 343 | }, |
| 344 | { |
| 345 | "begin": "^\\t", |
| 346 | "name": "meta.scope.recipe.makefile", |
| 347 | "patterns": [ |
| 348 | { |
| 349 | "captures": { |
| 350 | "0": { |
| 351 | "patterns": [ |
| 352 | { |
| 353 | "match": "\\\\\\n", |
| 354 | "name": "constant.character.escape.continuation.makefile" |
| 355 | }, |
| 356 | { |
| 357 | "include": "#variables" |
| 358 | }, |
| 359 | { |
| 360 | "include": "source.shell" |
| 361 | } |
| 362 | ] |
| 363 | } |
| 364 | }, |
| 365 | "match": ".+\\n?" |
| 366 | } |
| 367 | ], |
| 368 | "while": "^\\t" |
| 369 | } |
| 370 | ] |
| 371 | }, |
| 372 | "variable-assignment": { |
| 373 | "begin": "(^[ ]*|\\G\\s*)([^\\s]+)\\s*(=|\\?=|:=|\\+=)", |
| 374 | "beginCaptures": { |
| 375 | "2": { |
| 376 | "name": "variable.other.makefile" |
| 377 | }, |
| 378 | "3": { |
| 379 | "name": "punctuation.separator.key-value.makefile" |
| 380 | } |
| 381 | }, |
| 382 | "end": "\\n", |
| 383 | "patterns": [ |
| 384 | { |
| 385 | "match": "\\\\\\n", |
| 386 | "name": "constant.character.escape.continuation.makefile" |
| 387 | }, |
| 388 | { |
| 389 | "include": "#comment" |
| 390 | }, |
| 391 | { |
| 392 | "include": "#variables" |
| 393 | }, |
| 394 | { |
| 395 | "include": "#interpolation" |
| 396 | } |
| 397 | ] |
| 398 | }, |
| 399 | "variables": { |
| 400 | "patterns": [ |
| 401 | { |
| 402 | "captures": { |
| 403 | "1": { |
| 404 | "name": "punctuation.definition.variable.makefile" |
| 405 | } |
| 406 | }, |
| 407 | "match": "(\\$?\\$)[@%<?^+*]", |
| 408 | "name": "variable.language.makefile" |
| 409 | }, |
| 410 | { |
| 411 | "begin": "\\$?\\$\\(", |
| 412 | "captures": { |
| 413 | "0": { |
| 414 | "name": "punctuation.definition.variable.makefile" |
| 415 | } |
| 416 | }, |
| 417 | "end": "\\)", |
| 418 | "name": "string.interpolated.makefile", |
| 419 | "patterns": [ |
| 420 | { |
| 421 | "include": "#variables" |
| 422 | }, |
| 423 | { |
| 424 | "match": "\\G(MAKEFILES|VPATH|SHELL|MAKESHELL|MAKE|MAKELEVEL|MAKEFLAGS|MAKECMDGOALS|CURDIR|SUFFIXES|\\.LIBPATTERNS)(?=\\s*\\))", |
| 425 | "name": "variable.language.makefile" |
| 426 | }, |
| 427 | { |
| 428 | "begin": "\\G(subst|patsubst|strip|findstring|filter(-out)?|sort|word(list)?|firstword|lastword|dir|notdir|suffix|basename|addsuffix|addprefix|join|wildcard|realpath|abspath|info|error|warning|shell|foreach|if|or|and|call|eval|value|file|guile)\\s", |
| 429 | "beginCaptures": { |
| 430 | "1": { |
| 431 | "name": "support.function.$1.makefile" |
| 432 | } |
| 433 | }, |
| 434 | "end": "(?=\\))", |
| 435 | "name": "meta.scope.function-call.makefile", |
| 436 | "patterns": [ |
| 437 | { |
| 438 | "include": "#variables" |
| 439 | }, |
| 440 | { |
| 441 | "match": "%|\\*", |
| 442 | "name": "constant.other.placeholder.makefile" |
| 443 | } |
| 444 | ] |
| 445 | }, |
| 446 | { |
| 447 | "begin": "\\G(origin|flavor)\\s(?=[^\\s)]+\\s*\\))", |
| 448 | "contentName": "variable.other.makefile", |
| 449 | "end": "(?=\\))", |
| 450 | "name": "meta.scope.function-call.makefile", |
| 451 | "patterns": [ |
| 452 | { |
| 453 | "include": "#variables" |
| 454 | } |
| 455 | ] |
| 456 | }, |
| 457 | { |
| 458 | "begin": "\\G(?!\\))", |
| 459 | "end": "(?=\\))", |
| 460 | "name": "variable.other.makefile", |
| 461 | "patterns": [ |
| 462 | { |
| 463 | "include": "#variables" |
| 464 | } |
| 465 | ] |
| 466 | } |
| 467 | ] |
| 468 | } |
| 469 | ] |
| 470 | } |
| 471 | }, |
| 472 | "scopeName": "source.makefile", |
| 473 | "uuid": "FF1825E8-6B1C-11D9-B883-000D93589AF6", |
| 474 | "version": "https://github.com/textmate/make.tmbundle/commit/1a1827da81e20fdce56e2658451340c070ca44b7" |
| 475 | } |