Adding autogenerated Trusty makefile rules

Bug: 281857510
Test: build.py --skip-tests qemu-generic-arm64-test-debug
Change-Id: I5e33daf379f3f7cb95918fa62561d13c02870c66
diff --git a/cargo2rulesmk.json b/cargo2rulesmk.json
new file mode 100644
index 0000000..6610391
--- /dev/null
+++ b/cargo2rulesmk.json
@@ -0,0 +1,4 @@
+{
+  "features": "default,derive,alloc",
+  "patch": "patches/rules.mk.diff"
+}
\ No newline at end of file
diff --git a/patches/rules.mk.diff b/patches/rules.mk.diff
new file mode 100644
index 0000000..34a66ce
--- /dev/null
+++ b/patches/rules.mk.diff
@@ -0,0 +1,13 @@
+diff --git a/rules.mk b/rules.mk
+index 5e5b3d4..5aeddb1 100644
+--- a/rules.mk
++++ b/rules.mk
+@@ -15,4 +15,8 @@ MODULE_RUSTFLAGS += \
+ 	--cfg 'feature="serde_derive"' \
+ 	--cfg 'feature="std"' \
+ 
++MODULE_LIBRARY_DEPS := \
++	trusty/user/base/lib/liballoc-rust \
++	external/rust/crates/serde_derive \
++
+ include make/library.mk
diff --git a/rules.mk b/rules.mk
new file mode 100644
index 0000000..5aeddb1
--- /dev/null
+++ b/rules.mk
@@ -0,0 +1,22 @@
+# This file is generated by cargo2rulesmk.py --run --config cargo2rulesmk.json --features .
+# Do not modify this file as changes will be overridden on upgrade.
+
+LOCAL_DIR := $(GET_LOCAL_DIR)
+MODULE := $(LOCAL_DIR)
+MODULE_CRATE_NAME := serde
+MODULE_SRCS := \
+	$(LOCAL_DIR)/src/lib.rs \
+
+MODULE_RUST_EDITION := 2015
+MODULE_RUSTFLAGS += \
+	--cfg 'feature="alloc"' \
+	--cfg 'feature="default"' \
+	--cfg 'feature="derive"' \
+	--cfg 'feature="serde_derive"' \
+	--cfg 'feature="std"' \
+
+MODULE_LIBRARY_DEPS := \
+	trusty/user/base/lib/liballoc-rust \
+	external/rust/crates/serde_derive \
+
+include make/library.mk