Makefile revision 9b063ed9
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 \ 234670cafeSShuo Chen weakcallback_test \ 249b063ed9SShuo Chen signalslot_test \ 259b063ed9SShuo Chen waiter_test 26cd139dc7SShuo Chen 27cd139dc7SShuo Chenall: $(TESTS) 28cd139dc7SShuo Chen 290d2d6577SShuo Chen$(TESTS): $(HEADERS) 300d2d6577SShuo Chen 310d2d6577SShuo Chen$(TESTS): 322b2bf878SShuo Chen g++ $(CXXFLAGS) -o $@ $(filter %.cc,$^) $(LDFLAGS) -lpthread 330d2d6577SShuo Chen 34cd139dc7SShuo Chenatomic_unittest: test/Atomic_unittest.cc 35cd139dc7SShuo Chen 36b24dfd25SShuo Chenblockingqueue_test: test/BlockingQueue_test.cc Thread.cc 37cd139dc7SShuo Chen 38b24dfd25SShuo Chenboundedblockingqueue_test: test/BoundedBlockingQueue_test.cc Thread.cc 399d9bda4cSShuo Chen 402d3b4de6SShuo Chencopyonwrite_test: test/CopyOnWrite_test.cc Thread.cc 412d3b4de6SShuo Chen 42d3811de4SShuo Chenexit_deadlock: test/ExitDeadLock.cc Thread.cc 43d3811de4SShuo Chen 44d3811de4SShuo Chenmutual_deadlock: test/MutualDeadLock.cc Thread.cc 45d3811de4SShuo Chen 462d3b4de6SShuo Chennonrecursivemutex_test: test/NonRecursiveMutex_test.cc Thread.cc 472d3b4de6SShuo Chen 482d3b4de6SShuo Chenrequestinventory_test: test/RequestInventory_test.cc Thread.cc 492d3b4de6SShuo Chenrequestinventory_test2: test/RequestInventory_test2.cc Thread.cc 502d3b4de6SShuo Chen 51d3811de4SShuo Chenself_deadlock: test/SelfDeadLock.cc Thread.cc 5262574298SShuo Chen 53cd139dc7SShuo Chenexception_test: test/Exception_test.cc Exception.cc 54cd139dc7SShuo Chen 5550da4f87SShuo Chenfork_test: test/Fork_test.cc Thread.cc 5650da4f87SShuo Chen 57cd139dc7SShuo Chensingleton_test: test/Singleton_test.cc Thread.cc 582d3b4de6SShuo Chensingleton_test: CXXFLAGS += -ftemplate-depth-1000 59cd139dc7SShuo Chen 60cd139dc7SShuo Chensingleton_threadlocal_test: test/SingletonThreadLocal_test.cc Thread.cc 61cd139dc7SShuo Chen 62cd139dc7SShuo Chenthread_test: test/Thread_test.cc Thread.cc 63cd139dc7SShuo Chen 64cd139dc7SShuo Chenthreadlocal_test: test/ThreadLocal_test.cc Thread.cc 65cd139dc7SShuo Chen 66cd139dc7SShuo Chenthreadlocalsingleton_test: test/ThreadLocalSingleton_test.cc Thread.cc 67cd139dc7SShuo Chen 68b24dfd25SShuo Chenthreadpool_test: test/ThreadPool_test.cc Thread.cc ThreadPool.cc Exception.cc 69cd139dc7SShuo Chen 70a0e66be7SShuo Chenweakcallback_test: test/WeakCallback_test.cc 712b2bf878SShuo Chenweakcallback_test: CXXFLAGS += -Wextra --std=c++0x -DBOOST_TEST_DYN_LINK 722b2bf878SShuo Chenweakcallback_test: LDFLAGS += -lboost_unit_test_framework 73a0e66be7SShuo Chen 742d6ff445SShuo Chensignalslot_test: test/SignalSlot_test.cc Thread.cc 752b2bf878SShuo Chensignalslot_test: CXXFLAGS += -Wextra --std=c++0x -DBOOST_TEST_DYN_LINK 762b2bf878SShuo Chensignalslot_test: LDFLAGS += -lboost_unit_test_framework 774670cafeSShuo Chen 789b063ed9SShuo Chenwaiter_test: test/Waiter_test.cc Thread.cc 799b063ed9SShuo Chenwaiter_test: CXXFLAGS += --std=c++0x 809b063ed9SShuo Chen 81cd139dc7SShuo Chenclean: 82cd139dc7SShuo Chen rm -f $(TESTS) 83