Build on wheezy, and presumably precise
[invirt/third/libt4.git] / Makefile
1 CXXFLAGS =  -g -MMD -Wall -I. -I./rpc
2 LDFLAGS = -L. -L/usr/local/lib
3 LDLIBS = -lpthread
4 LDLIBS += $(shell test -f `gcc -print-file-name=librt.so` && echo -lrt)
5 LDLIBS += $(shell test -f `gcc -print-file-name=libdl.so` && echo -ldl)
6 CXX = g++
7 CC = g++
8
9 all: lock_demo lock_server lock_tester rsm_tester rpc/rpctest
10
11 rpc/librpc.a: rpc/rpc.o rpc/connection.o rpc/pollmgr.o rpc/thr_pool.o rpc/jsl_log.o gettime.o
12         rm -f $@
13         ar cq $@ $^
14         ranlib rpc/librpc.a
15
16 rpc/rpctest: rpc/rpctest.o rpc/librpc.a
17
18 lock_demo=lock_demo.o lock_client.o
19 lock_demo : $(lock_demo) rpc/librpc.a
20
21 lock_tester=lock_tester.o lock_client.o mutex.o tprintf.o rsm_client.o handle.o lock_client_cache_rsm.o
22 lock_tester : $(lock_tester) rpc/librpc.a
23
24 lock_server=lock_server.o lock_smain.o mutex.o tprintf.o handle.o rsm.o paxos.o config.o log.o lock_server_cache_rsm.o
25 lock_server : $(lock_server) rpc/librpc.a
26
27 rsm_tester=rsm_tester.o rsmtest_client.o
28 rsm_tester: $(rsm_tester) rpc/librpc.a
29
30 %.o: %.cc
31         $(CXX) $(CXXFLAGS) -c $< -o $@
32
33 -include *.d
34 -include rpc/*.d
35
36 clean_files=rpc/rpctest rpc/*.o *.d rpc/*.d rpc/librpc.a *.o lock_server lock_tester lock_demo rsm_tester
37 .PHONY: clean
38 clean: 
39         rm -rf $(clean_files)