File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -505,6 +505,38 @@ stage2/glue.bc: stage2/rustc$(X) stage1/$(CFG_STDLIB) \
505
505
@$(call E, generate: $@)
506
506
$(STAGE2) -o $@ -glue
507
507
508
+ # Due to make not wanting to run the same implicit rules twice on the same
509
+ # rule tree (implicit-rule recursion prevention, see "Chains of Implicit
510
+ # Rules" in GNU Make manual) we have to re-state the %.o and %.s patterns here
511
+ # for different directories, to handle cases where (say) a test relies on a
512
+ # compiler that relies on a .o file.
513
+
514
+ stage0/% .o : stage0/% .s
515
+ @$(call E, assemble [llvm]: $@ )
516
+ $(Q ) gcc $(CFG_GCC_CFLAGS ) -o $@ -c $<
517
+
518
+ stage0/% .s : stage0/% .bc
519
+ @$(call E, compile [llvm]: $@ )
520
+ $(Q )$(CFG_LLVM_BINDIR ) /llc $(CFG_LLC_CFLAGS ) -o $@ $<
521
+
522
+ stage1/% .o : stage1/% .s
523
+ @$(call E, assemble [llvm]: $@ )
524
+ $(Q ) gcc $(CFG_GCC_CFLAGS ) -o $@ -c $<
525
+
526
+ stage1/% .s : stage1/% .bc
527
+ @$(call E, compile [llvm]: $@ )
528
+ $(Q )$(CFG_LLVM_BINDIR ) /llc $(CFG_LLC_CFLAGS ) -o $@ $<
529
+
530
+ stage2/% .o : stage2/% .s
531
+ @$(call E, assemble [llvm]: $@ )
532
+ $(Q ) gcc $(CFG_GCC_CFLAGS ) -o $@ -c $<
533
+
534
+ stage2/% .s : stage2/% .bc
535
+ @$(call E, compile [llvm]: $@ )
536
+ $(Q )$(CFG_LLVM_BINDIR ) /llc $(CFG_LLC_CFLAGS ) -o $@ $<
537
+
538
+
539
+
508
540
# #####################################################################
509
541
# Library and boot rules
510
542
# #####################################################################
You can’t perform that action at this time.
0 commit comments