From 25759199cfb2475ef5e546c1473fe8a4430cc03c Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Fri, 11 Nov 2016 02:45:27 -0800 Subject: [PATCH] [make] use install instead of cp when appropriate Summary: `install` will not do anything if the file didn't change, which should give `make` more opportunities to not do work. Reviewed By: jeremydubreil Differential Revision: D4161918 fbshipit-source-id: 9b9061a --- infer/models/c/Makefile | 2 +- infer/models/cpp/Makefile | 2 +- infer/models/java/Makefile | 2 +- infer/models/objc/Makefile | 2 +- infer/src/Makefile | 18 +++++++++--------- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/infer/models/c/Makefile b/infer/models/c/Makefile index 6b8552fd9..bf82ab56d 100644 --- a/infer/models/c/Makefile +++ b/infer/models/c/Makefile @@ -20,7 +20,7 @@ $(C_MODELS_FILE): $(C_MODELS_SOURCES) $(CLANG_DEPS) touch $(C_MODELS_FILE) install: $(C_MODELS_FILE) - $(INSTALL) -m 644 -C out/specs/*.specs $(SPECS_LIB_DIR) + $(INSTALL_DATA) -C out/specs/*.specs $(SPECS_LIB_DIR) clean: @rm -f $(C_MODELS_FILE) diff --git a/infer/models/cpp/Makefile b/infer/models/cpp/Makefile index 7c3ed859c..bb202e0f3 100644 --- a/infer/models/cpp/Makefile +++ b/infer/models/cpp/Makefile @@ -21,7 +21,7 @@ $(CPP_MODELS_FILE): $(CPP_MODELS_SOURCES) $(C_MODELS_SOURCES) $(CLANG_DEPS) touch $(CPP_MODELS_FILE) install: $(CPP_MODELS_FILE) - $(INSTALL) -m 644 -C out/specs/*.specs $(SPECS_LIB_DIR) + $(INSTALL_DATA) -C out/specs/*.specs $(SPECS_LIB_DIR) clean: @rm -f $(CPP_MODELS_FILE) diff --git a/infer/models/java/Makefile b/infer/models/java/Makefile index 4179ed18e..726330319 100644 --- a/infer/models/java/Makefile +++ b/infer/models/java/Makefile @@ -39,7 +39,7 @@ $(MODELS_JAR): $(INFER_REPORT) cd $(MODELS_OUT); jar cf ../$(MODELS_JAR) * $(DEPLOYED_MODELS_JAR): $(MODELS_JAR) - $(INSTALL) -m 644 -C $(MODELS_JAR) $(DEPLOYED_MODELS_JAR) + $(INSTALL_DATA) -C $(MODELS_JAR) $(DEPLOYED_MODELS_JAR) install: $(DEPLOYED_MODELS_JAR) diff --git a/infer/models/objc/Makefile b/infer/models/objc/Makefile index f1fd79142..52611a866 100644 --- a/infer/models/objc/Makefile +++ b/infer/models/objc/Makefile @@ -20,7 +20,7 @@ $(OBJC_MODELS_FILE): $(OBJC_MODELS_SOURCES) $(CLANG_DEPS) touch $(OBJC_MODELS_FILE) install: $(OBJC_MODELS_FILE) - $(INSTALL) -m 644 -C out/specs/*.specs $(SPECS_LIB_DIR) + $(INSTALL_DATA) -C out/specs/*.specs $(SPECS_LIB_DIR) clean: @rm -f $(OBJC_MODELS_FILE) diff --git a/infer/src/Makefile b/infer/src/Makefile index 0bcbd7ace..c89dfb9af 100644 --- a/infer/src/Makefile +++ b/infer/src/Makefile @@ -178,15 +178,15 @@ all: infer infer: init $(STACKTREE_ATDGEN_STUBS) $(INFERPRINT_ATDGEN_STUBS) $(OCAMLBUILD_CONFIG) -build-dir $(INFER_BUILD_DIR) $(OCAMLBUILD_NATIVE_OPTS) \ $(INFER_CONFIG_TARGETS) - $(COPY) $(INFER_BUILD_DIR)/$(INFER_MAIN).native $(INFER_BIN) - $(COPY) $(INFER_BUILD_DIR)/$(INFERANALYZE_MAIN).native $(INFERANALYZE_BIN) - $(COPY) $(INFER_BUILD_DIR)/$(INFERPRINT_MAIN).native $(INFERPRINT_BIN) - $(COPY) $(INFER_BUILD_DIR)/$(INFERUNIT_MAIN).native $(INFERUNIT_BIN) + $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFER_MAIN).native $(INFER_BIN) + $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERANALYZE_MAIN).native $(INFERANALYZE_BIN) + $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERPRINT_MAIN).native $(INFERPRINT_BIN) + $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERUNIT_MAIN).native $(INFERUNIT_BIN) ifeq ($(BUILD_JAVA_ANALYZERS),yes) - $(COPY) $(INFER_BUILD_DIR)/$(INFERJAVA_MAIN).native $(INFERJAVA_BIN) + $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERJAVA_MAIN).native $(INFERJAVA_BIN) endif ifeq ($(BUILD_C_ANALYZERS),yes) - $(COPY) $(INFER_BUILD_DIR)/$(INFERCLANG_MAIN).native $(INFERCLANG_BIN) + $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERCLANG_MAIN).native $(INFERCLANG_BIN) cd $(INFER_BUILD_DIR) && $(LN_S) -f InferClang InferClang++ && cd - endif ifeq ($(ENABLE_OCAML_ANNOT),yes) @@ -285,7 +285,7 @@ checkCopyright: $(CHECKCOPYRIGHT_BIN) $(CHECKCOPYRIGHT_BIN): sanitize $(BUILD_DIR) $(CHECKCOPYRIGHT_MAIN).ml rebuild -quiet -r -j $(NCPU) -build-dir $(INFER_BUILD_DIR) -pkgs core_extended,str -tag thread -use-ocamlfind $(CHECKCOPYRIGHT_MAIN).native - $(COPY) $(INFER_BUILD_DIR)/$(CHECKCOPYRIGHT_MAIN).native $(CHECKCOPYRIGHT_BIN) + $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(CHECKCOPYRIGHT_MAIN).native $(CHECKCOPYRIGHT_BIN) define gen_atdgen_rules # generate files using atdgen @@ -318,7 +318,7 @@ $(foreach atd_type,b j t v,\ define mirror_fcp_file $(CLANG_SOURCES)/$(notdir $(1)): $(1) - $(INSTALL) -m 644 -C $$< $$@ + $(INSTALL_DATA) -C $$< $$@ endef $(foreach file, $(FCP_FILES_TO_MIRROR), $(eval $(call mirror_fcp_file,$(file)))) @@ -354,7 +354,7 @@ version: base/Version.ml.in Makefile -e "s|@INFER_GIT_COMMIT[@]|$$INFER_GIT_COMMIT|g" \ -e "s|@INFER_GIT_BRANCH[@]|$$INFER_GIT_BRANCH|g" \ $< > "$$TMPFILE"; \ - $(INSTALL) -m 644 -C "$$TMPFILE" base/Version.ml; \ + $(INSTALL_DATA) -C "$$TMPFILE" base/Version.ml; \ rm -f "$$TMPFILE" $(BUILD_DIR):