diff --git a/mk/grammar.mk b/mk/grammar.mk index c0afa3eb769..6ff0f82293b 100644 --- a/mk/grammar.mk +++ b/mk/grammar.mk @@ -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