15f798dd9SShuo ChenMUDUO_BUILD ?= release
25f798dd9SShuo ChenMUDUO_DIRECTORY ?= $(HOME)/build/$(MUDUO_BUILD)-install
35f798dd9SShuo ChenMUDUO_INCLUDE = $(MUDUO_DIRECTORY)/include
45f798dd9SShuo ChenMUDUO_LIBRARY = $(MUDUO_DIRECTORY)/lib
55f798dd9SShuo Chen
67e3924f8SShuo ChenCXXFLAGS = -g -Og -Wall -Wextra -Werror \
72c01beb4SShuo Chen	-Wno-unused-parameter -Wconversion\
82c01beb4SShuo Chen	-Wold-style-cast -Woverloaded-virtual \
92c01beb4SShuo Chen	-Wpointer-arith -Wshadow -Wwrite-strings \
102c01beb4SShuo Chen	-march=native -rdynamic \
112c01beb4SShuo Chen	-I$(MUDUO_INCLUDE)
125f798dd9SShuo Chen
135f798dd9SShuo ChenLDFLAGS = -L$(MUDUO_LIBRARY) -lmuduo_net -lmuduo_base -lpthread
145f798dd9SShuo Chen
157e3924f8SShuo ChenBINARIES = sender merger word_freq word_freq_shards word_freq_sort
162c01beb4SShuo Chen
172c01beb4SShuo Chenall: $(BINARIES)
185f798dd9SShuo Chen
195f798dd9SShuo Chenclean:
202c01beb4SShuo Chen	rm -f $(BINARIES) core
215f798dd9SShuo Chen
225f798dd9SShuo Chensender: sender.cc
235f798dd9SShuo Chen	g++ $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
245f798dd9SShuo Chen
2569ab6119SShuo Chenmerger: merger.cc
26353fb8bfSShuo Chen	g++ $(CXXFLAGS) -o $@ $^ -lboost_system -lpthread
2769ab6119SShuo Chen
28144e8e4eSShuo Chenword_freq: word_freq.cc
29144e8e4eSShuo Chen	g++ $(CXXFLAGS) -std=c++1y -o $@ $^
30144e8e4eSShuo Chen
31144e8e4eSShuo Chenword_freq_shards: word_freq_shards.cc
32144e8e4eSShuo Chen	g++ $(CXXFLAGS) -std=c++11 -o $@ $^
33144e8e4eSShuo Chen
347e3924f8SShuo Chenword_freq_sort: word_freq_sort.cc
357e3924f8SShuo Chen	g++ $(CXXFLAGS) -std=c++11 -o $@ $^
367e3924f8SShuo Chen
375f798dd9SShuo Chen.PHONY: all clean
38