]> git.sesse.net Git - cubemap/blobdiff - Makefile
Support deserialization of most state (curl input is not really good yet).
[cubemap] / Makefile
index 8d26f4984c06bed137ea7743bbb1a336f2f1da8d..257966aa47954a446bc2315fd27e89fce18d4e35 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,19 @@
 CC=gcc
 CXX=g++
+PROTOC=protoc
 CXXFLAGS=-Wall -O2 -g
-LDLIBS=-lcurl
+LDLIBS=-lcurl -lpthread -lprotobuf
 
-OBJS=cubemap.o
+OBJS=cubemap.o server.o mutexlock.o input.o state.pb.o
 
 all: cubemap
 
-%.o: %.cpp
+%.pb.cc %.pb.h : %.proto
+       $(PROTOC) --cpp_out=. $<
+
+%.o: %.cpp state.pb.h
+       $(CXX) -MMD -MP $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $<
+%.pb.o: %.pb.cc
        $(CXX) -MMD -MP $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $<
 cubemap: $(OBJS)
        $(CXX) -o cubemap $(OBJS) $(LDLIBS)
@@ -16,5 +22,7 @@ DEPS=$(OBJS:.o=.d)
 -include $(DEPS)
 
 clean:
-       $(RM) cubemap $(OBJS) $(DEPS)
+       $(RM) cubemap $(OBJS) $(DEPS) state.pb.h state.pb.cc
 
+.PHONY: clean
+.SUFFIXES: