[make] print @ commands when passed VERBOSE=1

Summary:
It can be useful when debugging infer or the Makefiles themselves to see what
`make` is doing. Instead of editing Makefiles to remove `@` now you can `make
VERBOSE=1`.

This is just `git ls-files | grep -e Makefile -e '.*\.make' | xargs sed -e 's/^\t@/\t$(QUIET)/' -i`, and adding the definition of `QUIET` to Makefile.config.

Reviewed By: jeremydubreil

Differential Revision: D4779115

fbshipit-source-id: e6e4642
master
Jules Villard 8 years ago committed by Facebook Github Bot
parent fbddeba8a7
commit cd421b4a5f

@ -99,16 +99,16 @@ Makefile.autoconf: configure Makefile.autoconf.in
.PHONY: src_build
src_build: $(MAKEFILE_LIST)
ifeq ($(IS_FACEBOOK_TREE),yes)
@$(MAKE) -C facebook setup
$(QUIET)$(MAKE) -C facebook setup
endif
@$(MAKE) -C $(SRC_DIR) infer
$(QUIET)$(MAKE) -C $(SRC_DIR) infer
.PHONY: byte
byte:
ifeq ($(IS_FACEBOOK_TREE),yes)
@$(MAKE) -C facebook setup
$(QUIET)$(MAKE) -C facebook setup
endif
@$(MAKE) -C $(SRC_DIR) byte
$(QUIET)$(MAKE) -C $(SRC_DIR) byte
ifeq ($(BUILD_C_ANALYZERS),yes)
src_build: clang_plugin
@ -118,16 +118,16 @@ endif
.PHONY: infer
infer: src_build
ifeq ($(BUILD_JAVA_ANALYZERS),yes)
@$(MAKE) -C $(ANNOTATIONS_DIR)
$(QUIET)$(MAKE) -C $(ANNOTATIONS_DIR)
endif
# Delete existing specs so that they are not used during the analysis of models. Infer may
# segfault in some cases otherwise.
@$(MAKE) -C $(MODELS_DIR) clean_specs
@$(MAKE) -C $(MODELS_DIR) all
$(QUIET)$(MAKE) -C $(MODELS_DIR) clean_specs
$(QUIET)$(MAKE) -C $(MODELS_DIR) all
.PHONY: clang_setup
clang_setup:
@export CC="$(CC)" CFLAGS="$(CFLAGS)"; \
$(QUIET)export CC="$(CC)" CFLAGS="$(CFLAGS)"; \
export CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)"; \
export CPP="$(CPP)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)"; \
$(FCP_DIR)/clang/setup.sh --only-check-install || \
@ -136,14 +136,14 @@ clang_setup:
.PHONY: clang_plugin
clang_plugin: clang_setup
ifeq ($(IS_RELEASE_TREE),no)
@$(MAKE) -C $(FCP_DIR)/libtooling all \
$(QUIET)$(MAKE) -C $(FCP_DIR)/libtooling all \
CC=$(CC) CXX=$(CXX) \
CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" \
CPP="$(CPP)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)" \
LOCAL_CLANG=$(CLANG_PREFIX)/bin/clang \
CLANG_PREFIX=$(CLANG_PREFIX) \
CLANG_INCLUDES=$(CLANG_INCLUDES)
@$(MAKE) -C $(FCP_DIR)/clang-ocaml all \
$(QUIET)$(MAKE) -C $(FCP_DIR)/clang-ocaml all \
build/clang_ast_proj.ml build/clang_ast_proj.mli \
CC=$(CC) CXX=$(CXX) \
CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" \
@ -156,10 +156,10 @@ endif
.PHONY: test_build
test_build: clang_plugin
ifeq ($(IS_FACEBOOK_TREE),yes)
@$(MAKE) -C facebook setup
$(QUIET)$(MAKE) -C facebook setup
endif
@$(MAKE) -C $(SRC_DIR) TEST=1 byte
@$(MAKE) -C $(SRC_DIR) TEST=1 toplevel
$(QUIET)$(MAKE) -C $(SRC_DIR) TEST=1 byte
$(QUIET)$(MAKE) -C $(SRC_DIR) TEST=1 toplevel
.PHONY: ocaml_unit_test
ocaml_unit_test: test_build
@ -172,28 +172,28 @@ endef
.PHONY: $(DIRECT_TESTS:%=direct_%_test)
$(DIRECT_TESTS:%=direct_%_test): infer
@$(call silence_make,\
$(QUIET)$(call silence_make,\
$(MAKE) -C \
$(INFER_DIR)/tests/codetoanalyze/$(shell printf $@ | cut -f 2 -d _)/$(shell printf $@ | cut -f 3 -d _) \
test)
.PHONY: $(DIRECT_TESTS:%=direct_%_print)
$(DIRECT_TESTS:%=direct_%_print): infer
@$(call silence_make,\
$(QUIET)$(call silence_make,\
$(MAKE) -C \
$(INFER_DIR)/tests/codetoanalyze/$(shell printf $@ | cut -f 2 -d _)/$(shell printf $@ | cut -f 3 -d _) \
print)
.PHONY: $(DIRECT_TESTS:%=direct_%_clean)
$(DIRECT_TESTS:%=direct_%_clean):
@$(call silence_make,\
$(QUIET)$(call silence_make,\
$(MAKE) -C \
$(INFER_DIR)/tests/codetoanalyze/$(shell printf $@ | cut -f 2 -d _)/$(shell printf $@ | cut -f 3 -d _) \
clean)
.PHONY: $(DIRECT_TESTS:%=direct_%_replace)
$(DIRECT_TESTS:%=direct_%_replace): infer
@$(call silence_make,\
$(QUIET)$(call silence_make,\
$(MAKE) -C \
$(INFER_DIR)/tests/codetoanalyze/$(shell printf $@ | cut -f 2 -d _)/$(shell printf $@ | cut -f 3 -d _) \
replace)
@ -211,22 +211,22 @@ build_waf_print: build_make_print
.PHONY: $(BUILD_SYSTEMS_TESTS:%=build_%_test)
$(BUILD_SYSTEMS_TESTS:%=build_%_test): infer
@$(call silence_make,\
$(QUIET)$(call silence_make,\
$(MAKE) -C $(INFER_DIR)/tests/build_systems/$(patsubst build_%_test,%,$@) test)
.PHONY: $(BUILD_SYSTEMS_TESTS:%=build_%_print)
$(BUILD_SYSTEMS_TESTS:%=build_%_print): infer
@$(call silence_make,\
$(QUIET)$(call silence_make,\
$(MAKE) -C $(INFER_DIR)/tests/build_systems/$(patsubst build_%_print,%,$@) print)
.PHONY: $(BUILD_SYSTEMS_TESTS:%=build_%_clean)
$(BUILD_SYSTEMS_TESTS:%=build_%_clean):
@$(call silence_make,\
$(QUIET)$(call silence_make,\
$(MAKE) -C $(INFER_DIR)/tests/build_systems/$(patsubst build_%_clean,%,$@) clean)
.PHONY: $(BUILD_SYSTEMS_TESTS:%=build_%_replace)
$(BUILD_SYSTEMS_TESTS:%=build_%_replace): infer
@$(call silence_make,\
$(QUIET)$(call silence_make,\
$(MAKE) -C $(INFER_DIR)/tests/build_systems/$(patsubst build_%_replace,%,$@) replace)
.PHONY: build_systems_tests
@ -248,7 +248,7 @@ else
clang -c $(EXAMPLES_DIR)/hello.c \
> /dev/null
endif
@rm -f Hello.class
$(QUIET)rm -f Hello.class
$(PYTHON_DIR)/inferTraceBugs -o __test-infer-out__ \
--select 0 --max-level max > /dev/null
$(PYTHON_DIR)/inferTraceBugs -o __test-infer-out__ \
@ -257,16 +257,16 @@ endif
--select 0 --max-level max --no-source > /dev/null
$(PYTHON_DIR)/inferTraceBugs -o __test-infer-out__ \
--only-show > /dev/null
@rm -fr __test-infer-out__
$(QUIET)rm -fr __test-infer-out__
.PHONY: check_missing_mli
check_missing_mli:
@for x in $$(find $(INFER_DIR)/src -name "*.ml" -or -name "*.re"); do \
$(QUIET)for x in $$(find $(INFER_DIR)/src -name "*.ml" -or -name "*.re"); do \
test -f "$$x"i || echo Missing "$$x"i; done
.PHONY: toplevel
toplevel: clang_plugin
@$(MAKE) -C $(SRC_DIR) toplevel
$(QUIET)$(MAKE) -C $(SRC_DIR) toplevel
.PHONY: inferScriptMode_test
inferScriptMode_test: test_build
@ -275,21 +275,21 @@ inferScriptMode_test: test_build
.PHONY: checkCopyright
checkCopyright:
@$(MAKE) -C $(SRC_DIR) checkCopyright
$(QUIET)$(MAKE) -C $(SRC_DIR) checkCopyright
.PHONY: validate-skel
validate-skel:
ifeq ($(IS_FACEBOOK_TREE),yes)
@$(MAKE) -C facebook validate
$(QUIET)$(MAKE) -C facebook validate
endif
.PHONY: test
test: test_build ocaml_unit_test endtoend_test inferTraceBugs_test inferScriptMode_test \
checkCopyright validate-skel
@$(MAKE) -C $(SRC_DIR) mod_dep.dot
$(QUIET)$(MAKE) -C $(SRC_DIR) mod_dep.dot
ifeq (,$(findstring s,$(MAKEFLAGS)))
@echo "ALL TESTS PASSED"
$(QUIET)echo "ALL TESTS PASSED"
endif
.PHONY: quick-test
@ -316,13 +316,13 @@ install: infer
ifeq ($(BUILD_C_ANALYZERS),yes)
test -d $(DESTDIR)$(libdir)/infer/facebook-clang-plugins/libtooling/build/ || \
$(MKDIR_P) $(DESTDIR)$(libdir)/infer/facebook-clang-plugins/libtooling/build/
@for i in $$(find facebook-clang-plugins/clang/install -type d); do \
$(QUIET)for i in $$(find facebook-clang-plugins/clang/install -type d); do \
test -d $(DESTDIR)$(libdir)/infer/$$i || \
$(MKDIR_P) $(DESTDIR)$(libdir)/infer/$$i; \
done
test -d $(DESTDIR)$(libdir)/infer/infer/lib/clang_wrappers/ || \
$(MKDIR_P) $(DESTDIR)$(libdir)/infer/infer/lib/clang_wrappers/
@for i in $$(find infer/models/cpp/include/ -type d); do \
$(QUIET)for i in $$(find infer/models/cpp/include/ -type d); do \
test -d $(DESTDIR)$(libdir)/infer/$$i || \
$(MKDIR_P) $(DESTDIR)$(libdir)/infer/$$i; \
done
@ -356,10 +356,10 @@ endif
ifeq ($(BUILD_C_ANALYZERS),yes)
$(INSTALL_DATA) -C facebook-clang-plugins/libtooling/build/FacebookClangPlugin.dylib \
$(DESTDIR)$(libdir)/infer/facebook-clang-plugins/libtooling/build/FacebookClangPlugin.dylib
@for i in $$(find facebook-clang-plugins/clang/install -not -type d); do \
$(QUIET)for i in $$(find facebook-clang-plugins/clang/install -not -type d); do \
$(INSTALL_PROGRAM) -C $$i $(DESTDIR)$(libdir)/infer/$$i; \
done
@for i in $$(find infer/lib/clang_wrappers/*); do \
$(QUIET)for i in $$(find infer/lib/clang_wrappers/*); do \
$(INSTALL_PROGRAM) -C $$i $(DESTDIR)$(libdir)/infer/$$i; \
done
# only for files that point to InferClang
@ -368,10 +368,10 @@ ifeq ($(BUILD_C_ANALYZERS),yes)
[ $(cc) -ef $(INFERCLANG_BIN) ] && \
$(REMOVE) $(notdir $(cc)) && \
$(LN_S) ../../bin/InferClang $(notdir $(cc));))
@for i in $$(find infer/lib/specs/*); do \
$(QUIET)for i in $$(find infer/lib/specs/*); do \
$(INSTALL_DATA) -C $$i $(DESTDIR)$(libdir)/infer/$$i; \
done
@for i in $$(find infer/models/cpp/include/ -not -type d); do \
$(QUIET)for i in $$(find infer/models/cpp/include/ -not -type d); do \
$(INSTALL_DATA) -C $$i $(DESTDIR)$(libdir)/infer/$$i; \
done
$(INSTALL_DATA) -C infer/lib/linter_rules/linters.al \
@ -381,20 +381,20 @@ ifeq ($(BUILD_C_ANALYZERS),yes)
$(LN_S) -f InferClang InferClang++)
endif
ifneq ($(XCODE_SELECT),no)
@for i in $$(find infer/lib/xcode_wrappers/*); do \
$(QUIET)for i in $$(find infer/lib/xcode_wrappers/*); do \
$(INSTALL_PROGRAM) -C $$i $(DESTDIR)$(libdir)/infer/$$i; \
done
endif
ifeq ($(BUILD_JAVA_ANALYZERS),yes)
$(INSTALL_DATA) -C infer/annotations/annotations.jar \
$(DESTDIR)$(libdir)/infer/infer/annotations/annotations.jar
@for i in infer/lib/java/*.jar; do \
$(QUIET)for i in infer/lib/java/*.jar; do \
$(INSTALL_DATA) -C $$i $(DESTDIR)$(libdir)/infer/$$i; \
done
$(INSTALL_PROGRAM) -C $(LIB_DIR)/wrappers/javac \
$(DESTDIR)$(libdir)/infer/infer/lib/wrappers/
endif
@for i in $$(find infer/lib/python/inferlib/* -type f); do \
$(QUIET)for i in $$(find infer/lib/python/inferlib/* -type f); do \
$(INSTALL_DATA) -C $$i $(DESTDIR)$(libdir)/infer/$$i; \
done
$(INSTALL_PROGRAM) -C infer/lib/python/infer.py \
@ -414,24 +414,24 @@ endif
$(LN_S) $(libdir_relative_to_bindir)/infer/infer/lib/python/inferTraceBugs inferTraceBugs)
ifeq ($(IS_FACEBOOK_TREE),yes)
@$(MAKE) -C facebook install
$(QUIET)$(MAKE) -C facebook install
endif
.PHONY: clean
clean: test_clean
ifeq ($(IS_RELEASE_TREE),no)
ifeq ($(BUILD_C_ANALYZERS),yes)
@$(MAKE) -C $(FCP_DIR) clean
@$(MAKE) -C $(FCP_DIR)/clang-ocaml clean
$(QUIET)$(MAKE) -C $(FCP_DIR) clean
$(QUIET)$(MAKE) -C $(FCP_DIR)/clang-ocaml clean
endif
endif
@$(MAKE) -C $(SRC_DIR) clean
@$(MAKE) -C $(ANNOTATIONS_DIR) clean
@$(MAKE) -C $(MODELS_DIR) clean
$(QUIET)$(MAKE) -C $(SRC_DIR) clean
$(QUIET)$(MAKE) -C $(ANNOTATIONS_DIR) clean
$(QUIET)$(MAKE) -C $(MODELS_DIR) clean
ifeq ($(IS_FACEBOOK_TREE),yes)
@$(MAKE) -C facebook clean
$(QUIET)$(MAKE) -C facebook clean
endif
@$(MAKE) -C $(DEPENDENCIES_DIR)/ocamldot clean
$(QUIET)$(MAKE) -C $(DEPENDENCIES_DIR)/ocamldot clean
find $(INFER_DIR)/tests -name '*.o' -or -name '*.o.sh' -delete
.PHONY: conf-clean
@ -453,9 +453,9 @@ conf-clean: clean
# print any variable for Makefile debugging
print-%:
@echo '$*=$($*)'
$(QUIET)echo '$*=$($*)'
# print list of targets
.PHONY: show-targets
show-targets:
@$(MAKE) -pqrR . | grep --only-matching -e '^[a-zA-Z0-9][^ ]*:' | cut -d ':' -f 1 | sort
$(QUIET)$(MAKE) -pqrR . | grep --only-matching -e '^[a-zA-Z0-9][^ ]*:' | cut -d ':' -f 1 | sort

@ -100,3 +100,7 @@ endif
define silent_on_success
$(1) >/dev/null 2>/dev/null || ($(1) && exit 1)
endef
ifneq ($(VERBOSE),1)
QUIET = @
endif

@ -28,6 +28,6 @@ $(SOURCES_JAR): $(ANNOT_SOURCES)
jar cvf $(SOURCES_JAR) $(SOURCES_DIR)/com
clean:
@$(REMOVE_DIR) $(ANNOT_CLASSES)
@$(REMOVE) $(ANNOTATIONS_JAR)
@$(REMOVE) $(SOURCES_JAR)
$(QUIET)$(REMOVE_DIR) $(ANNOT_CLASSES)
$(QUIET)$(REMOVE) $(ANNOTATIONS_JAR)
$(QUIET)$(REMOVE) $(SOURCES_JAR)

@ -32,17 +32,17 @@ clean_specs:
$(REMOVE) $(SPECS_LIB_DIR)/*.specs
$(CLANG_SUBDIRS):
@$(MAKE) -C $@ install
$(QUIET)$(MAKE) -C $@ install
clang: $(CLANG_SUBDIRS)
java:
@$(MAKE) -C $@ install
$(QUIET)$(MAKE) -C $@ install
clean: clean_specs
@$(MAKE) -C $(JAVA_MODELS_DIR) clean
@$(MAKE) -C $(C_MODELS_DIR) clean
@$(MAKE) -C $(CPP_MODELS_DIR) clean
$(QUIET)$(MAKE) -C $(JAVA_MODELS_DIR) clean
$(QUIET)$(MAKE) -C $(C_MODELS_DIR) clean
$(QUIET)$(MAKE) -C $(CPP_MODELS_DIR) clean
ifneq (no, $(XCODE_SELECT))
@$(MAKE) -C $(OBJC_MODELS_DIR) clean
$(QUIET)$(MAKE) -C $(OBJC_MODELS_DIR) clean
endif

@ -19,14 +19,14 @@ $(INFER_RESULTS): $(C_MODELS_SOURCES) $(CLANG_DEPS_NO_MODELS)
$(INFER_BIN) -o $(@D) --models-mode --no-failures-allowed -- $(MAKE) -C src clean all)
$(C_MODELS_FILE): $(INFER_RESULTS)
@$(INSTALL_DATA) $(dir $(INFER_RESULTS))/specs/*.specs $(SPECS_LIB_DIR)
@touch $@
$(QUIET)$(INSTALL_DATA) $(dir $(INFER_RESULTS))/specs/*.specs $(SPECS_LIB_DIR)
$(QUIET)touch $@
install: $(C_MODELS_FILE)
clean:
$(REMOVE) $(C_MODELS_FILE)
$(REMOVE_DIR) $(dir $(INFER_RESULTS))
@$(MAKE) -C src clean
$(QUIET)$(MAKE) -C src clean
.PHONY: all clean install

@ -6,7 +6,7 @@ CFLAGS=-c -w
all: $(OBJECTS)
clean:
@rm -rf $(OBJECTS)
$(QUIET)rm -rf $(OBJECTS)
%.o: %.c
$(CC) $(CFLAGS) $< -o $@

@ -20,14 +20,14 @@ $(INFER_RESULTS): $(CPP_MODELS_SOURCES) $(C_MODELS_SOURCES) $(CLANG_DEPS_NO_MODE
$(INFER_BIN) -o $(@D) --models-mode --no-failures-allowed -- $(MAKE) -C src clean all)
$(CPP_MODELS_FILE): $(INFER_RESULTS)
@$(INSTALL_DATA) $(dir $(INFER_RESULTS))/specs/*.specs $(SPECS_LIB_DIR)
@touch $@
$(QUIET)$(INSTALL_DATA) $(dir $(INFER_RESULTS))/specs/*.specs $(SPECS_LIB_DIR)
$(QUIET)touch $@
install: $(CPP_MODELS_FILE)
clean:
$(REMOVE) $(CPP_MODELS_FILE)
$(REMOVE_DIR) $(dir $(INFER_RESULTS))
@$(MAKE) -C src clean
$(QUIET)$(MAKE) -C src clean
.PHONY: all clean install

@ -7,7 +7,7 @@ CXXFLAGS=-c -w -std=c++11 -isystem../include
all: $(OBJECTS)
clean:
@rm -rf $(OBJECTS)
$(QUIET)rm -rf $(OBJECTS)
%.o: %.cpp
$(CXX) $(CXXFLAGS) $< -o $@

@ -20,17 +20,17 @@ MODELS_CLASSPATH = $(ANDROID_JAR):$(GUAVA_JAR):$(JACKSON_JAR):$(JSR_305_JAR):$(I
all: $(MODELS_JAR)
clean:
@rm -fr $(MODELS_OUT)
@rm -f $(MODELS_JAR)
@rm -f $(JAVA_MODELS_JAR)
$(QUIET)rm -fr $(MODELS_OUT)
$(QUIET)rm -f $(MODELS_JAR)
$(QUIET)rm -f $(JAVA_MODELS_JAR)
compile:
$(JAVAC) -bootclasspath $(ANDROID_JAR) -d $(MODELS_OUT) -classpath $(MODELS_CLASSPATH) $(JAVA_SOURCES)
$(INFER_REPORT): $(JAVA_DEPS_NO_MODELS) $(JAVA_SOURCES)
@rm -fr $(MODELS_OUT)
$(QUIET)rm -fr $(MODELS_OUT)
mkdir -p $(MODELS_OUT)
@rm -f $(JAVA_MODELS_JAR)
$(QUIET)rm -f $(JAVA_MODELS_JAR)
$(call silent_on_success,\
$(INFER_BIN) --jobs 1 --results-dir $(INFER_RESULTS_DIR) --models-mode -- \
$(JAVAC) -bootclasspath $(ANDROID_JAR) -d $(MODELS_OUT) -classpath $(MODELS_CLASSPATH) \

@ -19,14 +19,14 @@ $(INFER_RESULTS): $(OBJC_MODELS_SOURCES) $(CLANG_DEPS_NO_MODELS)
$(INFER_BIN) -o $(@D) --models-mode --no-failures-allowed -- $(MAKE) -C src clean all)
$(OBJC_MODELS_FILE): $(INFER_RESULTS)
@$(INSTALL_DATA) $(dir $(INFER_RESULTS))/specs/*.specs $(SPECS_LIB_DIR)
@touch $@
$(QUIET)$(INSTALL_DATA) $(dir $(INFER_RESULTS))/specs/*.specs $(SPECS_LIB_DIR)
$(QUIET)touch $@
install: $(OBJC_MODELS_FILE)
clean:
$(REMOVE) $(OBJC_MODELS_FILE)
$(REMOVE_DIR) $(dir $(INFER_RESULTS))
@$(MAKE) -C src clean
$(QUIET)$(MAKE) -C src clean
.PHONY: all clean install

@ -19,7 +19,7 @@ CFLAGS=--target=x86_64-apple-darwin14 -x objective-c -c -mios-simulator-version-
all: $(OBJECTS)
clean:
@rm -rf $(OBJECTS)
$(QUIET)rm -rf $(OBJECTS)
%.o: %.m
$(CC) $(CFLAGS) $< -o $@

@ -204,7 +204,7 @@ $(STUBS_HAVE_BEEN_BUILT): $(wildcard ffi/*.ml) $(MAKEFILE_LIST)
$(STUBS_BUILD_DIR)/ffi/GenerateML.native > ffi/gen/ExternStubs.ml
$(STUBS_BUILD_DIR)/ffi/GenerateC.native > $(@D)/extern_stubs.c
$(STUBS_BUILD_DIR)/ffi/GenerateCGenerator.native > $(@D)/generate_caml_types.c
@touch $@
$(QUIET)touch $@
$(STUBS_HAVE_RUN): $(STUBS_HAVE_BEEN_BUILT) $(MAKEFILE_LIST)
# create .o file using the right flags, which ocamlfind knows about
@ -214,11 +214,11 @@ $(STUBS_HAVE_RUN): $(STUBS_HAVE_BEEN_BUILT) $(MAKEFILE_LIST)
cd $(INFER_BUILD_DIR)/$(@D) && \
$(CC) generate_caml_types.o -o generate_caml_types
$(INFER_BUILD_DIR)/$(@D)/generate_caml_types > $@
@touch $@
$(QUIET)touch $@
$(INFER_BUILD_DIR)/ffi/gen/extern_stubs.o: $(STUBS_HAVE_BEEN_BUILT)
cd $(@D) && $(OCAMLFIND) ocamlc -package ctypes.stubs extern_stubs.c
@touch $@
$(QUIET)touch $@
# single out infer.native as the source of truth for make, knowing that in fact several targets are
# produced by the build
@ -228,11 +228,11 @@ $(INFER_BUILD_DIR)/$(INFER_MAIN).native: base/Version.ml $(OCAML_CONFIG_SOURCES)
$(OCAMLBUILD_CONFIG) -build-dir $(INFER_BUILD_DIR) $(OCAMLBUILD_EXTRA_NATIVE) \
$(INFER_CONFIG_TARGETS)
# let make know that the target is up-to-date even if ocamlbuild cached it
@touch $@
$(QUIET)touch $@
$(BIN_DIR): Makefile
$(MKDIR_P) $@
@touch $@
$(QUIET)touch $@
$(INFER_BIN).native: $(INFER_BUILD_DIR)/$(INFER_MAIN).native $(BIN_DIR)
$(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERANALYZE_MAIN).native $(INFERANALYZE_BIN)
@ -254,7 +254,7 @@ $(INFER_BUILD_DIR)/$(INFER_MAIN).byte: base/Version.ml $(STUBS_DEPS) $(OCAML_CON
$(MKDIR_P) $(BASE_BUILD_DIR)
$(OCAMLBUILD_CONFIG) -build-dir $(INFER_BUILD_DIR) $(OCAMLBUILD_EXTRA_BYTE) \
$(INFER_CONFIG_TARGETS:.native=.byte) $(INFERUNIT_MAIN).byte
@touch $@
$(QUIET)touch $@
$(INFER_BIN).byte: $(INFER_BUILD_DIR)/$(INFER_MAIN).byte $(BIN_DIR)
$(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERANALYZE_MAIN).byte $(INFERANALYZE_BIN)
@ -320,7 +320,7 @@ mod_dep.pdf: mod_dep.dot
.PHONY: dsort
dsort:
@ocamldep.opt -sort $(inc_flags) -ml-synonym .re -mli-synonym .rei $(ml_src_files) -pp refmt $(re_src_files)
$(QUIET)ocamldep.opt -sort $(inc_flags) -ml-synonym .re -mli-synonym .rei $(ml_src_files) -pp refmt $(re_src_files)
define to_ocaml_module
$(shell \
@ -350,7 +350,7 @@ $(INFER_BUILD_DIR)/toplevel.cmo: toplevel.mlpack
$(OCAMLBUILD_CONFIG) -build-dir $(INFER_BUILD_DIR) $(OCAMLBUILD_EXTRA_BYTE) toplevel.cmo
cd $(INFER_BUILD_DIR)/ffi/gen && \
ocamlmklib -o externstubslib ExternStubs.cmo extern_stubs.o
@touch $@
$(QUIET)touch $@
.PHONY: toplevel
toplevel: $(INFER_BUILD_DIR)/toplevel.cmo

@ -30,7 +30,7 @@ print: issues.exp.test$(TEST_SUFFIX)
.PHONY: test
test: issues.exp.test$(TEST_SUFFIX)
@cd $(TESTS_DIR) && \
$(QUIET)cd $(TESTS_DIR) && \
diff -u $(TEST_REL_DIR)/issues.exp $(TEST_REL_DIR)/issues.exp.test$(TEST_SUFFIX)
.PHONY: print

@ -19,8 +19,8 @@ include $(TESTS_DIR)/base.make
../codetoanalyze/path\ with\ spaces/hel\ lo.c: ../codetoanalyze/path_with_spaces/hel_lo.c
# make does not want to interpret "$(@D)" in the right way here...
$(MKDIR_P) ../codetoanalyze/path\ with\ spaces/
@cp "$<" "$@"
@touch "$@"
$(QUIET)cp "$<" "$@"
$(QUIET)touch "$@"
compile_commands.json: compile_commands.json.in
sed -e 's#%pwd%#$(CURDIR)#g' $< > $@ || $(REMOVE) $@

@ -21,8 +21,8 @@ include $(TESTS_DIR)/base.make
../codetoanalyze/path\ with\ spaces/hel\ lo.c: ../codetoanalyze/path_with_spaces/hel_lo.c
# make does not want to interpret "$(@D)" in the right way here...
$(MKDIR_P) ../codetoanalyze/path\ with\ spaces/
@cp "$<" "$@"
@touch "$@"
$(QUIET)cp "$<" "$@"
$(QUIET)touch "$@"
compile_commands.json: compile_commands.json.in
sed -e 's#%pwd%#$(CURDIR)#g' $< > $@ || $(REMOVE) $@

@ -21,8 +21,8 @@ INFERPRINT_OPTIONS = --issues-tests
include $(TESTS_DIR)/base.make
$(CMAKE_BUILD_DIR)/Makefile: $(CMAKE_DIR)/CMakeLists.txt
@$(MKDIR_P) $(CMAKE_BUILD_DIR)
@cd $(CMAKE_BUILD_DIR) && \
$(QUIET)$(MKDIR_P) $(CMAKE_BUILD_DIR)
$(QUIET)cd $(CMAKE_BUILD_DIR) && \
$(CMAKE) ..
$(OBJECTS): $(SOURCES) $(CMAKE_BUILD_DIR)/Makefile
@ -31,7 +31,7 @@ $(OBJECTS): $(SOURCES) $(CMAKE_BUILD_DIR)/Makefile
infer-out/report.json: $(SOURCES) $(CMAKE_DIR)/CMakeLists.txt $(CLANG_DEPS)
# nuke the build dir and recreate everything to avoid stale compilation/analysis results
@$(REMOVE_DIR) $(CMAKE_ANALYZE_DIR) && \
$(QUIET)$(REMOVE_DIR) $(CMAKE_ANALYZE_DIR) && \
$(MKDIR_P) $(CMAKE_ANALYZE_DIR) && \
cd $(CMAKE_ANALYZE_DIR) && \
$(call silent_on_success,\
@ -39,4 +39,4 @@ infer-out/report.json: $(SOURCES) $(CMAKE_DIR)/CMakeLists.txt $(CLANG_DEPS)
$(call silent_on_success,\
$(INFER_BIN) -a $(ANALYZER) $(INFER_OPTIONS) -- $(MAKE) -C $(CMAKE_ANALYZE_DIR))
# cmake makes all paths absolute
@sed -i -e 's#$(abspath $(TESTS_DIR))/##g' $@
$(QUIET)sed -i -e 's#$(abspath $(TESTS_DIR))/##g' $@

@ -7,4 +7,4 @@ all: $(OBJECTS)
$(CC) -c $<
clean:
@rm -rf $(OBJECTS)
$(QUIET)rm -rf $(OBJECTS)

@ -40,7 +40,7 @@ print: issues.exp.test
.PHONY: test
test: issues.exp.test
@cd $(TESTS_DIR) && \
$(QUIET)cd $(TESTS_DIR) && \
diff -u $(TEST_REL_DIR)/issues.exp $(TEST_REL_DIR)/issues.exp.test
.PHONY: replace

@ -41,4 +41,4 @@ $(JSON_REPORT): $(JAVA_DEPS) $(JAVA_SOURCE_FILES)
infer-out/report.json: $(JSON_REPORT)
$(MKDIR_P) infer-out
# the report contains absolute paths
@sed -e 's#$(abspath $(TESTS_DIR))/##g' $< > $@
$(QUIET)sed -e 's#$(abspath $(TESTS_DIR))/##g' $< > $@

@ -21,4 +21,4 @@ include $(TESTS_DIR)/clang.make
issues.exp.test: infer-out/report.json
# grab only a few interesting fields from the xml to prevent flakiness
@grep --only-matching -e ' \(name\|method\|rule\)="[^"]*"' infer-out/report.xml > $@
$(QUIET)grep --only-matching -e ' \(name\|method\|rule\)="[^"]*"' infer-out/report.xml > $@

@ -105,7 +105,7 @@ print: issues.exp.test
.PHONY: test
test: issues.exp.test
@cd $(TESTS_DIR) && \
$(QUIET)cd $(TESTS_DIR) && \
diff -u $(TEST_REL_DIR)/issues.exp $(TEST_REL_DIR)/issues.exp.test
.PHONY: replace

@ -31,14 +31,14 @@ print: capture
.PHONY: test
test: capture
@for file in $(SOURCES) ; do \
$(QUIET)for file in $(SOURCES) ; do \
diff -u $$file.dot $$file.test.dot || error=1 ; \
done ; \
if [ 0$$error -eq 1 ]; then exit 1; fi
.PHONY: replace
replace: capture
@for file in $(SOURCES) ; do \
$(QUIET)for file in $(SOURCES) ; do \
mv $$file.test.dot $$file.dot ; \
done

@ -46,7 +46,7 @@ print: issues.exp.test
.PHONY: test
test: issues.exp.test
@cd $(TESTS_DIR) && \
$(QUIET)cd $(TESTS_DIR) && \
diff -u $(TEST_REL_DIR)/issues.exp $(TEST_REL_DIR)/issues.exp.test
.PHONY: replace

@ -8,35 +8,35 @@
.PHONY: arc.clean
arc.clean:
@$(MAKE) -C arc clean
$(QUIET)$(MAKE) -C arc clean
.PHONY: noarc.clean
noarc.clean:
@$(MAKE) -C noarc clean
$(QUIET)$(MAKE) -C noarc clean
.PHONY: arc.print
arc.print:
@$(MAKE) -C arc print
$(QUIET)$(MAKE) -C arc print
.PHONY: noarc.print
noarc.print:
@$(MAKE) -C noarc print
$(QUIET)$(MAKE) -C noarc print
.PHONY: arc.test
arc.test:
@$(MAKE) -C arc test
$(QUIET)$(MAKE) -C arc test
.PHONY: noarc.test
noarc.test:
@$(MAKE) -C noarc test
$(QUIET)$(MAKE) -C noarc test
.PHONY: arc.replace
arc.replace:
@$(MAKE) -C arc replace
$(QUIET)$(MAKE) -C arc replace
.PHONY: noarc.replace
noarc.replace:
@$(MAKE) -C noarc replace
$(QUIET)$(MAKE) -C noarc replace
.PHONY: clean
clean: arc.clean noarc.clean

Loading…
Cancel
Save