benchmarks initial commit
[riscv-tests.git] / benchmarks / vvadd / bmark.mk
diff --git a/benchmarks/vvadd/bmark.mk b/benchmarks/vvadd/bmark.mk
new file mode 100644 (file)
index 0000000..d03cb96
--- /dev/null
@@ -0,0 +1,29 @@
+#=======================================================================
+# UCB CS250 Makefile fragment for benchmarks
+#-----------------------------------------------------------------------
+#
+# Each benchmark directory should have its own fragment which
+# essentially lists what the source files are and how to link them
+# into an riscv and/or host executable. All variables should include
+# the benchmark name as a prefix so that they are unique.
+#
+
+vvadd_c_src = \
+       vvadd_main.c \
+
+vvadd_riscv_src = \
+       crt.S \
+
+vvadd_c_objs     = $(patsubst %.c, %.o, $(vvadd_c_src))
+vvadd_riscv_objs = $(patsubst %.S, %.o, $(vvadd_riscv_src))
+
+vvadd_host_bin = vvadd.host
+$(vvadd_host_bin) : $(vvadd_c_src)
+       $(HOST_COMP) $^ -o $(vvadd_host_bin)
+
+vvadd_riscv_bin = vvadd.riscv
+$(vvadd_riscv_bin) : $(vvadd_c_objs) $(vvadd_riscv_objs)
+       $(RISCV_LINK) $(vvadd_c_objs) $(vvadd_riscv_objs) -o $(vvadd_riscv_bin)
+
+junk += $(vvadd_c_objs) $(vvadd_riscv_objs) \
+        $(vvadd_host_bin) $(vvadd_riscv_bin)