[Buildroot] [PATCH] docs/manual/adding-packages-cargo.txt: re-add FOO_CARGO_MODE variable

Thomas Petazzoni thomas.petazzoni at bootlin.com
Tue Jul 20 21:47:29 UTC 2021


Hello Stefan,

On Tue, 15 Jun 2021 15:55:54 +0200
Stefan <buildroot-list_21 at green-sparklet.de> wrote:

> +16: FOO_CARGO_MODE = $(if $(BR2_ENABLE_DEBUG),debug,release)
> +17:
> +18: FOO_BIN_DIR = target/$(RUSTC_TARGET_NAME)/$(FOO_CARGO_MODE)
> +19:
> +20: FOO_CARGO_OPTS = \
> +21:    $(if $(BR2_ENABLE_DEBUG),,--release) \
> +22:    --target=$(RUSTC_TARGET_NAME) \
> +23:    --manifest-path=$(@D)/Cargo.toml
> +24:
> +25: define FOO_BUILD_CMDS
> +26:    $(TARGET_MAKE_ENV) $(FOO_CARGO_ENV) \
> +27:            cargo build $(FOO_CARGO_OPTS)
> +28: endef
> +29:
> +30: define FOO_INSTALL_TARGET_CMDS
> +31:    $(INSTALL) -D -m 0755 $(@D)/$(FOO_BIN_DIR)/foo \
> +32:            $(TARGET_DIR)/usr/bin/foo
> +33: endef
> +34:
> +35: $(eval $(generic-package))

Thanks for the patch. However, it seems like the only package that uses
this currently is not formatted like you're suggesting. See
package/ripgrep/ripgrep.mk. First, it uses BR2_ENABLE_RUNTIME_DEBUG
instead of BR2_ENABLE_DEBUG, and it does it in a different way.

Could you adjust the documentation according to what
package/ripgrep/ripgrep.mk is doing ?

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


More information about the buildroot mailing list