@@ -73,7 +73,7 @@ ifdef CFG_WINDOWSY
73
73
CFG_RUN_TEST=PATH ="$(CFG_LDPATH ) " $(1 )
74
74
CFG_RUN_TARG=PATH ="$(CFG_LDPATH ) " $(1 )
75
75
76
- CFG_PATH_MUNGE := $(strip | perl -p \
76
+ CFG_PATH_MUNGE := $(strip perl -i -p \
77
77
-e 's@\\(.) @/\1@go;' \
78
78
-e 's@^/([a-zA-Z])/@\1:/@o;')
79
79
ifdef CFG_FLEXLINK
86
86
ifdef CFG_UNIXY
87
87
CFG_INFO := $(info cfg: unix-y environment)
88
88
89
+ CFG_PATH_MUNGE := /bin/true
89
90
CFG_EXE_SUFFIX :=
90
91
CFG_LDPATH :=$(CFG_LDPATH ) :$(CFG_LLVM_LIBDIR )
91
92
CFG_RUN_TARG =\
@@ -924,6 +925,84 @@ test/compile-fail/%.stage0.out.tmp: test/compile-fail/%.rs $(SREQ0)
924
925
$(Q ) grep --text --quiet \
925
926
"$$(grep error-pattern $< | cut -d : -f 2- | tr -d '\n\r')" $@
926
927
928
+
929
+ # #####################################################################
930
+ # Auto-dependency
931
+ # #####################################################################
932
+
933
+ ML_DEPFILES := $(BOOT_MLS:%.ml=%.d )
934
+ C_DEPFILES := $(RUNTIME_CS:%.cpp=%.d ) $(RUSTLLVM_CS:%.cpp=%.d )
935
+
936
+ rt/% .d : rt/% .cpp $(MKFILES )
937
+ @$(call E, dep: $@ )
938
+ $(Q )$(call CFG_DEPEND_C, $@ \
939
+ $(subst $(S)src/,,$(patsubst %.cpp, %.o, $<)), \
940
+ $(RUNTIME_INCS)) $< >
[email protected]
941
+ $(Q)$(CFG_PATH_MUNGE)
[email protected]
942
+
943
+
944
+ rustllvm/% .d : rustllvm/% .cpp $(MKFILES )
945
+ @$(call E, dep: $@ )
946
+ $(Q )$(call CFG_DEPEND_C, $@ \
947
+ $(subst $(S)src/,,$(patsubst %.cpp, %.o, $<)), \
948
+ $(CFG_LLVM_CXXFLAGS) $(RUSTLLVM_INCS)) $< >
[email protected]
949
+ $(Q)$(CFG_PATH_MUNGE)
[email protected]
950
+
951
+
952
+ % .d : % .ml $(MKFILES )
953
+ @$(call E, dep: $@ )
954
+ $(Q ) ocamldep$(OPT ) -slash $(BOOT_ML_DEP_INCS ) $< > $@ .tmp
955
+ $(Q )$(CFG_PATH_MUNGE ) $@ .tmp
956
+ $(Q ) perl -i -pe " s@$( S) src/@@go" $@ .tmp
957
+ $(Q ) mv $@ .tmp $@
958
+
959
+ % .d : % .mli $(MKFILES )
960
+ @$(call E, dep: $@ )
961
+ $(Q ) ocamldep$(OPT ) -slash $(BOOT_ML_DEP_INCS ) $< > $@ .tmp
962
+ $(Q )$(CFG_PATH_MUNGE ) $@ .tmp
963
+ $(Q ) perl -i -pe " s@$( S) src/@@go" $@ .tmp
964
+ $(Q ) mv $@ .tmp $@
965
+
966
+ ifneq ($(MAKECMDGOALS ) ,clean)
967
+ -include $(ML_DEPFILES ) $(C_DEPFILES )
968
+ endif
969
+
970
+ RUSTBOOT_PROBE := $(wildcard boot/rustboot$(X ) )
971
+
972
+ ifneq ($(RUSTBOOT_PROBE ) ,)
973
+ CFG_INFO := $(info cfg: using built boot/rustboot$(X ) for rust deps)
974
+ CRATE_DEPFILES := $(subst $(S ) src/,,$(ALL_TEST_CRATES:%.rc=%.d ) ) \
975
+ boot/$(CFG_STDLIB ) .d \
976
+ stage0/rustc$(X ) .d \
977
+ stage0/$(CFG_STDLIB ) .d
978
+
979
+ boot/$(CFG_STDLIB ) .d : $(STDLIB_CRATE ) $(STDLIB_INPUTS ) \
980
+ $(MKFILES) boot/rustboot$(X)
981
+ @$(call E, dep: $@)
982
+ $(BOOT) -o $(patsubst %.d,%,$@) -shared -rdeps $< >
[email protected]
983
+ $(Q)$(CFG_PATH_MUNGE)
[email protected]
984
+
985
+
986
+ stage0/rustc$(X ) .d : $(COMPILER_CRATE ) $(COMPILER_INPUTS ) \
987
+ $(STDLIB_CRATE) $(MKFILES) boot/rustboot$(X)
988
+ @$(call E, dep: $@)
989
+ $(BOOT) -o $(patsubst %.d,%,$@) -shared -rdeps $< >
[email protected]
990
+ $(Q)$(CFG_PATH_MUNGE)
[email protected]
991
+
992
+
993
+ % .d : % .rc $(MKFILES ) boot/rustboot$(X )
994
+ @$(call E, dep: $@ )
995
+ $(BOOT ) -o $(patsubst % .d,% ,$@ ) -rdeps $< > $@ .tmp
996
+ $(Q )$(CFG_PATH_MUNGE ) $@ .tmp
997
+ $(Q ) mv $@ .tmp $@
998
+
999
+ ifneq ($(MAKECMDGOALS ) ,clean)
1000
+ -include $(CRATE_DEPFILES )
1001
+ endif
1002
+ endif
1003
+
1004
+ depend : boot/rustboot$(X ) $(CRATE_DEPFILES ) $(ML_DEPFILES ) $(C_DEPFILES )
1005
+
927
1006
# #####################################################################
928
1007
# Distribution
929
1008
# #####################################################################
0 commit comments