David Reiss | 9f3296b | 2010-08-31 16:58:41 +0000 | [diff] [blame] | 1 | THRIFT = thrift |
| 2 | CXXFLAGS = `pkg-config --cflags libzmq thrift` |
| 3 | LDLIBS = `pkg-config --libs libzmq thrift` |
| 4 | |
| 5 | CXXFLAGS += -g3 -O0 |
| 6 | |
| 7 | GENNAMES = Storage storage_types |
| 8 | GENHEADERS = $(addsuffix .h, $(GENNAMES)) |
| 9 | GENSRCS = $(addsuffix .cpp, $(GENNAMES)) |
| 10 | GENOBJS = $(addsuffix .o, $(GENNAMES)) |
| 11 | |
| 12 | PYLIBS = storage/__init__.py |
| 13 | |
| 14 | PROGS = test-client test-server test-sender test-receiver |
| 15 | |
| 16 | all: $(PYLIBS) $(PROGS) |
| 17 | |
| 18 | test-client: test-client.o TZmqClient.o $(GENOBJS) |
| 19 | test-server: test-server.o TZmqServer.o $(GENOBJS) |
| 20 | test-sender: test-sender.o TZmqClient.o $(GENOBJS) |
| 21 | test-receiver: test-receiver.o TZmqServer.o $(GENOBJS) |
| 22 | |
| 23 | test-client.o test-server.o test-sender.o test-receiver.o: $(GENSRCS) |
| 24 | |
| 25 | storage/__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 | |
| 34 | clean: |
| 35 | $(RM) -r *.o $(PROGS) storage $(GENSRCS) $(GENHEADERS) |
| 36 | |
| 37 | .PHONY: clean |