Rev | Line | |
---|
[4939] | 1 |
|
---|
| 2 | BOOST_DIR = /usr/include/boost
|
---|
| 3 | THRIFT_DIR = /usr/local/include/thrift
|
---|
| 4 | LIB_DIR = /usr/local/lib
|
---|
| 5 | DEFS = -DHAVE_INTTYPES_H -DHAVE_NETINET_IN_H
|
---|
| 6 |
|
---|
| 7 | INC = -I$(THRIFT_DIR) -I$(BOOST_DIR)
|
---|
| 8 |
|
---|
| 9 | GEN_SRC = ./gen-cpp/myService.cpp \
|
---|
| 10 | ./gen-cpp/myservice_types.cpp ./gen-cpp/myservice_constants.cpp
|
---|
| 11 |
|
---|
| 12 | GEN_OBJ = $(patsubst %.cpp,%.o, $(GEN_SRC))
|
---|
| 13 |
|
---|
| 14 |
|
---|
| 15 | .PHONY: all clean
|
---|
| 16 |
|
---|
| 17 | all: gen-cpp server client
|
---|
| 18 |
|
---|
| 19 | gen-cpp: myservice.thrift
|
---|
| 20 | thrift -r -gen cpp myservice.thrift
|
---|
| 21 |
|
---|
| 22 | %.o: %.cpp
|
---|
| 23 | $(CXX) -Wall $(DEFS) $(INC) -c $< -o $@
|
---|
| 24 |
|
---|
| 25 | server: server.o $(GEN_OBJ)
|
---|
| 26 | $(CXX) $^ -o $@ -L$(LIB_DIR) -lthrift
|
---|
| 27 |
|
---|
| 28 | client: client.o $(GEN_OBJ)
|
---|
| 29 | $(CXX) $^ -o $@ -L$(LIB_DIR) -lthrift
|
---|
| 30 |
|
---|
| 31 | clean:
|
---|
| 32 | $(RM) *.o server client
|
---|
| 33 | $(RM) -R gen-cpp |
---|
Note:
See
TracBrowser
for help on using the repository browser.