David Reiss | 5ddabb8 | 2010-10-06 17:09:37 +0000 | [diff] [blame] | 1 | THRIFT = thrift |
| 2 | CXXFLAGS = `pkg-config --cflags thrift thrift-nb` -levent |
| 3 | LDLIBS = `pkg-config --libs thrift thrift-nb` -levent |
| 4 | CXXFLAGS += -g -O0 |
| 5 | |
| 6 | GENNAMES = Aggr aggr_types |
| 7 | GENHEADERS = $(addsuffix .h, $(GENNAMES)) |
| 8 | GENSRCS = $(addsuffix .cpp, $(GENNAMES)) |
| 9 | GENOBJS = $(addsuffix .o, $(GENNAMES)) |
| 10 | |
| 11 | PYLIBS = aggr/__init__.py |
| 12 | |
| 13 | PROGS = test-server |
| 14 | |
| 15 | all: $(PYLIBS) $(PROGS) |
| 16 | |
| 17 | test-server: test-server.o $(GENOBJS) |
| 18 | |
| 19 | test-server.o: $(GENSRCS) |
| 20 | |
| 21 | aggr/__init__.py: aggr.thrift |
| 22 | $(RM) $(dir $@) |
| 23 | $(THRIFT) --gen py:newstyle $< |
| 24 | mv gen-py/$(dir $@) . |
| 25 | |
| 26 | $(GENSRCS): aggr.thrift |
| 27 | $(THRIFT) --gen cpp:cob_style $< |
| 28 | mv $(addprefix gen-cpp/, $(GENSRCS) $(GENHEADERS)) . |
| 29 | |
| 30 | clean: |
| 31 | $(RM) -r *.o $(PROGS) $(GENSRCS) $(GENHEADERS) gen-* aggr |
| 32 | |
| 33 | .PHONY: clean |