Skip to content

Commit

Permalink
Exit with an error if re2c is not available
Browse files Browse the repository at this point in the history
Instead of overwriting src/json.hpp with an empty file
  • Loading branch information
krzysztofwos committed Mar 20, 2017
1 parent 8657920 commit b9c3b8d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: pretty clean ChangeLog.md

# used programs
RE2C = re2c
RE2C := $(shell command -v re2c 2> /dev/null)
SED = sed

# main target
Expand Down Expand Up @@ -185,6 +185,9 @@ clang_sanitize: clean

# create scanner with re2c
re2c: src/json.hpp.re2c
ifndef RE2C
$(error "re2c is not available, please install re2c")
endif
$(RE2C) -W --utf-8 --encoding-policy fail --bit-vectors --nested-ifs --no-debug-info $< | $(SED) '1d' > src/json.hpp

# pretty printer
Expand Down

0 comments on commit b9c3b8d

Please sign in to comment.