Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/2] package/clang: delete unnecessary files from target
Date: Wed, 2 May 2018 11:31:14 +0200	[thread overview]
Message-ID: <20180502113114.6f828e2e@windsurf.home> (raw)
In-Reply-To: <20180502090535.29498-1-valentin.korenblit@smile.fr>

Hello,

On Wed,  2 May 2018 11:05:34 +0200, Valentin Korenblit wrote:

> diff --git a/package/clang/clang.mk b/package/clang/clang.mk
> index 88bce9af0b..a599dc0ae6 100644
> --- a/package/clang/clang.mk
> +++ b/package/clang/clang.mk
> @@ -56,9 +56,14 @@ 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.
> +# binaries and some other unnecessary files from target.
>  define CLANG_DELETE_BINARIES_FROM_TARGET

You're no longer removing just binaries :)

> -	rm -f $(TARGET_DIR)/usr/bin/clang*
> +	cd $(TARGET_DIR)/usr/bin && rm -f clang* c-index-test git-clang-format \
> +		scan-build scan-view
> +	cd $(TARGET_DIR)/usr/libexec && rm -f c++-analyzer ccc-analyzer
> +	cd $(TARGET_DIR)/usr/share && rm -rf clang opt-viewer scan-build scan-view \
> +		man/man1/scan-build.1

I think a slightly more Buildroot-ish way to do this is:

	rm -f $(addprefix $(TARGET_DIR)/usr/bin/, \
	        clang* c-index-test git-clang-format scan-build scan-view)

and ditto for the others. Or perhaps, even more readable:

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 \
	...

and:

define CLANG_CLEANUP_TARGET
	rm -f $(addprefix $(TARGET_DIR),$(CLANG_FILES_TO_REMOVE))
endef

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

      parent reply	other threads:[~2018-05-02  9:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-02  9:05 [Buildroot] [PATCH 1/2] package/clang: delete unnecessary files from target Valentin Korenblit
2018-05-02  9:05 ` [Buildroot] [PATCH 2/2] package/llvm: delete LLVMHello.so from /usr/lib Valentin Korenblit
2018-05-02  9:37   ` Thomas Petazzoni
2018-05-02  9:31 ` Thomas Petazzoni [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180502113114.6f828e2e@windsurf.home \
    --to=thomas.petazzoni@bootlin.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox