diff --git a/mk/tests.mk b/mk/tests.mk index bdf175f2bda..79ab8d3774b 100644 --- a/mk/tests.mk +++ b/mk/tests.mk @@ -200,13 +200,15 @@ compile-check: tidy \ @# programs, I\'ll live with the noise. -$(Q)$(CFG_DSYMUTIL) $@ -%.stage2$(X): %.rs $(SREQ2) - @$(call E, compile_and_link: $@) - $(STAGE2) -o $@ $< +%.stage2$(X): %.stage2.o $(SREQ2) + @$(call E, link [gcc]: $@) + $(Q)gcc $(CFG_GCCISH_CFLAGS) stage3/glue.o -o $@ $< \ + -Lstage3 -Lrt rt/main.o -lrustrt -lstd -lm + @# dsymutil sometimes fails or prints a warning, but the + @# program still runs. Since it simplifies debugging other + @# programs, I\'ll live with the noise. + -$(Q)$(CFG_DSYMUTIL) $@ -%.stage2$(X): %.rc $(SREQ2) - @$(call E, compile_and_link: $@) - $(STAGE2) -o $@ $< %.stage0.o: %.rc $(SREQ0) @$(call E, compile [stage0]: $@) @@ -225,6 +227,15 @@ compile-check: tidy \ @$(call E, compile [stage1]: $@) $(STAGE1) -c -o $@ $< + +%.stage2.o: %.rc $(SREQ2) + @$(call E, compile [stage2]: $@) + $(STAGE2) -c -o $@ $< + +%.stage2.o: %.rs $(SREQ2) + @$(call E, compile [stage2]: $@) + $(STAGE2) -c -o $@ $< + # Cancel the implicit .out rule in GNU make. %.out: %