1MUDUO_BUILD ?= release 2MUDUO_DIRECTORY ?= $(HOME)/build/$(MUDUO_BUILD)-install 3MUDUO_INCLUDE = $(MUDUO_DIRECTORY)/include 4MUDUO_LIBRARY = $(MUDUO_DIRECTORY)/lib 5 6CXXFLAGS = -g -Og -Wall -Wextra -Werror \ 7 -Wno-unused-parameter -Wconversion\ 8 -Wold-style-cast -Woverloaded-virtual \ 9 -Wpointer-arith -Wshadow -Wwrite-strings \ 10 -march=native -rdynamic \ 11 -I$(MUDUO_INCLUDE) 12 13LDFLAGS = -L$(MUDUO_LIBRARY) -lmuduo_net -lmuduo_base -lpthread 14 15BINARIES = sender merger word_freq word_freq_shards word_freq_sort 16 17all: $(BINARIES) 18 19clean: 20 rm -f $(BINARIES) core 21 22sender: sender.cc 23 g++ $(CXXFLAGS) -o $@ $^ $(LDFLAGS) 24 25merger: merger.cc 26 g++ $(CXXFLAGS) -o $@ $^ -lboost_system -lpthread 27 28word_freq: word_freq.cc 29 g++ $(CXXFLAGS) -std=c++1y -o $@ $^ 30 31word_freq_shards: word_freq_shards.cc 32 g++ $(CXXFLAGS) -std=c++11 -o $@ $^ 33 34word_freq_sort: word_freq_sort.cc 35 g++ $(CXXFLAGS) -std=c++11 -o $@ $^ 36 37.PHONY: all clean 38