CXXFLAGS = -g -MMD -Wall -I. -I./rpc LDFLAGS = -L. -L/usr/local/lib LDLIBS = -lpthread LDLIBS += $(shell test -f `gcc -print-file-name=librt.so` && echo -lrt) LDLIBS += $(shell test -f `gcc -print-file-name=libdl.so` && echo -ldl) CXX = g++ CC = g++ all: lock_demo lock_server lock_tester rsm_tester rpc/rpctest rpc/librpc.a: rpc/rpc.o rpc/connection.o rpc/pollmgr.o rpc/thr_pool.o rpc/jsl_log.o gettime.o rm -f $@ ar cq $@ $^ ranlib rpc/librpc.a rpc/rpctest: rpc/rpctest.o rpc/librpc.a lock_demo=lock_demo.o lock_client.o lock_demo : $(lock_demo) rpc/librpc.a lock_tester=lock_tester.o lock_client.o mutex.o tprintf.o rsm_client.o handle.o lock_client_cache_rsm.o lock_tester : $(lock_tester) rpc/librpc.a 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 lock_server : $(lock_server) rpc/librpc.a rsm_tester=rsm_tester.o rsmtest_client.o rsm_tester: $(rsm_tester) rpc/librpc.a %.o: %.cc $(CXX) $(CXXFLAGS) -c $< -o $@ -include *.d -include rpc/*.d clean_files=rpc/rpctest rpc/*.o *.d rpc/*.d rpc/librpc.a *.o lock_server lock_tester lock_demo rsm_tester .PHONY: clean clean: rm -rf $(clean_files)