Skip to content

Commit 53543d2

Browse files
committed
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.
1 parent 71f8db5 commit 53543d2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

mk/grammar.mk

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ SG = $(S)src/grammar/
1313
B = $(CFG_BUILD_DIR)/$(CFG_BUILD)/stage2/
1414
L = $(B)lib/rustlib/$(CFG_BUILD)/lib
1515
LD = $(CFG_BUILD)/stage2/lib/rustlib/$(CFG_BUILD)/lib/
16-
RUSTC = $(B)bin/rustc
16+
RUSTC = $(STAGE2_T_$(CFG_BUILD)_H_$(CFG_BUILD))
1717

1818
# Run the reference lexer against libsyntax and compare the tokens and spans.
1919
# If "// ignore-lexer-test" is present in the file, it will be ignored.
@@ -37,19 +37,25 @@ $(BG)RustLexer.class: $(SG)RustLexer.g4
3737
$(BG)verify: $(SG)verify.rs rustc-stage2-H-$(CFG_BUILD) $(LD)stamp.regex_macros $(LD)stamp.rustc
3838
$(Q)$(RUSTC) -O --out-dir $(BG) -L $(L) $(SG)verify.rs
3939

40-
check-lexer: $(BG) $(BG)RustLexer.class $(BG)verify
4140
ifdef CFG_JAVAC
4241
ifdef CFG_ANTLR4
4342
ifdef CFG_GRUN
43+
check-lexer: $(BG) $(BG)RustLexer.class $(BG)verify
4444
$(info Verifying libsyntax against the reference lexer ...)
4545
$(Q)$(SG)check.sh $(S) "$(BG)" \
4646
"$(CFG_GRUN)" "$(BG)verify" "$(BG)RustLexer.tokens"
4747
else
4848
$(info grun not available, skipping lexer test...)
49+
check-lexer:
50+
4951
endif
5052
else
5153
$(info antlr4 not available, skipping lexer test...)
54+
check-lexer:
55+
5256
endif
5357
else
5458
$(info javac not available, skipping lexer test...)
59+
check-lexer:
60+
5561
endif

0 commit comments

Comments
 (0)