Merge "sencha: add simulate+cli target"
diff --git a/platforms/nexus/sim.mk b/platforms/nexus/sim.mk
index 4708391..371653c 100644
--- a/platforms/nexus/sim.mk
+++ b/platforms/nexus/sim.mk
@@ -162,3 +162,26 @@
         $(RENODE_PRESTART_CMDS) start"
 
 .PHONY:: sim_configs clean_sim_configs simulate simulate-debug debug-simulation
+
+OUT_BENCHMARKS:="$(OUT)/benchmarks"
+
+$(OUT_BENCHMARKS):
+	mkdir -p $(OUT_BENCHMARKS)
+
+ext_flash_model_benchmarks: | $(OUT_BENCHMARKS)
+	cd ml/ml-models && \
+	bazel build $$(bazel query //benchmarks/... | grep -E "benchmark_device_fpga$$")
+	find ml/ml-models/bazel-bin/benchmarks/ \
+		-type f \
+		-name '*_extflash.tar' \
+		-exec cp -f {} "$(OUT_BENCHMARKS)/" \;
+
+ext_flash_public_model_benchmarks: | $(OUT_BENCHMARKS)
+	cd ml/ml-models-public
+	bazel build $$(bazel query //benchmarks/... | grep -E "benchmark_device_fpga$$")
+	find ml/ml-models-public/bazel-bin/benchmarks/ \
+		-type f \
+		-name '*_extflash.tar' \
+		-exec cp -f {} "$(OUT_BENCHMARKS)/" \;
+
+.PHONY:: ext_flash_model_benchmarks ext_flash_public_model_benchmarks