From c42431115f7593da9f1428bfad4aa58a4843e7c3 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Fri, 1 Sep 2017 07:34:47 -0700 Subject: [PATCH] [make] clean more Summary: Keep track of generated files better and make sure we nuke them on `make clean`. Also get rid of a few unused variables in infer/src/Makefile. Reviewed By: sblackshear Differential Revision: D5754553 fbshipit-source-id: b5fca41 --- infer/src/Makefile | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/infer/src/Makefile b/infer/src/Makefile index da37d0d18..0dd80b88e 100644 --- a/infer/src/Makefile +++ b/infer/src/Makefile @@ -40,18 +40,10 @@ INFER_CREATE_TRACEVIEW_LINKS_MAIN = $(INFER_CREATE_TRACEVIEW_LINKS_MODULE) ### InferUnit declarations ### -UNIT_SOURCES = unit - INFERUNIT_MAIN = inferunit -#### Java declarations #### - -JAVA_SOURCES = java - #### Clang declarations #### -CLANG_SOURCES = clang - CLANG_PLUGIN_MIRROR = atd FCP_CLANG_OCAML_BUILD_DIR = $(FCP_CLANG_OCAML_DIR)/build @@ -75,8 +67,6 @@ CLANG_BINIOU_DICT = $(ETC_DIR)/clang_ast.dict #### scripts declarations #### -SCRIPT_SOURCES = scripts - CHECKCOPYRIGHT_BIN = $(SCRIPT_DIR)/checkCopyright CHECKCOPYRIGHT_MAIN = checkCopyright @@ -106,7 +96,11 @@ OCAML_SOURCES = \ .PHONY: all all: infer -SRC_BUILD_COMMON = jbuild atd/jbuild istd/jbuild scripts/jbuild jbuild-workspace $(OCAML_SOURCES) +GENERATED_FROM_AUTOCONF = jbuild.common jbuild-workspace base/Version.ml + +GENERATED_JBUILDS = jbuild atd/jbuild istd/jbuild scripts/jbuild + +SRC_BUILD_COMMON = $(GENERATED_FROM_AUTOCONF) $(GENERATED_JBUILDS) $(OCAML_SOURCES) ifeq ($(BUILD_C_ANALYZERS),yes) SRC_BUILD_COMMON += $(CLANG_BINIOU_DICT) endif @@ -246,7 +240,7 @@ $(CLANG_BINIOU_DICT): $(CLANG_ATDGEN_STUB_ATD) | sort | uniq \ > $@ -jbuild.common jbuild-workspace base/Version.ml: $(MAKEFILE_LIST) +$(GENERATED_FROM_AUTOCONF): $(MAKEFILE_LIST) TMPFILE=$$(mktemp $@.tmp.XXXX); \ INFER_GIT_COMMIT=$$(git --work-tree=$(ROOT_DIR) --git-dir=$(ROOT_DIR)/.git rev-parse --short HEAD || printf "unknown"); \ INFER_GIT_BRANCH=$$(git --work-tree=$(ROOT_DIR) --git-dir=$(ROOT_DIR)/.git rev-parse --abbrev-ref HEAD || printf "unknown"); \ @@ -271,7 +265,7 @@ jbuild.common: jbuild.common.in jbuild-workspace: jbuild-workspace.in base/Version.ml: base/Version.ml.in -jbuild atd/jbuild istd/jbuild scripts/jbuild: jbuild.common +$(GENERATED_JBUILDS): jbuild.common $(QUIET)cat $+ > $@ jbuild: jbuild.in @@ -285,7 +279,8 @@ clean: $(REMOVE) toplevel.mlpack $(REMOVE_DIR) $(BUILD_DIR) $(REMOVE) $(ETC_DIR)/clang_ast.dict - $(REMOVE) base/Version.ml jbuild atd/jbuild istd/jbuild jbuild-workspace + $(REMOVE) $(GENERATED_FROM_AUTOCONF) + $(REMOVE) $(GENERATED_JBUILDS) $(REMOVE) base/Version.ml.tmp.* jbuild.tmp.* jbuild-workspace.tmp.* # be a bit more aggressive than needed with what we remove here so that stale binaries that # only existed in previous versions get removed as well