From 0820b5e81ef7ea7690be8112e92f6faddd0f6388 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Fri, 13 Apr 2018 08:10:48 -0700 Subject: [PATCH] [make] fix `install` for xargs on osx Summary: This was meant to be part of D7569054 but the wrong version landed. classicblunder Reviewed By: mbouaziz Differential Revision: D7615865 fbshipit-source-id: a29b3af --- Makefile | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 66a31b00e..7a63dd2dd 100644 --- a/Makefile +++ b/Makefile @@ -444,14 +444,14 @@ install: infer $(INFER_MANUALS_GZIPPED) 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/' - find facebook-clang-plugins/clang/install -type d -print0 | xargs -0 -I \{\} \ - $(SHELL) -c "test -d '$(DESTDIR)$(libdir)'/infer/{} || \ - $(MKDIR_P) '$(DESTDIR)$(libdir)'/infer/{}" + find facebook-clang-plugins/clang/install -type d -print0 | xargs -0 -n 1 \ + $(SHELL) -x -c "test -d '$(DESTDIR)$(libdir)'/infer/\$$1 || \ + $(MKDIR_P) '$(DESTDIR)$(libdir)'/infer/\$$1" -- test -d '$(DESTDIR)$(libdir)/infer/infer/lib/clang_wrappers/' || \ $(MKDIR_P) '$(DESTDIR)$(libdir)/infer/infer/lib/clang_wrappers/' - find infer/models/cpp/include -type d -print0 | xargs -0 -I \{\} \ - $(SHELL) -c "test -d '$(DESTDIR)$(libdir)'/infer/{} || \ - $(MKDIR_P) '$(DESTDIR)$(libdir)'/infer/{}" + find infer/models/cpp/include -type d -print0 | xargs -0 -n 1 \ + $(SHELL) -x -c "test -d '$(DESTDIR)$(libdir)'/infer/\$$1 || \ + $(MKDIR_P) '$(DESTDIR)$(libdir)'/infer/\$$1" -- test -d '$(DESTDIR)$(libdir)/infer/infer/lib/linter_rules/' || \ $(MKDIR_P) '$(DESTDIR)$(libdir)/infer/infer/lib/linter_rules/' test -d '$(DESTDIR)$(libdir)/infer/infer/etc/' || \ @@ -526,9 +526,20 @@ endif (cd '$(DESTDIR)$(libdir)'/infer/infer/bin && \ $(REMOVE) "$$alias" && \ $(LN_S) infer "$$alias"); done - find '$(MAN_DIR)'/man1 -print0 | xargs -0 \ - $(SHELL) -c '$(INSTALL_DATA) -C $$1 "$(DESTDIR)$(mandir)/man1/$$(basename $$1)"' + $(foreach man,$(INFER_MANUAL_GZIPPED), \ + $(INSTALL_DATA) -C $(man) '$(DESTDIR)$(mandir)/man1/$(notdir $(man))') ifeq ($(IS_FACEBOOK_TREE),yes) +ifdef DESTDIR +ifeq (,$(findstring :/,:$(DESTDIR))) +# DESTDIR is set and relative + $(MAKE) -C facebook install 'DESTDIR=../$(DESTDIR)' +endif +else +# DESTDIR is set and absolute + $(MAKE) -C facebook install +endif +else +# DESTDIR not set $(MAKE) -C facebook install endif