diff options
author | Tim Hatch <tim@timhatch.com> | 2014-10-07 13:08:31 -0700 |
---|---|---|
committer | Tim Hatch <tim@timhatch.com> | 2014-10-07 13:08:31 -0700 |
commit | 702bccea86fa7bb11f4d1e6e153fa1394ca7cfcb (patch) | |
tree | 1152d52df4ca7cca5859890d13b9fb0c261fab4c | |
parent | 209fbc57cadc9111ba0a4b223e83867659c12c07 (diff) | |
download | pygments-702bccea86fa7bb11f4d1e6e153fa1394ca7cfcb.tar.gz |
MakeLexer: Add GNU Make vpath directive.
Fixes #949
-rw-r--r-- | pygments/lexers/make.py | 2 | ||||
-rw-r--r-- | tests/examplefiles/vpath.mk | 16 |
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) |