Makefile revision 62574298
1cd139dc7SShuo ChenCXXFLAGS=-g -Wall -rdynamic -march=native
24886147bSShuo ChenCXXFLAGS+=-O2
3cd139dc7SShuo Chen
40d2d6577SShuo ChenHEADERS=$(wildcard *.h)
5cd139dc7SShuo ChenTESTS= atomic_unittest \
6cd139dc7SShuo Chen       blockingqueue_test \
750da4f87SShuo Chen       exception_test \
850da4f87SShuo Chen       fork_test \
9cd139dc7SShuo Chen       singleton_test \
10cd139dc7SShuo Chen       singleton_threadlocal_test \
11cd139dc7SShuo Chen       threadlocal_test \
12cd139dc7SShuo Chen       threadlocalsingleton_test \
13cd139dc7SShuo Chen       thread_test \
14cd139dc7SShuo Chen       threadpool_test
15cd139dc7SShuo Chen
16cd139dc7SShuo Chenall: $(TESTS)
17cd139dc7SShuo Chen
180d2d6577SShuo Chen$(TESTS): $(HEADERS)
190d2d6577SShuo Chen
200d2d6577SShuo Chen$(TESTS):
210d2d6577SShuo Chen	g++ $(CXXFLAGS) -o $@ $(filter %.cc,$^) -lpthread
220d2d6577SShuo Chen
23cd139dc7SShuo Chenatomic_unittest: test/Atomic_unittest.cc
24cd139dc7SShuo Chen
25cd139dc7SShuo Chenblockingqueue_test: test/BlockingQueue_test.cc CountDownLatch.cc Thread.cc
26cd139dc7SShuo Chen
2762574298SShuo Chenexit_deadlock: test/ExitDeadLock.cc
2862574298SShuo Chen	g++ $(CXXFLAGS) -o $@ $(filter %.cc,$^) -lpthread
2962574298SShuo Chen
30cd139dc7SShuo Chenexception_test: test/Exception_test.cc Exception.cc
31cd139dc7SShuo Chen
3250da4f87SShuo Chenfork_test: test/Fork_test.cc Thread.cc
3350da4f87SShuo Chen
34cd139dc7SShuo Chensingleton_test: test/Singleton_test.cc Thread.cc
35cd139dc7SShuo Chen
36cd139dc7SShuo Chensingleton_threadlocal_test: test/SingletonThreadLocal_test.cc Thread.cc
37cd139dc7SShuo Chen
38cd139dc7SShuo Chenthread_test: test/Thread_test.cc Thread.cc
39cd139dc7SShuo Chen
40cd139dc7SShuo Chenthreadlocal_test: test/ThreadLocal_test.cc Thread.cc
41cd139dc7SShuo Chen
42cd139dc7SShuo Chenthreadlocalsingleton_test: test/ThreadLocalSingleton_test.cc Thread.cc
43cd139dc7SShuo Chen
44cd139dc7SShuo Chenthreadpool_test: test/ThreadPool_test.cc Thread.cc ThreadPool.cc CountDownLatch.cc Exception.cc
45cd139dc7SShuo Chen
46cd139dc7SShuo Chenclean:
47cd139dc7SShuo Chen	rm -f $(TESTS)
48