@@ -367,17 +367,18 @@ RUNTIME_LIBS := $(CFG_GCC_POST_LIB_FLAGS)
367
367
# rustc LLVM-extensions (C++) library variables
368
368
# #####################################################################
369
369
370
- RUSTLLVM_CS := $(addprefix rustllvm/, \
371
- MachOObjectFile.cpp Object.cpp RustWrapper.cpp)
370
+ RUSTLLVM_LIB_CS := $(addprefix rustllvm/, \
371
+ MachOObjectFile.cpp Object.cpp)
372
+
373
+ RUSTLLVM_OBJS_CS := $(addprefix rustllvm/, RustWrapper.cpp)
372
374
373
375
RUSTLLVM_HDR := rustllvm/include/llvm-c/Object.h
374
376
RUSTLLVM_DEF := rustllvm/rustllvm$(CFG_DEF_SUFFIX )
375
377
376
378
RUSTLLVM_INCS := -iquote $(CFG_LLVM_INCDIR ) \
377
379
-iquote $(S ) src/rustllvm/include
378
- RUSTLLVM_OBJS := $(RUSTLLVM_CS:.cpp=.o )
379
- RUSTLLVM_LIBS := $(CFG_LLVM_LDFLAGS ) $(CFG_LLVM_LIBS ) \
380
- $(CFG_GCC_POST_LIB_FLAGS )
380
+ RUSTLLVM_LIB_OBJS := $(RUSTLLVM_LIB_CS:.cpp=.o )
381
+ RUSTLLVM_OBJS_OBJS := $(RUSTLLVM_OBJS_CS:.cpp=.o )
381
382
382
383
# #####################################################################
383
384
# Standard library variables
@@ -426,16 +427,17 @@ rt/$(CFG_RUNTIME): $(RUNTIME_OBJS) $(MKFILES) $(RUNTIME_HDR) $(RUNTIME_DEF)
426
427
# FIXME: Building a .a is a hack so that we build with both older and newer
427
428
# versions of LLVM. In newer versions some of the bits of this library are
428
429
# already in LLVM itself, so they are skipped.
429
- rustllvm/rustllvmbits.a : $(RUSTLLVM_OBJS )
430
+ rustllvm/rustllvmbits.a : $(RUSTLLVM_LIB_OBJS )
430
431
rm -f $@
431
432
ar crs $@ $^
432
433
433
- rustllvm/$(CFG_RUSTLLVM ) : rustllvm/rustllvmbits.a $(MKFILES ) $( RUSTLLVM_HDR ) \
434
- $(RUSTLLVM_DEF)
434
+ rustllvm/$(CFG_RUSTLLVM ) : rustllvm/rustllvmbits.a $(RUSTLLVM_OBJS_OBJS ) \
435
+ $(MKFILES) $(RUSTLLVM_HDR) $( RUSTLLVM_DEF)
435
436
@$(call E, link: $@)
436
- $(Q)$(call CFG_LINK_C,$@,$(RUSTLLVM_LIBS) rustllvm/rustllvmbits.a \
437
- $(CFG_GCC_PRE_LIB_FLAGS) $(CFG_LLVM_LIBS) \
438
- $(CFG_GCC_POST_LIB_FLAGS) $(CFG_LLVM_LDFLAGS),$(RUSTLLVM_DEF))
437
+ $(Q)$(call CFG_LINK_C,$@,$(RUSTLLVM_OBJS_OBJS) \
438
+ $(CFG_GCC_PRE_LIB_FLAGS) $(CFG_LLVM_LIBS) \
439
+ $(CFG_GCC_POST_LIB_FLAGS) rustllvm/rustllvmbits.a \
440
+ $(CFG_LLVM_LDFLAGS),$(RUSTLLVM_DEF))
439
441
440
442
ifdef CFG_BOOT_NATIVE
441
443
boot/rustboot$(X ) : $(BOOT_CMXS ) $(MKFILES )
@@ -893,7 +895,8 @@ test/compile-fail/%.stage0.out.tmp: test/compile-fail/%.rs $(SREQ0)
893
895
# #####################################################################
894
896
895
897
ML_DEPFILES := $(BOOT_MLS:%.ml=%.d )
896
- C_DEPFILES := $(RUNTIME_CS:%.cpp=%.d ) $(RUSTLLVM_CS:%.cpp=%.d )
898
+ C_DEPFILES := $(RUNTIME_CS:%.cpp=%.d ) $(RUSTLLVM_LIB_CS:%.cpp=%.d ) \
899
+ $(RUSTLLVM_OBJS_CS:%.cpp=%.d )
897
900
898
901
rt/% .d : rt/% .cpp $(MKFILES )
899
902
@$(call E, dep: $@ )
@@ -1007,7 +1010,8 @@ PKG_FILES = \
1007
1010
README boot/README comp/README \
1008
1011
$(filter-out $(GENERATED ) , $(BOOT_MLS ) ) \
1009
1012
$(RUNTIME_CS ) $(RUNTIME_HDR ) \
1010
- $(RUSTLLVM_CS ) $(RUSTLLVM_HDR ) \
1013
+ $(RUSTLLVM_LIB_CS ) $(RUSTLLVM_OBJS_CS ) \
1014
+ $(RUSTLLVM_HDR ) \
1011
1015
$(PKG_3RDPARTY ) ) \
1012
1016
$(GENERATED ) \
1013
1017
$(S ) src/boot/fe/lexer.ml \
@@ -1055,15 +1059,15 @@ tidy:
1055
1059
@$(call E, check: formatting)
1056
1060
$(Q ) echo \
1057
1061
$(filter-out $(GENERATED) $(addprefix $(S)src/, $(GENERATED)) \
1058
- $(addprefix $(S)src/, $(RUSTLLVM_CS ) $(RUSTLLVM_HDR ) \
1059
- $(PKG_3RDPARTY)) \
1062
+ $(addprefix $(S)src/, $(RUSTLLVM_LIB_CS ) $(RUSTLLVM_OBJS_CS ) \
1063
+ $(RUSTLLVM_HDR) $( PKG_3RDPARTY)) \
1060
1064
$(S)src/etc/%, $(PKG_FILES)) \
1061
1065
| xargs -n 10 python $(S)src/etc/tidy.py
1062
1066
1063
1067
clean :
1064
1068
@$(call E, cleaning)
1065
1069
$(Q ) rm -f $(RUNTIME_OBJS ) $(RUNTIME_DEF )
1066
- $(Q ) rm -f $(RUSTLLVM_OBJS ) $(RUSTLLVM_DEF )
1070
+ $(Q ) rm -f $(RUSTLLVM_LIB_OBJS ) $( RUSTLLVM_OBJS_OBJS ) $(RUSTLLVM_DEF )
1067
1071
$(Q ) rm -f $(BOOT_CMOS ) $(BOOT_CMIS ) $(BOOT_CMXS ) $(BOOT_OBJS )
1068
1072
$(Q ) rm -f $(ML_DEPFILES ) $(C_DEPFILES ) $(CRATE_DEPFILES )
1069
1073
$(Q ) rm -f $(ML_DEPFILES:%.d=%.d.tmp )
0 commit comments