fix makefiles, add option to ignore changes in makefiles

This commit is contained in:
Niko Matsakis 2011-11-23 15:20:28 -08:00
parent 092fc0ab22
commit 9c00c62b08
9 changed files with 49 additions and 39 deletions

View File

@ -59,6 +59,12 @@ GEN_MKFILES := $(wildcard $(CFG_SRC_DIR)/mk/libuv/*/*/*) \
MKFILES := $(OUR_MKFILES) $(3RDPARTY_MKFILES) $(GEN_MKFILES)
ifdef IGNORE_MKFILES
MKFILE_DEPS :=
else
MKFILE_DEPS := $(MKFILES)
endif
NON_HOST_TRIPLES = $(filter-out $(CFG_HOST_TRIPLE),$(CFG_TARGET_TRIPLES))
ifneq ($(MAKE_RESTARTS),)

View File

@ -5,7 +5,7 @@
C_DEPFILES := $(RUNTIME_CS:%.cpp=%.d) $(RUSTLLVM_LIB_CS:%.cpp=%.d) \
$(RUSTLLVM_OBJS_CS:%.cpp=%.d)
rt/%.d: rt/%.cpp $(MKFILES)
rt/%.d: rt/%.cpp $(MKFILE_DEPS)
@$(call E, dep: $@)
$(Q)$(call CFG_DEPEND_C, $@ \
$(subst $(S)src/,,$(patsubst %.cpp, %.o, $<)), \
@ -14,7 +14,7 @@ rt/%.d: rt/%.cpp $(MKFILES)
$(Q)rm -f $@.tmp.bak
$(Q)mv $@.tmp $@
rustllvm/%.d: rustllvm/%.cpp $(MKFILES) $(LLVM_CONFIG_$(CFG_HOST_TRIPLE))
rustllvm/%.d: rustllvm/%.cpp $(MKFILE_DEPS) $(LLVM_CONFIG_$(CFG_HOST_TRIPLE))
@$(call E, dep: $@)
$(Q)$(call CFG_DEPEND_C, $@ \
$(subst $(S)src/,,$(patsubst %.cpp, %.o, $<)), \

View File

@ -53,7 +53,7 @@ PKG_FILES = \
$(COMPILETEST_CRATE) \
$(COMPILETEST_INPUTS) \
$(PKG_PP_EXAMPLES) \
$(MKFILES)
$(MKFILE_DEPS)
dist: $(PKG_TAR) $(PKG_EXE)

View File

@ -8,7 +8,7 @@ doc/keywords.texi: $(S)doc/keywords.txt $(S)src/etc/gen-keywords-table.py
@$(call E, gen-keywords-table: $@)
$(Q)$(S)src/etc/gen-keywords-table.py
doc/version.texi: $(MKFILES) rust.texi
doc/version.texi: $(MKFILE_DEPS) rust.texi
@$(call E, version-stamp: $@)
$(Q)echo "@macro gitversion" >$@
$(Q)echo "$(CFG_VERSION)" >>$@

View File

@ -131,22 +131,23 @@ RUNTIME_OBJS_$(1) := $$(RUNTIME_CS_$(1):rt/%.cpp=rt/$(1)/%.o) \
$$(RUNTIME_S_$(1):rt/%.S=rt/$(1)/%.o)
RUNTIME_LIBS_$(1) := $$(LIBUV_LIB_$(1))
rt/$(1)/%.o: rt/%.cpp $$(MKFILES)
rt/$(1)/%.o: rt/%.cpp $$(MKFILE_DEPS)
@$$(call E, compile: $$@)
$$(Q)$$(call CFG_COMPILE_C_$(1), $$@, $$(RUNTIME_INCS_$(1))) $$<
rt/$(1)/%.o: rt/%.S $$(MKFILES)
rt/$(1)/%.o: rt/%.S $$(MKFILE_DEPS)
@$$(call E, compile: $$@)
$$(Q)$$(call CFG_COMPILE_C_$(1), $$@, $$(RUNTIME_INCS_$(1))) $$<
rt/$(1)/arch/$$(HOST_$(1))/libmorestack.a: rt/$(1)/arch/$$(HOST_$(1))/morestack.o
rt/$(1)/arch/$$(HOST_$(1))/libmorestack.a: \
rt/$(1)/arch/$$(HOST_$(1))/morestack.o
@$$(call E, link: $$@)
$$(Q)ar rcs $$@ $$<
rt/$(1)/$(CFG_RUNTIME): $$(RUNTIME_OBJS_$(1)) $$(MKFILES) \
$$(RUNTIME_HDR_$(1)) \
$$(RUNTIME_DEF_$(1)) \
$$(RUNTIME_LIBS_$(1))
rt/$(1)/$(CFG_RUNTIME): $$(RUNTIME_OBJS_$(1)) $$(MKFILE_DEPS) \
$$(RUNTIME_HDR_$(1)) \
$$(RUNTIME_DEF_$(1)) \
$$(RUNTIME_LIBS_$(1))
@$$(call E, link: $$@)
$$(Q)$$(call CFG_LINK_C_$(1),$$@, $$(RUNTIME_OBJS_$(1)) \
$$(CFG_GCCISH_POST_LIB_FLAGS) $$(RUNTIME_LIBS_$(1)) \
@ -172,18 +173,18 @@ $$(LIBUV_LIB_$(1)): $$(wildcard \
# These could go in rt.mk or rustllvm.mk, they're needed for both.
# This regexp has a single $, escaped twice
%.linux.def: %.def.in $$(MKFILES)
%.linux.def: %.def.in $$(MKFILE_DEPS)
@$$(call E, def: $$@)
$$(Q)echo "{" > $$@
$$(Q)sed 's/.$$$$/&;/' $$< >> $$@
$$(Q)echo "};" >> $$@
%.darwin.def: %.def.in $$(MKFILES)
%.darwin.def: %.def.in $$(MKFILE_DEPS)
@$$(call E, def: $$@)
$$(Q)sed 's/^./_&/' $$< > $$@
ifdef CFG_WINDOWSY
%.def: %.def.in $$(MKFILES)
%.def: %.def.in $$(MKFILE_DEPS)
@$$(call E, def: $$@)
$$(Q)echo LIBRARY $$* > $$@
$$(Q)echo EXPORTS >> $$@

View File

@ -19,14 +19,14 @@ RUSTLLVM_INCS_$(1) = -iquote $$(LLVM_INCDIR_$(1)) \
RUSTLLVM_OBJS_OBJS_$(1) := $$(RUSTLLVM_OBJS_CS_$(1):rustllvm/%.cpp=rustllvm/$(1)/%.o)
rustllvm/$(1)/$(CFG_RUSTLLVM): $$(RUSTLLVM_OBJS_OBJS_$(1)) \
$$(MKFILES) $$(RUSTLLVM_DEF_$(1))
$$(MKFILE_DEPS) $$(RUSTLLVM_DEF_$(1))
@$$(call E, link: $$@)
$$(Q)$$(call CFG_LINK_C_$(1),$$@,$$(RUSTLLVM_OBJS_OBJS_$(1)) \
$$(CFG_GCCISH_PRE_LIB_FLAGS) $$(LLVM_LIBS_$(1)) \
$$(CFG_GCCISH_POST_LIB_FLAGS) \
$$(LLVM_LDFLAGS_$(1)),$$(RUSTLLVM_DEF_$(1)),$$(CFG_RUSTLLVM))
rustllvm/$(1)/%.o: rustllvm/%.cpp $$(MKFILES) $$(LLVM_CONFIG_$(1))
rustllvm/$(1)/%.o: rustllvm/%.cpp $$(MKFILE_DEPS) $$(LLVM_CONFIG_$(1))
@$$(call E, compile: $$@)
$$(Q)$$(call CFG_COMPILE_C_$(1), $$@, $$(LLVM_CXXFLAGS_$(1)) $$(RUSTLLVM_INCS_$(1))) $$<
endef

View File

@ -2,7 +2,7 @@
$(HBIN0_H_$(CFG_HOST_TRIPLE))/rustc$(X): \
$(S)src/snapshots.txt \
$(S)src/etc/get-snapshot.py $(MKFILES)
$(S)src/etc/get-snapshot.py $(MKFILE_DEPS)
@$(call E, fetch: $@)
$(Q)$(S)src/etc/get-snapshot.py $(CFG_HOST_TRIPLE)
$(Q)touch $@
@ -50,5 +50,7 @@ $$(HLIB0_H_$(1))/$(CFG_RUSTLLVM): \
endef
# Use stage1 to build other architectures: then you don't have to wait
# for stage2, but you get the latest updates to the compiler source.
$(foreach t,$(NON_HOST_TRIPLES), \
$(eval $(call BOOTSTRAP_STAGE0,$(t),2,$(CFG_HOST_TRIPLE))))
$(eval $(call BOOTSTRAP_STAGE0,$(t),1,$(CFG_HOST_TRIPLE))))

View File

@ -201,62 +201,62 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
--rustcflags "$$(CFG_RUSTC_FLAGS) --target=$(2)" \
$$(CTEST_TESTARGS)
CFAIL_ARGS$(1)-T-$(2)-H-$(3) := \
CFAIL_ARGS$(1)-T-$(2)-H-$(3) := \
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
--src-base $$(S)src/test/compile-fail/ \
--build-base test/compile-fail/ \
--build-base $(3)/test/compile-fail/ \
--mode compile-fail
RFAIL_ARGS$(1)-T-$(2)-H-$(3) := \
RFAIL_ARGS$(1)-T-$(2)-H-$(3) := \
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
--src-base $$(S)src/test/run-fail/ \
--build-base test/run-fail/ \
--build-base $(3)/test/run-fail/ \
--mode run-fail \
$$(CTEST_RUNTOOL)
RPASS_ARGS$(1)-T-$(2)-H-$(3) := \
RPASS_ARGS$(1)-T-$(2)-H-$(3) := \
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
--src-base $$(S)src/test/run-pass/ \
--build-base test/run-pass/ \
--build-base $(3)/test/run-pass/ \
--mode run-pass \
$$(CTEST_RUNTOOL)
BENCH_ARGS$(1)-T-$(2)-H-$(3) := \
BENCH_ARGS$(1)-T-$(2)-H-$(3) := \
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
--src-base $$(S)src/test/bench/ \
--build-base test/bench/ \
--build-base $(3)/test/bench/ \
--mode run-pass \
$$(CTEST_RUNTOOL)
PERF_ARGS$(1)-T-$(2)-H-$(3) := \
PERF_ARGS$(1)-T-$(2)-H-$(3) := \
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
--src-base $$(S)src/test/bench/ \
--build-base test/perf/ \
--build-base $(3)/test/perf/ \
--mode run-pass \
$$(CTEST_PERF_RUNTOOL)
PRETTY_RPASS_ARGS$(1)-T-$(2)-H-$(3) := \
PRETTY_RPASS_ARGS$(1)-T-$(2)-H-$(3) := \
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
--src-base $$(S)src/test/run-pass/ \
--build-base test/run-pass/ \
--build-base $(3)/test/run-pass/ \
--mode pretty
PRETTY_RFAIL_ARGS$(1)-T-$(2)-H-$(3) := \
PRETTY_RFAIL_ARGS$(1)-T-$(2)-H-$(3) := \
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
--src-base $$(S)src/test/run-fail/ \
--build-base test/run-fail/ \
--build-base $(3)/test/run-fail/ \
--mode pretty
PRETTY_BENCH_ARGS$(1)-T-$(2)-H-$(3) := \
PRETTY_BENCH_ARGS$(1)-T-$(2)-H-$(3) := \
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
--src-base $$(S)src/test/bench/ \
--build-base test/bench/ \
--build-base $(3)/test/bench/ \
--mode pretty
PRETTY_PRETTY_ARGS$(1)-T-$(2)-H-$(3) := \
PRETTY_PRETTY_ARGS$(1)-T-$(2)-H-$(3) := \
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
--src-base $$(S)src/test/pretty/ \
--build-base test/pretty/ \
--build-base $(3)/test/pretty/ \
--mode pretty
check-stage$(1)-T-$(2)-H-$(3)-cfail-dummy: \

View File

@ -45,6 +45,7 @@ $$(HBIN$(2)_H_$(4))/compiletest$$(X): \
endef
$(eval $(call TOOLS_STAGE_N,0,1,$(CFG_HOST_TRIPLE),$(CFG_HOST_TRIPLE)))
$(eval $(call TOOLS_STAGE_N,1,2,$(CFG_HOST_TRIPLE),$(CFG_HOST_TRIPLE)))
$(eval $(call TOOLS_STAGE_N,2,3,$(CFG_HOST_TRIPLE),$(CFG_HOST_TRIPLE)))
$(foreach host,$(CFG_TARGET_TRIPLES), \
$(eval $(call TOOLS_STAGE_N,0,1,$(host),$(host))) \
$(eval $(call TOOLS_STAGE_N,1,2,$(host),$(host))) \
$(eval $(call TOOLS_STAGE_N,2,3,$(host),$(host))))