[make] let user know how to stop clang rebuilds

Summary:
Building clang takes long and sometimes only some minor step in the setup
script has changed, triggering a spurious rebuild. Print a big bold message
letting the user know of their options, but only if clang has been installed
previously.

```
(warn_clang)jul@devvm2701:~/infer$ make -j 19
[04:02:44][2288770] Facebook setup...
*** Now building clang, this will take a while...
*** If you believe that facebook-clang-plugins/clang/install is up-to-date you can(TERM_RESET)
*** interrupt the compilation (Control-C) and run this to prevent clang from being rebuilt:

      /home/jul/infer/facebook-clang-plugins/clang/setup.sh --only-record-install

(TIP: you can also force a clang rebuild by removing /home/jul/infer/facebook-clang-plugins/clang/installed.version)

[...]
```

Reviewed By: katiejots

Differential Revision: D13956431

fbshipit-source-id: da163643d
master
Jules Villard 6 years ago committed by Facebook Github Bot
parent e572bbe2b6
commit 5d3a24eb9c

@ -302,11 +302,23 @@ opt:
.PHONY: clang_setup .PHONY: clang_setup
clang_setup: clang_setup:
# if clang is already built then let the user know they might not need to rebuild clang
$(QUIET)export CC="$(CC)" CFLAGS="$(CFLAGS)"; \ $(QUIET)export CC="$(CC)" CFLAGS="$(CFLAGS)"; \
export CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)"; \ export CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)"; \
export CPP="$(CPP)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)"; \ export CPP="$(CPP)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)"; \
$(FCP_DIR)/clang/setup.sh --only-check-install || \ $(FCP_DIR)/clang/setup.sh --only-check-install || { \
$(FCP_DIR)/clang/setup.sh if [ -x '$(FCP_DIR)'/clang/install/bin/clang ]; then \
echo '$(TERM_INFO)*** Now building clang, this will take a while...$(TERM_RESET)' >&2; \
echo '$(TERM_INFO)*** If you believe that facebook-clang-plugins/clang/install is up-to-date you can$(TERM_RESET)' >&2; \
echo '$(TERM_INFO)*** interrupt the compilation (Control-C) and run this to prevent clang from being rebuilt:$(TERM_RESET)' >&2; \
echo >&2 ; \
echo '$(TERM_INFO) $(FCP_DIR)/clang/setup.sh --only-record-install$(TERM_RESET)' >&2; \
echo >&2 ; \
echo '$(TERM_INFO)(TIP: you can also force a clang rebuild by removing $(FCP_DIR)/clang/installed.version)$(TERM_RESET)' >&2; \
echo >&2 ; \
fi; \
$(FCP_DIR)/clang/setup.sh; \
}
.PHONY: clang_plugin .PHONY: clang_plugin
clang_plugin: clang_setup clang_plugin: clang_setup

Loading…
Cancel
Save