summaryrefslogtreecommitdiff
path: root/tests/test-progs/pthread/Makefile.riscv
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-progs/pthread/Makefile.riscv')
-rw-r--r--tests/test-progs/pthread/Makefile.riscv32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/test-progs/pthread/Makefile.riscv b/tests/test-progs/pthread/Makefile.riscv
new file mode 100644
index 000000000..0122187a0
--- /dev/null
+++ b/tests/test-progs/pthread/Makefile.riscv
@@ -0,0 +1,32 @@
+CPP := riscv64-unknown-linux-gnu-g++
+OBJDUMP := riscv64-unknown-linux-gnu-objdump
+CPPFLAGS := -g -O3 -static -std=c++11 -march=rv64gc
+LFLAGS := -pthread -Wl,--whole-archive -lpthread -latomic -Wl,--no-whole-archive
+
+SRC_DIR := ./src
+BIN_DIR := ./bin
+
+TEST_SRC := test_pthread_create_seq.cpp \
+ test_pthread_create_para.cpp \
+ test_pthread_mutex.cpp \
+ test_atomic.cpp \
+ test_pthread_cond.cpp \
+ test_std_thread.cpp \
+ test_std_mutex.cpp \
+ test_std_condition_variable.cpp \
+
+TEST_BIN := $(patsubst %.cpp,%,$(TEST_SRC))
+TEST_DUMP := $(patsubst %.cpp,%.objdump,$(TEST_SRC))
+
+# Rules
+
+.PHONY: default clean
+
+default: $(TEST_BIN)
+
+$(TEST_BIN):
+ mkdir -p $(BIN_DIR)
+ $(CPP) $(CPPFLAGS) $(SRC_DIR)/$@.cpp $(LFLAGS) -o $(BIN_DIR)/$@
+
+clean:
+ $(RM) -r $(BIN_DIR)/*