diff --git a/Makefile.in b/Makefile.in index a7cfc28a530..1d04ea9cdb8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -367,17 +367,18 @@ RUNTIME_LIBS := $(CFG_GCC_POST_LIB_FLAGS) # rustc LLVM-extensions (C++) library variables ###################################################################### -RUSTLLVM_CS := $(addprefix rustllvm/, \ - MachOObjectFile.cpp Object.cpp RustWrapper.cpp) +RUSTLLVM_LIB_CS := $(addprefix rustllvm/, \ + MachOObjectFile.cpp Object.cpp) + +RUSTLLVM_OBJS_CS := $(addprefix rustllvm/, RustWrapper.cpp) RUSTLLVM_HDR := rustllvm/include/llvm-c/Object.h RUSTLLVM_DEF := rustllvm/rustllvm$(CFG_DEF_SUFFIX) RUSTLLVM_INCS := -iquote $(CFG_LLVM_INCDIR) \ -iquote $(S)src/rustllvm/include -RUSTLLVM_OBJS := $(RUSTLLVM_CS:.cpp=.o) -RUSTLLVM_LIBS := $(CFG_LLVM_LDFLAGS) $(CFG_LLVM_LIBS) \ - $(CFG_GCC_POST_LIB_FLAGS) +RUSTLLVM_LIB_OBJS := $(RUSTLLVM_LIB_CS:.cpp=.o) +RUSTLLVM_OBJS_OBJS := $(RUSTLLVM_OBJS_CS:.cpp=.o) ###################################################################### # Standard library variables @@ -426,16 +427,17 @@ rt/$(CFG_RUNTIME): $(RUNTIME_OBJS) $(MKFILES) $(RUNTIME_HDR) $(RUNTIME_DEF) # FIXME: Building a .a is a hack so that we build with both older and newer # versions of LLVM. In newer versions some of the bits of this library are # already in LLVM itself, so they are skipped. -rustllvm/rustllvmbits.a: $(RUSTLLVM_OBJS) +rustllvm/rustllvmbits.a: $(RUSTLLVM_LIB_OBJS) rm -f $@ ar crs $@ $^ -rustllvm/$(CFG_RUSTLLVM): rustllvm/rustllvmbits.a $(MKFILES) $(RUSTLLVM_HDR) \ - $(RUSTLLVM_DEF) +rustllvm/$(CFG_RUSTLLVM): rustllvm/rustllvmbits.a $(RUSTLLVM_OBJS_OBJS) \ + $(MKFILES) $(RUSTLLVM_HDR) $(RUSTLLVM_DEF) @$(call E, link: $@) - $(Q)$(call CFG_LINK_C,$@,$(RUSTLLVM_LIBS) rustllvm/rustllvmbits.a \ - $(CFG_GCC_PRE_LIB_FLAGS) $(CFG_LLVM_LIBS) \ - $(CFG_GCC_POST_LIB_FLAGS) $(CFG_LLVM_LDFLAGS),$(RUSTLLVM_DEF)) + $(Q)$(call CFG_LINK_C,$@,$(RUSTLLVM_OBJS_OBJS) \ + $(CFG_GCC_PRE_LIB_FLAGS) $(CFG_LLVM_LIBS) \ + $(CFG_GCC_POST_LIB_FLAGS) rustllvm/rustllvmbits.a \ + $(CFG_LLVM_LDFLAGS),$(RUSTLLVM_DEF)) ifdef CFG_BOOT_NATIVE boot/rustboot$(X): $(BOOT_CMXS) $(MKFILES) @@ -893,7 +895,8 @@ test/compile-fail/%.stage0.out.tmp: test/compile-fail/%.rs $(SREQ0) ###################################################################### ML_DEPFILES := $(BOOT_MLS:%.ml=%.d) -C_DEPFILES := $(RUNTIME_CS:%.cpp=%.d) $(RUSTLLVM_CS:%.cpp=%.d) +C_DEPFILES := $(RUNTIME_CS:%.cpp=%.d) $(RUSTLLVM_LIB_CS:%.cpp=%.d) \ + $(RUSTLLVM_OBJS_CS:%.cpp=%.d) rt/%.d: rt/%.cpp $(MKFILES) @$(call E, dep: $@) @@ -1007,7 +1010,8 @@ PKG_FILES = \ README boot/README comp/README \ $(filter-out $(GENERATED), $(BOOT_MLS)) \ $(RUNTIME_CS) $(RUNTIME_HDR) \ - $(RUSTLLVM_CS) $(RUSTLLVM_HDR) \ + $(RUSTLLVM_LIB_CS) $(RUSTLLVM_OBJS_CS) \ + $(RUSTLLVM_HDR) \ $(PKG_3RDPARTY)) \ $(GENERATED) \ $(S)src/boot/fe/lexer.ml \ @@ -1055,15 +1059,15 @@ tidy: @$(call E, check: formatting) $(Q)echo \ $(filter-out $(GENERATED) $(addprefix $(S)src/, $(GENERATED)) \ - $(addprefix $(S)src/, $(RUSTLLVM_CS) $(RUSTLLVM_HDR) \ - $(PKG_3RDPARTY)) \ + $(addprefix $(S)src/, $(RUSTLLVM_LIB_CS) $(RUSTLLVM_OBJS_CS) \ + $(RUSTLLVM_HDR) $(PKG_3RDPARTY)) \ $(S)src/etc/%, $(PKG_FILES)) \ | xargs -n 10 python $(S)src/etc/tidy.py clean: @$(call E, cleaning) $(Q)rm -f $(RUNTIME_OBJS) $(RUNTIME_DEF) - $(Q)rm -f $(RUSTLLVM_OBJS) $(RUSTLLVM_DEF) + $(Q)rm -f $(RUSTLLVM_LIB_OBJS) $(RUSTLLVM_OBJS_OBJS) $(RUSTLLVM_DEF) $(Q)rm -f $(BOOT_CMOS) $(BOOT_CMIS) $(BOOT_CMXS) $(BOOT_OBJS) $(Q)rm -f $(ML_DEPFILES) $(C_DEPFILES) $(CRATE_DEPFILES) $(Q)rm -f $(ML_DEPFILES:%.d=%.d.tmp)