mk: Some fixes to grammar.mk

Invoke rustc in a way that sets LD_LIBRARY_PATH,
and disable the deps on RustLexer.class when antlr isn't available.
This commit is contained in:
Brian Anderson 2014-07-24 21:30:43 -07:00
parent 71f8db5b62
commit 53543d2aa3
1 changed files with 8 additions and 2 deletions

View File

@ -13,7 +13,7 @@ SG = $(S)src/grammar/
B = $(CFG_BUILD_DIR)/$(CFG_BUILD)/stage2/
L = $(B)lib/rustlib/$(CFG_BUILD)/lib
LD = $(CFG_BUILD)/stage2/lib/rustlib/$(CFG_BUILD)/lib/
RUSTC = $(B)bin/rustc
RUSTC = $(STAGE2_T_$(CFG_BUILD)_H_$(CFG_BUILD))
# Run the reference lexer against libsyntax and compare the tokens and spans.
# If "// ignore-lexer-test" is present in the file, it will be ignored.
@ -37,19 +37,25 @@ $(BG)RustLexer.class: $(SG)RustLexer.g4
$(BG)verify: $(SG)verify.rs rustc-stage2-H-$(CFG_BUILD) $(LD)stamp.regex_macros $(LD)stamp.rustc
$(Q)$(RUSTC) -O --out-dir $(BG) -L $(L) $(SG)verify.rs
check-lexer: $(BG) $(BG)RustLexer.class $(BG)verify
ifdef CFG_JAVAC
ifdef CFG_ANTLR4
ifdef CFG_GRUN
check-lexer: $(BG) $(BG)RustLexer.class $(BG)verify
$(info Verifying libsyntax against the reference lexer ...)
$(Q)$(SG)check.sh $(S) "$(BG)" \
"$(CFG_GRUN)" "$(BG)verify" "$(BG)RustLexer.tokens"
else
$(info grun not available, skipping lexer test...)
check-lexer:
endif
else
$(info antlr4 not available, skipping lexer test...)
check-lexer:
endif
else
$(info javac not available, skipping lexer test...)
check-lexer:
endif