[release] install symlinks as symlinks

Summary: The clang distribution uses symlinks in some places, which avoids copying rather large binaries. `make install` was replacing these with actual copies. Try not to be so wasteful anymore.

Reviewed By: mbouaziz

Differential Revision: D8260777

fbshipit-source-id: eccabab
master
Jules Villard 7 years ago committed by Facebook Github Bot
parent 8c8bf29ccc
commit 7f9ff54638

@ -454,7 +454,7 @@ 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 -L facebook-clang-plugins/clang/install -type d -print0 | xargs -0 -n 1 \
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/' || \
@ -489,8 +489,12 @@ 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'
find -L facebook-clang-plugins/clang/install -not -type d -not -name '*.a' -print0 \
# do not use "install" for symbolic links as this will copy the destination file instead
find facebook-clang-plugins/clang/install/. -not -type d -not -type l -not -name '*.a' -print0 \
| xargs -0 -I \{\} $(INSTALL_PROGRAM) -C \{\} '$(DESTDIR)$(libdir)'/infer/\{\}
# all the symlinks in clang are relative and safe to brutally copy over
find facebook-clang-plugins/clang/install/. -type l -not -name '*.a' -print0 \
| xargs -0 -I \{\} $(COPY) -a \{\} '$(DESTDIR)$(libdir)'/infer/\{\}
find infer/lib/clang_wrappers/* -print0 | xargs -0 -I \{\} \
$(INSTALL_PROGRAM) -C \{\} '$(DESTDIR)$(libdir)'/infer/\{\}
# only for files that point to infer

Loading…
Cancel
Save