package/clang: delete unnecessary files from target
authorValentin Korenblit <valentin.korenblit@smile.fr>
Wed, 2 May 2018 10:04:38 +0000 (12:04 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Wed, 2 May 2018 12:48:58 +0000 (14:48 +0200)
Delete:
Binaries in: /usr/bin
     /usr/libexec

Directories: /usr/lib/clang
     /usr/share/clang
     /usr/share/opt-viewer
     /usr/share/scan-build
     /usr/share/scan-view

Manual:      /usr/share/man/man1/scan-build.1

Signed-off-by: Valentin Korenblit <valentin.korenblit@smile.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/clang/clang.mk

index 88bce9af0bcf549211da45c5f36191f682409666..8d86c5edda9d2147844db490b696bb13bbcd6b19 100644 (file)
@@ -56,11 +56,26 @@ CLANG_CONF_OPTS += -DLLVM_CONFIG:FILEPATH=$(STAGING_DIR)/usr/bin/llvm-config \
 
 # Clang can't be used as compiler on the target since there are no
 # development files (headers) and other build tools. So remove clang
-# binaries from target.
-define CLANG_DELETE_BINARIES_FROM_TARGET
-       rm -f $(TARGET_DIR)/usr/bin/clang*
+# binaries and some other unnecessary files from target.
+CLANG_FILES_TO_REMOVE = \
+       /usr/bin/clang* \
+       /usr/bin/c-index-test \
+       /usr/bin/git-clang-format \
+       /usr/bin/scan-build \
+       /usr/bin/scan-view \
+       /usr/libexec/c++-analyzer \
+       /usr/libexec/ccc-analyzer \
+       /usr/share/clang \
+       /usr/share/opt-viewer \
+       /usr/share/scan-build \
+       /usr/share/scan-view \
+       /usr/share/man/man1/scan-build.1 \
+       /usr/lib/clang
+
+define CLANG_CLEANUP_TARGET
+       rm -rf $(addprefix $(TARGET_DIR),$(CLANG_FILES_TO_REMOVE))
 endef
-CLANG_POST_INSTALL_TARGET_HOOKS += CLANG_DELETE_BINARIES_FROM_TARGET
+CLANG_POST_INSTALL_TARGET_HOOKS += CLANG_CLEANUP_TARGET
 
 # clang-tblgen is not installed by default, however it is necessary
 # for cross-compiling clang