summaryrefslogtreecommitdiffstats
path: root/rules
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2021-09-29 10:55:06 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2021-11-26 19:21:29 +0100
commitbb641c3d088e004074857ae0de54861d98a09475 (patch)
tree82da363f9a1f37a01446afe244420b267e86b3cb /rules
parent3a9e9dfbd1e766fc32df4493a6898c58db367f6f (diff)
downloadptxdist-bb641c3d088e004074857ae0de54861d98a09475.tar.gz
ptxdist-bb641c3d088e004074857ae0de54861d98a09475.tar.xz
add cargo config tool
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'rules')
-rw-r--r--rules/post/ptxd_make_world_cargo.make18
-rw-r--r--rules/post/ptxd_make_world_common.make3
-rw-r--r--rules/pre/Rules.make9
3 files changed, 30 insertions, 0 deletions
diff --git a/rules/post/ptxd_make_world_cargo.make b/rules/post/ptxd_make_world_cargo.make
new file mode 100644
index 000000000..806b5ca40
--- /dev/null
+++ b/rules/post/ptxd_make_world_cargo.make
@@ -0,0 +1,18 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2021 by Michael Olbrich <m.olbrich@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+world/cargo-sync = \
+ $(call world/env, $(1)) \
+ ptxd_make_world_cargo_sync
+
+$(STATEDIR)/%.cargosync:
+ @$(call targetinfo)
+ @$(call world/cargo-sync, $(PTX_MAP_TO_PACKAGE_$(*)))
+ @$(call finish)
+
+# vim: syntax=make:
diff --git a/rules/post/ptxd_make_world_common.make b/rules/post/ptxd_make_world_common.make
index 72d27f77f..43f9eede3 100644
--- a/rules/post/ptxd_make_world_common.make
+++ b/rules/post/ptxd_make_world_common.make
@@ -54,6 +54,9 @@ ptx/env = \
ptx_conf_opt_meson_host="$(call ptx/escape,$(HOST_MESON_OPT))" \
ptx_conf_env_meson_host="$(call ptx/escape,$(HOST_ENV))" \
\
+ ptx_make_opt_cargo_target="$(call ptx/escape,$(CROSS_CARGO_OPT))" \
+ ptx_make_env_cargo_target="$(call ptx/escape,$(CROSS_CARGO_ENV))" \
+ \
ptx_xpkg_extra_args=$(PTXCONF_IMAGE_XPKG_EXTRA_ARGS)
world/env/impl = \
diff --git a/rules/pre/Rules.make b/rules/pre/Rules.make
index 0943a51b7..41128d3c0 100644
--- a/rules/pre/Rules.make
+++ b/rules/pre/Rules.make
@@ -261,6 +261,15 @@ CROSS_MESON_USR := \
CROSS_MESON_ENV = \
$(HOST_ENV_PROGS)
+CROSS_CARGO_ENV := \
+ RUST_TARGET_PATH=$(PTXDIST_PLATFORMDIR)/selected_toolchain
+
+CROSS_CARGO_OPT := \
+ build \
+ --target $(PTXCONF_GNU_TARGET) \
+ --release \
+ --frozen
+
ifdef PTXCONF_GLOBAL_IPV6
GLOBAL_IPV6_OPTION := --enable-ipv6
else