Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions extensions/make/syntaxes/Makefile.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
{
"include": "#comment"
},
{
"include": "#variables"
},
{
"include": "#variable-assignment"
},
Expand Down Expand Up @@ -42,7 +45,7 @@
"name": "punctuation.definition.comment.makefile"
}
},
"end": "\\n",
"end": "(?=[^\\\\])$",
"name": "comment.line.number-sign.makefile",
"patterns": [
{
Expand Down Expand Up @@ -322,12 +325,12 @@
"name": "punctuation.separator.key-value.makefile"
}
},
"end": "^(?!\\t)",
"end": "[^\\\\]$",
"name": "meta.scope.target.makefile",
"patterns": [
{
"begin": "\\G",
"end": "^",
"end": "(?=[^\\\\])$",
"name": "meta.scope.prerequisites.makefile",
"patterns": [
{
Expand Down Expand Up @@ -426,11 +429,11 @@
"include": "#variables"
},
{
"match": "\\G(MAKEFILES|VPATH|SHELL|MAKESHELL|MAKE|MAKELEVEL|MAKEFLAGS|MAKECMDGOALS|CURDIR|SUFFIXES|\\.LIBPATTERNS)(?=\\s*\\))",
"match": "(?<=\\()(MAKEFILES|VPATH|SHELL|MAKESHELL|MAKE|MAKELEVEL|MAKEFLAGS|MAKECMDGOALS|CURDIR|SUFFIXES|\\.LIBPATTERNS)(?=\\s*\\))",
"name": "variable.language.makefile"
},
{
"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",
"begin": "(?<=\\()(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",
"beginCaptures": {
"1": {
"name": "support.function.$1.makefile"
Expand All @@ -449,8 +452,13 @@
]
},
{
"begin": "\\G(origin|flavor)\\s(?=[^\\s)]+\\s*\\))",
"begin": "(?<=\\()(origin|flavor)\\s(?=[^\\s)]+\\s*\\))",
"contentName": "variable.other.makefile",
"beginCaptures": {
"1": {
"name": "support.function.$1.makefile"
}
},
"end": "(?=\\))",
"name": "meta.scope.function-call.makefile",
"patterns": [
Expand All @@ -460,7 +468,7 @@
]
},
{
"begin": "\\G(?!\\))",
"begin": "(?<=\\()(?!\\))",
"end": "(?=\\))",
"name": "variable.other.makefile",
"patterns": [
Expand Down
38 changes: 24 additions & 14 deletions extensions/make/test/colorize-fixtures/makefile
Original file line number Diff line number Diff line change
@@ -1,31 +1,41 @@
.PHONY: all
all: hello

hello: main.o factorial.o hello.o
g++ main.o factorial.o hello.o -o hello
.PHONY: hello
hello: main.o factorial.o \
hello.o $(first) $($(filter second,second)) \
# This is a long \
comment inside prerequisites.
g++ main.o factorial.o hello.o -o hello

# There are a building steps \
below. And the tab is at the beginning of this line.

main.o: main.cpp
g++ -c main.cpp
g++ -c main.cpp

factorial.o: factorial.cpp
g++ -c factorial.cpp
g++ -c factorial.cpp $(fake_variable)

hello.o: hello.cpp
g++ -c hello.cpp
hello.o: hello.cpp \
$(Colorizing with tabs at the beginning of the second line of prerequisites)
g++ -c hello.cpp -o $@

.PHONY: clean
clean:
rm *o hello
rm *o hello

define defined
$(info Checkng existance of $(1))
$(if ifeq "$(flavor $(1))" "undefined",0,1)
$(info Checking existance of $(1) $(flavor $(1)))
$(if $(filter undefined,$(flavor $(1))),0,1)
endef

ifeq ($(call defined,TOP_DIR),0)
TOP_DIR must be set before including paths.mk
ifeq ($(strip $(call defined,TOP_DIR)),0)
$(info TOP_DIR must be set before including paths.mk)
endif

include $(TOP_DIR)3rdparty.mk
-include $(TOP_DIR)3rdparty.mk

ifeq ($(call defined,CODIT_DIR),0)
CODIT_DIR must be set in $(TOP_DIR)3rdparty.mk
ifeq ($(strip $(call defined,CODIT_DIR)),0)
$(info CODIT_DIR must be set in $(TOP_DIR)3rdparty.mk)
endif
Loading