Makefile revision d3811de4
1cd139dc7SShuo ChenCXXFLAGS=-g -Wall -rdynamic -march=native
24886147bSShuo ChenCXXFLAGS+=-O2
3cd139dc7SShuo Chen
40d2d6577SShuo ChenHEADERS=$(wildcard *.h)
5cd139dc7SShuo ChenTESTS= atomic_unittest \
6cd139dc7SShuo Chen       blockingqueue_test \
79d9bda4cSShuo Chen       boundedblockingqueue_test \
850da4f87SShuo Chen       exception_test \
950da4f87SShuo Chen       fork_test \
10cd139dc7SShuo Chen       singleton_test \
11cd139dc7SShuo Chen       singleton_threadlocal_test \
12cd139dc7SShuo Chen       threadlocal_test \
13cd139dc7SShuo Chen       threadlocalsingleton_test \
14cd139dc7SShuo Chen       thread_test \
15d3811de4SShuo Chen       threadpool_test \
16d3811de4SShuo Chen       exit_deadlock \
17d3811de4SShuo Chen       mutual_deadlock \
18d3811de4SShuo Chen       self_deadlock
19cd139dc7SShuo Chen
20cd139dc7SShuo Chenall: $(TESTS)
21cd139dc7SShuo Chen
220d2d6577SShuo Chen$(TESTS): $(HEADERS)
230d2d6577SShuo Chen
240d2d6577SShuo Chen$(TESTS):
250d2d6577SShuo Chen	g++ $(CXXFLAGS) -o $@ $(filter %.cc,$^) -lpthread
260d2d6577SShuo Chen
27cd139dc7SShuo Chenatomic_unittest: test/Atomic_unittest.cc
28cd139dc7SShuo Chen
29b24dfd25SShuo Chenblockingqueue_test: test/BlockingQueue_test.cc Thread.cc
30cd139dc7SShuo Chen
31b24dfd25SShuo Chenboundedblockingqueue_test: test/BoundedBlockingQueue_test.cc Thread.cc
329d9bda4cSShuo Chen
33d3811de4SShuo Chenexit_deadlock: test/ExitDeadLock.cc Thread.cc
34d3811de4SShuo Chen
35d3811de4SShuo Chenmutual_deadlock: test/MutualDeadLock.cc Thread.cc
36d3811de4SShuo Chen
37d3811de4SShuo Chenself_deadlock: test/SelfDeadLock.cc Thread.cc
3862574298SShuo Chen
39cd139dc7SShuo Chenexception_test: test/Exception_test.cc Exception.cc
40cd139dc7SShuo Chen
4150da4f87SShuo Chenfork_test: test/Fork_test.cc Thread.cc
4250da4f87SShuo Chen
43cd139dc7SShuo Chensingleton_test: test/Singleton_test.cc Thread.cc
44cd139dc7SShuo Chen
45cd139dc7SShuo Chensingleton_threadlocal_test: test/SingletonThreadLocal_test.cc Thread.cc
46cd139dc7SShuo Chen
47cd139dc7SShuo Chenthread_test: test/Thread_test.cc Thread.cc
48cd139dc7SShuo Chen
49cd139dc7SShuo Chenthreadlocal_test: test/ThreadLocal_test.cc Thread.cc
50cd139dc7SShuo Chen
51cd139dc7SShuo Chenthreadlocalsingleton_test: test/ThreadLocalSingleton_test.cc Thread.cc
52cd139dc7SShuo Chen
53b24dfd25SShuo Chenthreadpool_test: test/ThreadPool_test.cc Thread.cc ThreadPool.cc Exception.cc
54cd139dc7SShuo Chen
55cd139dc7SShuo Chenclean:
56cd139dc7SShuo Chen	rm -f $(TESTS)
57