2015-05-16 01:30:37 +08:00
|
|
|
CXX ?= g++
|
2015-05-16 02:45:10 +08:00
|
|
|
CXXFLAGS = -Wall -pedantic -std=c++11 -pthread -Wl,--no-as-needed -O2
|
2015-05-16 01:54:01 +08:00
|
|
|
LDPFALGS = -pthread -flto
|
2015-05-16 01:48:38 +08:00
|
|
|
|
|
|
|
CPP_FILES := $(wildcard *.cpp)
|
|
|
|
OBJ_FILES := $(addprefix ./,$(notdir $(CPP_FILES:.cpp=.o)))
|
|
|
|
|
|
|
|
|
|
|
|
tests: $(OBJ_FILES)
|
|
|
|
$(CXX) $(CXXFLAGS) $(LDPFALGS) -o $@ $^
|
|
|
|
|
|
|
|
%.o: %.cpp
|
|
|
|
g++ $(CXXFLAGS) -c -o $@ $<
|
2015-05-16 01:30:37 +08:00
|
|
|
|
|
|
|
clean:
|
2015-05-16 01:48:38 +08:00
|
|
|
rm -f tests *.o logs/*
|
2015-05-16 01:30:37 +08:00
|
|
|
|
2015-05-16 01:54:01 +08:00
|
|
|
rebuild: clean tests
|
2015-05-16 01:30:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
|