summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pygments/lexers/make.py2
-rw-r--r--tests/examplefiles/vpath.mk16
2 files changed, 17 insertions, 1 deletions
diff --git a/pygments/lexers/make.py b/pygments/lexers/make.py
index 88957896..76ca7376 100644
--- a/pygments/lexers/make.py
+++ b/pygments/lexers/make.py
@@ -38,7 +38,7 @@ class MakefileLexer(Lexer):
# BSD Make
r'\.\s*(include|undef|error|warning|if|else|elif|endif|for|endfor)|'
# GNU Make
- r'\s*(ifeq|ifneq|ifdef|ifndef|else|endif|-?include|define|endef|:))(?=\s)')
+ r'\s*(ifeq|ifneq|ifdef|ifndef|else|endif|-?include|define|endef|:|vpath))(?=\s)')
r_comment = re.compile(r'^\s*@?#')
def get_tokens_unprocessed(self, text):
diff --git a/tests/examplefiles/vpath.mk b/tests/examplefiles/vpath.mk
new file mode 100644
index 00000000..a7f18fc3
--- /dev/null
+++ b/tests/examplefiles/vpath.mk
@@ -0,0 +1,16 @@
+vpath %.c src
+vpath %.h header
+EXEC=hello
+SRC= hello.c main.c
+OBJ= $(SRC:.c=.o)
+
+all: $(EXEC)
+
+hello: $(OBJ)
+ $(CC) -o $@ $^ $(LDFLAGS)
+
+main.o: hello.h
+
+%.o: %.c
+ $(CC) -I header -o $@ \
+ -c $< $(CFLAGS)