CXXFLAGS=-std=gnu++11 -O2 -g -Wall
-LDLIBS=-lmtbl
+LDLIBS=-lmtbl -lfarmhash -lprotobuf
+PROTOC=protoc
+
all: binloader binlookup binmerger
+binloader: binloader.o hash.o count.pb.o
+binmerger: binmerger.o merge_count.o count.pb.o
+binlookup: binlookup.o hash.o merge_count.o count.pb.o
+
+binloader.o: binloader.cpp count.pb.h
+binmerger.o: binmerger.cpp merge_count.h count.pb.h
+binlookup.o: binlookup.cpp merge_count.h count.pb.h
+
+%.pb.cc %.pb.h : %.proto
+ $(PROTOC) --cpp_out=. $<
+
.PHONY: clean
clean:
- $(RM) binloader binlookup binmerger
+ $(RM) binloader binlookup binmerger binloader.o binmerger.o binlookup.o hash.o count.pb.o count.pb.h count.pb.cc