]> git.sesse.net Git - cubemap/blobdiff - Makefile
Compile and link with -pthread, not -lpthread.
[cubemap] / Makefile
index 8d26f4984c06bed137ea7743bbb1a336f2f1da8d..36fb4f88e1bf6ae9608c64afcbe880fc03837b82 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,20 @@
 CC=gcc
 CXX=g++
-CXXFLAGS=-Wall -O2 -g
-LDLIBS=-lcurl
+PROTOC=protoc
+CXXFLAGS=-Wall -O2 -g -pthread
+LDLIBS=-lprotobuf
+LDFLAGS=-pthread
 
-OBJS=cubemap.o
+OBJS=main.o client.o server.o stream.o serverpool.o mutexlock.o input.o httpinput.o udpinput.o parse.o config.o markpool.o acceptor.o stats.o accesslog.o thread.o util.o log.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 +23,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: