blob: ee398e22c277a201d14638c254c0c2348c376399 [file] [log] [blame]
David Reiss9f3296b2010-08-31 16:58:41 +00001THRIFT = thrift
David Reiss9f3296b2010-08-31 16:58:41 +00002
3CXXFLAGS += -g3 -O0
4
5GENNAMES = Storage storage_types
6GENHEADERS = $(addsuffix .h, $(GENNAMES))
7GENSRCS = $(addsuffix .cpp, $(GENNAMES))
8GENOBJS = $(addsuffix .o, $(GENNAMES))
9
10PYLIBS = storage/__init__.py
11
12PROGS = test-client test-server test-sender test-receiver
13
14all: $(PYLIBS) $(PROGS)
15
16test-client: test-client.o TZmqClient.o $(GENOBJS)
Jens Geyer3e9c3a22014-12-22 22:21:24 +010017 $(CXX) $^ -o $@ -lzmq -lthrift
David Reiss9f3296b2010-08-31 16:58:41 +000018test-server: test-server.o TZmqServer.o $(GENOBJS)
Jens Geyer3e9c3a22014-12-22 22:21:24 +010019 $(CXX) $^ -o $@ -lzmq -lthrift
David Reiss9f3296b2010-08-31 16:58:41 +000020test-sender: test-sender.o TZmqClient.o $(GENOBJS)
Jens Geyer3e9c3a22014-12-22 22:21:24 +010021 $(CXX) $^ -o $@ -lzmq -lthrift
David Reiss9f3296b2010-08-31 16:58:41 +000022test-receiver: test-receiver.o TZmqServer.o $(GENOBJS)
Jens Geyer3e9c3a22014-12-22 22:21:24 +010023 $(CXX) $^ -o $@ -lzmq -lthrift
David Reiss9f3296b2010-08-31 16:58:41 +000024
25test-client.o test-server.o test-sender.o test-receiver.o: $(GENSRCS)
26
27storage/__init__.py: storage.thrift
28 $(RM) $(dir $@)
Stefan Boluse59b73d2018-05-14 14:48:09 +020029 $(THRIFT) --gen py $<
David Reiss9f3296b2010-08-31 16:58:41 +000030 mv gen-py/$(dir $@) .
31
32$(GENSRCS): storage.thrift
33 $(THRIFT) --gen cpp $<
34 mv $(addprefix gen-cpp/, $(GENSRCS) $(GENHEADERS)) .
35
36clean:
37 $(RM) -r *.o $(PROGS) storage $(GENSRCS) $(GENHEADERS)
38
39.PHONY: clean