Makefile revision a0e66be7
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 \
82d3b4de6SShuo Chen       copyonwrite_test \
950da4f87SShuo Chen       exception_test \
1050da4f87SShuo Chen       fork_test \
11cd139dc7SShuo Chen       singleton_test \
12cd139dc7SShuo Chen       singleton_threadlocal_test \
13cd139dc7SShuo Chen       threadlocal_test \
14cd139dc7SShuo Chen       threadlocalsingleton_test \
15cd139dc7SShuo Chen       thread_test \
16d3811de4SShuo Chen       threadpool_test \
17d3811de4SShuo Chen       exit_deadlock \
18d3811de4SShuo Chen       mutual_deadlock \
192d3b4de6SShuo Chen       nonrecursivemutex_test \
202d3b4de6SShuo Chen       requestinventory_test \
212d3b4de6SShuo Chen       requestinventory_test2 \
22a0e66be7SShuo Chen       self_deadlock \
23a0e66be7SShuo Chen       weakcallback_test
24cd139dc7SShuo Chen
25cd139dc7SShuo Chenall: $(TESTS)
26cd139dc7SShuo Chen
270d2d6577SShuo Chen$(TESTS): $(HEADERS)
280d2d6577SShuo Chen
290d2d6577SShuo Chen$(TESTS):
300d2d6577SShuo Chen	g++ $(CXXFLAGS) -o $@ $(filter %.cc,$^) -lpthread
310d2d6577SShuo Chen
32cd139dc7SShuo Chenatomic_unittest: test/Atomic_unittest.cc
33cd139dc7SShuo Chen
34b24dfd25SShuo Chenblockingqueue_test: test/BlockingQueue_test.cc Thread.cc
35cd139dc7SShuo Chen
36b24dfd25SShuo Chenboundedblockingqueue_test: test/BoundedBlockingQueue_test.cc Thread.cc
379d9bda4cSShuo Chen
382d3b4de6SShuo Chencopyonwrite_test: test/CopyOnWrite_test.cc Thread.cc
392d3b4de6SShuo Chen
40d3811de4SShuo Chenexit_deadlock: test/ExitDeadLock.cc Thread.cc
41d3811de4SShuo Chen
42d3811de4SShuo Chenmutual_deadlock: test/MutualDeadLock.cc Thread.cc
43d3811de4SShuo Chen
442d3b4de6SShuo Chennonrecursivemutex_test: test/NonRecursiveMutex_test.cc Thread.cc
452d3b4de6SShuo Chen
462d3b4de6SShuo Chenrequestinventory_test: test/RequestInventory_test.cc Thread.cc
472d3b4de6SShuo Chenrequestinventory_test2: test/RequestInventory_test2.cc Thread.cc
482d3b4de6SShuo Chen
49d3811de4SShuo Chenself_deadlock: test/SelfDeadLock.cc Thread.cc
5062574298SShuo Chen
51cd139dc7SShuo Chenexception_test: test/Exception_test.cc Exception.cc
52cd139dc7SShuo Chen
5350da4f87SShuo Chenfork_test: test/Fork_test.cc Thread.cc
5450da4f87SShuo Chen
55cd139dc7SShuo Chensingleton_test: test/Singleton_test.cc Thread.cc
562d3b4de6SShuo Chensingleton_test: CXXFLAGS += -ftemplate-depth-1000
57cd139dc7SShuo Chen
58cd139dc7SShuo Chensingleton_threadlocal_test: test/SingletonThreadLocal_test.cc Thread.cc
59cd139dc7SShuo Chen
60cd139dc7SShuo Chenthread_test: test/Thread_test.cc Thread.cc
61cd139dc7SShuo Chen
62cd139dc7SShuo Chenthreadlocal_test: test/ThreadLocal_test.cc Thread.cc
63cd139dc7SShuo Chen
64cd139dc7SShuo Chenthreadlocalsingleton_test: test/ThreadLocalSingleton_test.cc Thread.cc
65cd139dc7SShuo Chen
66b24dfd25SShuo Chenthreadpool_test: test/ThreadPool_test.cc Thread.cc ThreadPool.cc Exception.cc
67cd139dc7SShuo Chen
68a0e66be7SShuo Chenweakcallback_test: test/WeakCallback_test.cc
69a0e66be7SShuo Chenweakcallback_test: CXXFLAGS += -Wextra --std=c++0x -DBOOST_TEST_DYN_LINK -lboost_unit_test_framework
70a0e66be7SShuo Chen
71cd139dc7SShuo Chenclean:
72cd139dc7SShuo Chen	rm -f $(TESTS)
73