1 2CXXFLAGS = -Wall -std=c++11 -pthread -O2 -g -iquote include/ -I../ -I/usr/local/include 3LDFLAGS = -L lib/ -L/usr/local/lib -ltpc 4 5LIB_HEADERS := $(wildcard include/*.h) ../datetime/Timestamp.h ../thread/Atomic.h 6LIB_SRCS := $(wildcard lib/*.cc) ../datetime/Timestamp.cc 7LIB_OBJS := $(LIB_SRCS:.cc=.o) 8LIB := lib/libtpc.a 9 10BIN_SRCS := $(wildcard bin/*.cc) 11BINS := $(BIN_SRCS:.cc=) 12 13all: $(BINS) 14lib: $(LIB) 15 16$(LIB_OBJS) : Makefile $(LIB_HEADERS) 17 18$(LIB): $(LIB_OBJS) 19 ar rcs $@ $^ 20 21$(BINS): $(LIB) 22 23bin/ttcp: LDLIBS += -lboost_program_options 24 25clean: 26 rm -f $(LIB_OBJS) $(LIB) $(BINS) 27 28