]>
Commit | Line | Data |
---|---|---|
f67539c2 TL |
1 | THRIFT = thrift |
2 | ||
3 | CXXFLAGS += -g3 -O0 | |
4 | ||
5 | GENNAMES = Storage storage_types | |
6 | GENHEADERS = $(addsuffix .h, $(GENNAMES)) | |
7 | GENSRCS = $(addsuffix .cpp, $(GENNAMES)) | |
8 | GENOBJS = $(addsuffix .o, $(GENNAMES)) | |
9 | ||
10 | PYLIBS = storage/__init__.py | |
11 | ||
12 | PROGS = test-client test-server test-sender test-receiver | |
13 | ||
14 | all: $(PYLIBS) $(PROGS) | |
15 | ||
16 | test-client: test-client.o TZmqClient.o $(GENOBJS) | |
17 | $(CXX) $^ -o $@ -lzmq -lthrift | |
18 | test-server: test-server.o TZmqServer.o $(GENOBJS) | |
19 | $(CXX) $^ -o $@ -lzmq -lthrift | |
20 | test-sender: test-sender.o TZmqClient.o $(GENOBJS) | |
21 | $(CXX) $^ -o $@ -lzmq -lthrift | |
22 | test-receiver: test-receiver.o TZmqServer.o $(GENOBJS) | |
23 | $(CXX) $^ -o $@ -lzmq -lthrift | |
24 | ||
25 | test-client.o test-server.o test-sender.o test-receiver.o: $(GENSRCS) | |
26 | ||
27 | storage/__init__.py: storage.thrift | |
28 | $(RM) $(dir $@) | |
29 | $(THRIFT) --gen py $< | |
30 | mv gen-py/$(dir $@) . | |
31 | ||
32 | $(GENSRCS): storage.thrift | |
33 | $(THRIFT) --gen cpp $< | |
34 | mv $(addprefix gen-cpp/, $(GENSRCS) $(GENHEADERS)) . | |
35 | ||
36 | clean: | |
37 | $(RM) -r *.o $(PROGS) storage $(GENSRCS) $(GENHEADERS) | |
38 | ||
39 | .PHONY: clean |