Skip to content

Commit 496d5ec

Browse files
committed
Improved re2c check
1 parent c094d8e commit 496d5ec

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

parser.mk

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
ifeq (, $(shell which re2c))
2-
$(error "No re2c found in the $$PATH: $(PATH). Consider install re2c or/and add re2c executale to the $$PATH")
1+
RE2C := $(shell command -v re2c 2>/dev/null)
2+
ifndef RE2C
3+
$(error No re2c found in the $$PATH. Consider install re2c or/and add re2c executable to the $$PATH)
34
endif
45

56
RE2C_FLAGS=
6-
RE2C_VERSION=$(shell re2c --vernum 2>/dev/null)
7+
RE2C_VERSION=$(shell $(RE2C) --vernum 2>/dev/null)
78
ifeq ($(shell test "$(RE2C_VERSION)" -gt "9999"; echo $$?),0)
89
RE2C_FLAGS=-W
910
endif

0 commit comments

Comments
 (0)