Add targets for building rustc as a library
This commit is contained in:
parent
a5ea56c6f0
commit
9a12ad62f6
@ -37,6 +37,7 @@ include $(CFG_SRC_DIR)/mk/platform.mk
|
||||
CFG_RUNTIME :=$(call CFG_LIB_NAME,rustrt)
|
||||
CFG_RUSTLLVM :=$(call CFG_LIB_NAME,rustllvm)
|
||||
CFG_STDLIB :=$(call CFG_LIB_NAME,std)
|
||||
CFG_RUSTCLIB :=$(call CFG_LIB_NAME,rustc)
|
||||
|
||||
# version-string calculation
|
||||
CFG_GIT_DIR := $(CFG_SRC_DIR).git
|
||||
|
@ -9,6 +9,15 @@ stage1/$(CFG_STDLIB): stage1/std.o stage1/glue.o
|
||||
$(Q)gcc $(CFG_GCCISH_CFLAGS) stage1/glue.o $(CFG_GCCISH_LINK_FLAGS) \
|
||||
-o $@ $< -Lstage1 -Lrt -lrustrt
|
||||
|
||||
stage1/librustc.o: $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ0)
|
||||
@$(call E, compile: $@)
|
||||
$(STAGE0) -c --shared -o $@ $<
|
||||
|
||||
stage1/$(CFG_RUSTCLIB): stage1/librustc.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 $@ $<
|
||||
|
@ -9,6 +9,15 @@ stage2/$(CFG_STDLIB): stage2/std.o stage2/glue.o
|
||||
$(Q)gcc $(CFG_GCCISH_CFLAGS) stage2/glue.o $(CFG_GCCISH_LINK_FLAGS) -o \
|
||||
$@ $< -Lstage2 -Lrt -lrustrt
|
||||
|
||||
stage2/librustc.o: $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ1)
|
||||
@$(call E, compile: $@)
|
||||
$(STAGE1) -c --shared -o $@ $<
|
||||
|
||||
stage2/$(CFG_RUSTCLIB): stage2/librustc.o stage2/glue.o
|
||||
@$(call E, link: $@)
|
||||
$(Q)gcc $(CFG_GCC_CFLAGS) stage2/glue.o $(CFG_GCC_LINK_FLAGS) -o $@ $< \
|
||||
-Lstage2 -Lrt -lrustrt
|
||||
|
||||
stage2/rustc.o: $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ1)
|
||||
@$(call E, compile: $@)
|
||||
$(STAGE1) -c -o $@ $<
|
||||
|
@ -9,6 +9,15 @@ stage3/$(CFG_STDLIB): stage3/std.o stage3/glue.o
|
||||
$(Q)gcc $(CFG_GCCISH_CFLAGS) stage3/glue.o $(CFG_GCCISH_LINK_FLAGS) -o \
|
||||
$@ $< -Lstage3 -Lrt -lrustrt
|
||||
|
||||
stage3/librustc.o: $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ2)
|
||||
@$(call E, compile: $@)
|
||||
$(STAGE2) -c --shared -o $@ $<
|
||||
|
||||
stage3/$(CFG_RUSTCLIB): stage3/librustc.o stage3/glue.o
|
||||
@$(call E, link: $@)
|
||||
$(Q)gcc $(CFG_GCC_CFLAGS) stage3/glue.o $(CFG_GCC_LINK_FLAGS) -o $@ $< \
|
||||
-Lstage3 -Lrt -lrustrt
|
||||
|
||||
stage3/rustc.o: $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ2)
|
||||
@$(call E, compile: $@)
|
||||
$(STAGE2) -c -o $@ $<
|
||||
|
Loading…
x
Reference in New Issue
Block a user