[Buildroot] [PATCH 08/16 v3] core: do not hard-code inclusion of br2-external in Kconfig

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Sat Aug 27 20:00:10 UTC 2016


Hello,

On Sun, 17 Jul 2016 12:34:28 +0200, Yann E. MORIN wrote:

>  .PHONY: $(BUILD_DIR)/.br2-external.in
>  $(BUILD_DIR)/.br2-external.in: $(BUILD_DIR)
> -	@touch $@
> +	$(Q)( \
> +		printf "#\n# Automatically generated file; DO NOT EDIT.\n#\n\n"; \
> +		printf 'menu "User-provided options"\n'; \
> +		printf '\tdepends on BR2_EXTERNAL != "support/dummy-external"\n\n'; \
> +		printf 'source "%s/Config.in"\n\n' $$(cd $(BR2_EXTERNAL) >/dev/null 2>&1 && pwd); \
> +		printf 'endmenu # User-provided options\n'; \
> +	) >$@

Shouldn't the logic that generates the .br2-external.in be moved to a
shell script?

I'm generally in favor of having most of the logic in make, but here,
it is really ugly. Did you try having this in a shell script?

Also, what about using readlink or realpath to convert the path to an
absolute path?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com



More information about the buildroot mailing list