blob: a1d71568d8b18b6d370cdc2975234a8ed241b3f0 [file] [log] [blame]
David Reiss9f3296b2010-08-31 16:58:41 +00001THRIFT = thrift
2CXXFLAGS = `pkg-config --cflags libzmq thrift`
3LDLIBS = `pkg-config --libs libzmq thrift`
4
5CXXFLAGS += -g3 -O0
6
7GENNAMES = Storage storage_types
8GENHEADERS = $(addsuffix .h, $(GENNAMES))
9GENSRCS = $(addsuffix .cpp, $(GENNAMES))
10GENOBJS = $(addsuffix .o, $(GENNAMES))
11
12PYLIBS = storage/__init__.py
13
14PROGS = test-client test-server test-sender test-receiver
15
16all: $(PYLIBS) $(PROGS)
17
18test-client: test-client.o TZmqClient.o $(GENOBJS)
19test-server: test-server.o TZmqServer.o $(GENOBJS)
20test-sender: test-sender.o TZmqClient.o $(GENOBJS)
21test-receiver: test-receiver.o TZmqServer.o $(GENOBJS)
22
23test-client.o test-server.o test-sender.o test-receiver.o: $(GENSRCS)
24
25storage/__init__.py: storage.thrift
26 $(RM) $(dir $@)
27 $(THRIFT) --gen py:newstyle $<
28 mv gen-py/$(dir $@) .
29
30$(GENSRCS): storage.thrift
31 $(THRIFT) --gen cpp $<
32 mv $(addprefix gen-cpp/, $(GENSRCS) $(GENHEADERS)) .
33
34clean:
35 $(RM) -r *.o $(PROGS) storage $(GENSRCS) $(GENHEADERS)
36
37.PHONY: clean