summaryrefslogtreecommitdiff
path: root/contrib/zeromq/Makefile
blob: b09f4ee34a351d3a0cdae187d90582275d555e5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
THRIFT = thrift

CXXFLAGS += -g3 -O0

GENNAMES = Storage storage_types
GENHEADERS = $(addsuffix .h, $(GENNAMES))
GENSRCS = $(addsuffix .cpp, $(GENNAMES))
GENOBJS = $(addsuffix .o, $(GENNAMES))

PYLIBS = storage/__init__.py

PROGS =  test-client test-server test-sender test-receiver

all: $(PYLIBS) $(PROGS)

test-client: test-client.o TZmqClient.o $(GENOBJS)
	$(CXX) $^ -o $@ -lzmq -lthrift
test-server: test-server.o TZmqServer.o $(GENOBJS)
	$(CXX) $^ -o $@ -lzmq -lthrift
test-sender: test-sender.o TZmqClient.o $(GENOBJS)
	$(CXX) $^ -o $@ -lzmq -lthrift
test-receiver: test-receiver.o TZmqServer.o $(GENOBJS)
	$(CXX) $^ -o $@ -lzmq -lthrift

test-client.o test-server.o test-sender.o test-receiver.o: $(GENSRCS)

storage/__init__.py: storage.thrift
	$(RM) $(dir $@)
	$(THRIFT) --gen py:newstyle $<
	mv gen-py/$(dir $@) .

$(GENSRCS): storage.thrift
	$(THRIFT) --gen cpp $<
	mv $(addprefix gen-cpp/, $(GENSRCS) $(GENHEADERS)) .

clean:
	$(RM) -r *.o $(PROGS) storage $(GENSRCS) $(GENHEADERS)

.PHONY: clean