CXX = g++ CXXFLAGS = -Wall -Wextra -std=c++11 -O2 -fwrapv LDFLAGS = -pthread .PHONY: all clean remake all: roots clean: rm -f roots *.o remake: clean $(MAKE) all roots: $(patsubst %.cpp,%.o,$(wildcard *.cpp)) $(CXX) -o $@ $^ $(LDFLAGS) %.o: %.cpp $(wildcard *.h) $(CXX) $(CXXFLAGS) -c -o $@ $<