[infer][PR] fix installation of alias binaries

Summary:
The former Makefile does not work when $(LN) is cp, because
it tries to copy a binary that has not been installed yet
Pull Request resolved: https://github.com/facebook/infer/pull/1060

Differential Revision: D14044696

Pulled By: jvillard

fbshipit-source-id: f89d9db81
master
Boris Yakobowski 6 years ago committed by Facebook Github Bot
parent 4c4bb84e2c
commit 31a6b92902

@ -74,6 +74,7 @@ XCODE_SELECT = @XCODE_SELECT@
XCODE_BASE = @XCODE_BASE@
HAS_OBJC = @HAS_OBJC@
XCPRETTY = @XCPRETTY@
WINDOWS_BUILD = @WINDOWS_BUILD@
ifneq (,$(findstring s,$(MAKEFLAGS)))
# quiet mode

@ -49,6 +49,18 @@ AS_IF([test "x$CLANG_INCLUDES" = "x"], [
CLANG_INCLUDES="$CLANG_PREFIX/include"
])
windows_build=no
AC_MSG_CHECKING([for Windows build])
# see https://stackoverflow.com/questions/714100/os-detecting-makefile
# but we do this in the configure for homogeneity
case "${OS}" in
Windows_NT*)
windows_build=yes
;;
esac
WINDOWS_BUILD=$windows_build
AC_MSG_RESULT([$WINDOWS_BUILD])
AC_SUBST([WINDOWS_BUILD])
AC_ARG_ENABLE(c-analyzers,
AS_HELP_STRING([--disable-c-analyzers],

@ -122,15 +122,20 @@ doc: $(SRC_BUILD_COMMON) $(MAKEFILE_LIST)
INFER_BIN_ALIASES = $(foreach alias,$(INFER_COMMANDS),$(BIN_DIR)/$(alias))
$(INFER_BIN_ALIASES): Makefile
# make sure the bin directory exists
$(QUIET)$(MKDIR_P) $(@D)
$(INFER_BIN_ALIASES): Makefile $(BIN_DIR)/$(INFER_MAIN)
$(REMOVE) $@
$(QUIET)cd $(@D) && $(LN_S) -f infer $(@F)
$(QUIET)touch $@
$(INFER_BIN).exe: $(INFER_BUILD_DIR)/$(INFER_MAIN).exe $(INFER_BIN_ALIASES)
$(INFER_BIN).exe: $(INFER_BUILD_DIR)/$(INFER_MAIN).exe
$(QUIET)$(MKDIR_P) $(BIN_DIR)
ifeq ($(WINDOWS_BUILD),yes)
# http://cygwin.1069669.n5.nabble.com/cp-utility-bug-when-dest-name-exe-file-exist-tp57955p58001.html
$(REMOVE) $(INFER_BIN) $(INFER_BIN).exe
endif
$(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFER_MAIN).exe $(INFER_BIN)
$(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFER_MAIN).exe $(INFER_BIN).exe
$(MAKE) $(INFER_BIN_ALIASES)
ifeq ($(IS_FACEBOOK_TREE),yes)
$(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFER_CREATE_TRACEVIEW_LINKS_MAIN).exe \
$(INFER_CREATE_TRACEVIEW_LINKS_BIN)
@ -144,9 +149,15 @@ $(INFER_BUILD_DIR)/$(INFER_MAIN).bc: $(SRC_BUILD_COMMON) $(MAKEFILE_LIST)
dune build $(INFER_CONFIG_TARGETS:.exe=.bc)
$(QUIET)touch $@
$(INFER_BIN).bc: $(INFER_BUILD_DIR)/$(INFER_MAIN).bc $(INFER_BIN_ALIASES)
$(INFER_BIN).bc: $(INFER_BUILD_DIR)/$(INFER_MAIN).bc
$(QUIET)$(MKDIR_P) $(BIN_DIR)
ifeq ($(WINDOWS_BUILD),yes)
# http://cygwin.1069669.n5.nabble.com/cp-utility-bug-when-dest-name-exe-file-exist-tp57955p58001.html
$(REMOVE) $(INFER_BIN) $(INFER_BIN).exe
endif
$(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFER_MAIN).bc $(INFER_BIN)
$(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFER_MAIN).bc $(INFER_BIN).bc
$(MAKE) $(INFER_BIN_ALIASES)
ifeq ($(IS_FACEBOOK_TREE),yes)
$(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFER_CREATE_TRACEVIEW_LINKS_MAIN).bc \
$(INFER_CREATE_TRACEVIEW_LINKS_BIN)

Loading…
Cancel
Save