Makefile.riscv revision 12751
112853Sgabeblack@google.comCPP      := riscv64-unknown-linux-gnu-g++
212853Sgabeblack@google.comOBJDUMP  := riscv64-unknown-linux-gnu-objdump
312853Sgabeblack@google.comCPPFLAGS := -g -O3 -static -std=c++11 -march=rv64gc
412853Sgabeblack@google.comLFLAGS := -pthread -Wl,--whole-archive -lpthread -latomic -Wl,--no-whole-archive
512853Sgabeblack@google.com
612853Sgabeblack@google.comSRC_DIR := ./src
712853Sgabeblack@google.comBIN_DIR := ./bin
812853Sgabeblack@google.com
912853Sgabeblack@google.comTEST_SRC := test_pthread_create_seq.cpp \
1012853Sgabeblack@google.com            test_pthread_create_para.cpp \
1112853Sgabeblack@google.com            test_pthread_mutex.cpp \
1212853Sgabeblack@google.com            test_atomic.cpp \
1312853Sgabeblack@google.com            test_pthread_cond.cpp \
1412853Sgabeblack@google.com            test_std_thread.cpp \
1512853Sgabeblack@google.com            test_std_mutex.cpp \
1612853Sgabeblack@google.com            test_std_condition_variable.cpp \
1712853Sgabeblack@google.com
1812853Sgabeblack@google.comTEST_BIN  := $(patsubst %.cpp,%,$(TEST_SRC))
1912853Sgabeblack@google.comTEST_DUMP := $(patsubst %.cpp,%.objdump,$(TEST_SRC))
2012853Sgabeblack@google.com
2112853Sgabeblack@google.com# Rules
2212853Sgabeblack@google.com
2312853Sgabeblack@google.com.PHONY: default clean
2412853Sgabeblack@google.com
2512853Sgabeblack@google.comdefault: $(TEST_BIN)
2612853Sgabeblack@google.com
2712853Sgabeblack@google.com$(TEST_BIN):
2812853Sgabeblack@google.com	mkdir -p $(BIN_DIR)
2912853Sgabeblack@google.com	$(CPP) $(CPPFLAGS) $(SRC_DIR)/$@.cpp $(LFLAGS) -o $(BIN_DIR)/$@
3012853Sgabeblack@google.com
3112853Sgabeblack@google.comclean:
3212853Sgabeblack@google.com	$(RM) -r $(BIN_DIR)/*
3312853Sgabeblack@google.com