From c0a87ab7907e88efa4a5d7cba27e876f0dab1f5b Mon Sep 17 00:00:00 2001 From: Logan Chien Date: Tue, 15 Mar 2011 09:13:32 +0800 Subject: Implement copy-when-different build rules for tblgen. Before this commit, tblgen rules will always generate new file, change the timestamp, and then a lot of c++ files have to be recompiled. This commit modifies transform-td-to-out macro. Now, tblgen will generate its output to an intermediate file. The timestamp of the inc files will only be changed when the newly generated intermediate file is different from the old one. --- llvm-host-build.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'llvm-host-build.mk') diff --git a/llvm-host-build.mk b/llvm-host-build.mk index d7ef682..fe68934 100644 --- a/llvm-host-build.mk +++ b/llvm-host-build.mk @@ -63,5 +63,7 @@ $(hide) $(TBLGEN) \ -I $(LLVM_ROOT_PATH)/lib/Target \ $(if $(strip $(CLANG_ROOT_PATH)),-I $(CLANG_ROOT_PATH)/include,) \ -gen-$(strip $(1)) \ - -o $@ $< + -o $@.tmp $< +$(hide) $(LLVM_ROOT_PATH)/copy-diff.py $@.tmp $@ +$(hide) $(RM) $@.tmp endef -- cgit v1.1