Merge "Enable cargo_embargo generation of rules.mk" into main
diff --git a/cargo_embargo.json b/cargo_embargo.json
new file mode 100644
index 0000000..760ca29
--- /dev/null
+++ b/cargo_embargo.json
@@ -0,0 +1,15 @@
+{
+  "run_cargo": false,
+  "package": {
+    "acpi": {
+      "no_std": true,
+      "rulesmk_patch": "patches/rules.mk.diff"
+    }
+  },
+  "variants": [
+    {
+      "generate_androidbp": false,
+      "generate_rulesmk": true
+    }
+  ]
+}
\ No newline at end of file
diff --git a/patches/rules.mk.diff b/patches/rules.mk.diff
new file mode 100644
index 0000000..3cd12a6
--- /dev/null
+++ b/patches/rules.mk.diff
@@ -0,0 +1,13 @@
+diff --git a/rules.mk b/rules.mk
+index 5336740..dacaa6b 100644
+--- a/rules.mk
++++ b/rules.mk
+@@ -19,6 +19,7 @@ MODULE_LIBRARY_DEPS := \
+ 	external/rust/crates/bit_field \
+ 	external/rust/crates/log \
+ 	trusty/user/base/lib/libcompiler_builtins-rust \
+-	trusty/user/base/lib/libcore-rust
++	trusty/user/base/lib/libcore-rust \
++	trusty/user/base/lib/liballoc-rust \
+
+ include make/library.mk
diff --git a/rules.mk b/rules.mk
index c99a572..dacaa6b 100644
--- a/rules.mk
+++ b/rules.mk
@@ -1,21 +1,25 @@
-# This file is generated by cargo2rulesmk.py --run.
-# Do not modify this file as changes will be overridden on upgrade.
+# This file is generated by cargo_embargo.
+# Do not modify this file after the LOCAL_DIR line
+# because the changes will be overridden on upgrade.
+# Content before the first line starting with LOCAL_DIR is preserved.
 
 LOCAL_DIR := $(GET_LOCAL_DIR)
 MODULE := $(LOCAL_DIR)
 MODULE_CRATE_NAME := acpi
-MODULE_SRCS := \
-	$(LOCAL_DIR)/src/lib.rs \
-
+MODULE_RUST_CRATE_TYPES := rlib
+MODULE_SRCS := $(LOCAL_DIR)/src/lib.rs
+MODULE_ADD_IMPLICIT_DEPS := false
 MODULE_RUST_EDITION := 2021
 MODULE_RUSTFLAGS += \
 	--cfg 'feature="alloc"' \
 	--cfg 'feature="allocator_api"' \
-	--cfg 'feature="default"' \
+	--cfg 'feature="default"'
 
 MODULE_LIBRARY_DEPS := \
 	external/rust/crates/bit_field \
 	external/rust/crates/log \
+	trusty/user/base/lib/libcompiler_builtins-rust \
+	trusty/user/base/lib/libcore-rust \
 	trusty/user/base/lib/liballoc-rust \
 
 include make/library.mk