diff options
| author | Graydon Hoare <[email protected]> | 2011-05-01 20:18:52 +0000 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-05-01 20:20:25 +0000 |
| commit | 40624e35d74e5d200ae689c02753f0d60924e668 (patch) | |
| tree | e1e259098d5c49cd49844b40abd46ec35219d94a /mk/stage1.mk | |
| parent | rustc: Preserve dots in input path when using an implicit output path (diff) | |
| download | rust-40624e35d74e5d200ae689c02753f0d60924e668.tar.xz rust-40624e35d74e5d200ae689c02753f0d60924e668.zip | |
Start splitting up Makefile.in
Diffstat (limited to 'mk/stage1.mk')
| -rw-r--r-- | mk/stage1.mk | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/mk/stage1.mk b/mk/stage1.mk new file mode 100644 index 00000000..d003134a --- /dev/null +++ b/mk/stage1.mk @@ -0,0 +1,36 @@ +stage1/std.o: $(STDLIB_CRATE) $(STDLIB_INPUTS) stage0/rustc$(X) $(MKFILES) + @$(call E, compile: $@) + $(STAGE0) -c --shared -o $@ $< + +stage1/$(CFG_STDLIB): stage1/std.o stage1/glue.o + @$(call E, link: $@) + $(Q)gcc $(CFG_GCC_CFLAGS) stage1/glue.o $(CFG_GCC_LINK_FLAGS) -o $@ $< \ + -Lstage1 -Lrt -lrustrt + +stage1/rustc.o: $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ0) + @$(call E, compile: $@) + $(STAGE0) -c -o $@ $< + +stage1/glue.o: stage0/rustc$(X) stage0/$(CFG_STDLIB) \ + rustllvm/$(CFG_RUSTLLVM) rt/$(CFG_RUNTIME) + @$(call E, generate: $@) + $(STAGE0) -c -o $@ --glue + +# Due to make not wanting to run the same implicit rules twice on the same +# rule tree (implicit-rule recursion prevention, see "Chains of Implicit +# Rules" in GNU Make manual) we have to re-state the %.o and %.s patterns here +# for different directories, to handle cases where (say) a test relies on a +# compiler that relies on a .o file. + +stage1/%.o: stage1/%.s + @$(call E, assemble [gcc]: $@) + $(Q)gcc $(CFG_GCC_CFLAGS) -o $@ -c $< + +stage1/%$(X): stage1/%.o $(SREQ0) + @$(call E, link [gcc]: $@) + $(Q)gcc $(CFG_GCC_CFLAGS) stage1/glue.o -o $@ $< \ + -Lstage1 -Lrustllvm -Lrt -lrustrt -lrustllvm -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) $@ |