mirror of
https://github.com/MiyooCFW/buildroot.git
synced 2025-09-27 22:24:19 +03:00
Merge from bittboy/buildroot@26c91a9
This commit is contained in:
@@ -17,8 +17,8 @@ The +Config.in+ file of Cargo-based package 'foo' should contain:
|
||||
---------------------------
|
||||
01: config BR2_PACKAGE_FOO
|
||||
02: bool "foo"
|
||||
03: depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
|
||||
04: select BR2_PACKAGE_HOST_CARGO
|
||||
03: depends on BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS
|
||||
04: select BR2_PACKAGE_HOST_RUSTC
|
||||
05: help
|
||||
06: This is a comment that explains what foo is.
|
||||
07:
|
||||
@@ -44,35 +44,34 @@ package. Let's start with an example:
|
||||
10: FOO_LICENSE = GPL-3.0+
|
||||
11: FOO_LICENSE_FILES = COPYING
|
||||
12:
|
||||
13: FOO_DEPENDENCIES = host-cargo
|
||||
13: FOO_DEPENDENCIES = host-rustc
|
||||
14:
|
||||
15: FOO_CARGO_ENV = CARGO_HOME=$(HOST_DIR)/share/cargo
|
||||
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: --$(FOO_CARGO_MODE) \
|
||||
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))
|
||||
16:
|
||||
17: FOO_BIN_DIR = target/$(RUSTC_TARGET_NAME)/$(FOO_CARGO_MODE)
|
||||
18:
|
||||
19: FOO_CARGO_OPTS = \
|
||||
20: $(if $(BR2_ENABLE_DEBUG),,--release) \
|
||||
21: --target=$(RUSTC_TARGET_NAME) \
|
||||
22: --manifest-path=$(@D)/Cargo.toml
|
||||
23:
|
||||
24: define FOO_BUILD_CMDS
|
||||
25: $(TARGET_MAKE_ENV) $(FOO_CARGO_ENV) \
|
||||
26: cargo build $(FOO_CARGO_OPTS)
|
||||
27: endef
|
||||
28:
|
||||
29: define FOO_INSTALL_TARGET_CMDS
|
||||
30: $(INSTALL) -D -m 0755 $(@D)/$(FOO_BIN_DIR)/foo \
|
||||
31: $(TARGET_DIR)/usr/bin/foo
|
||||
32: endef
|
||||
33:
|
||||
34: $(eval $(generic-package))
|
||||
--------------------------------
|
||||
|
||||
The Makefile starts with the definition of the standard variables for package
|
||||
declaration (lines 7 to 11).
|
||||
|
||||
As seen in line 35, it is based on the
|
||||
As seen in line 34, it is based on the
|
||||
xref:generic-package-tutorial[+generic-package+ infrastructure]. So, it defines
|
||||
the variables required by this particular infrastructure, where Cargo is
|
||||
invoked:
|
||||
|
||||
Reference in New Issue
Block a user