TARGET = tests LIBS = -lm CC = c++ CFLAGS = -g -Wall -std=c++1y INCLUDE = "../" .PHONY: default all clean default: $(TARGET) all: default OBJECTS = $(patsubst %.cpp, %.o, $(wildcard *.cpp)) HEADERS = $(wildcard *.hpp) %.o: %.cpp $(HEADERS) $(CC) $(CFLAGS) -I $(INCLUDE) -c $< -o $@ .PRECIOUS: $(TARGET) $(OBJECTS) $(TARGET): $(OBJECTS) $(CC) $(OBJECTS) -Wall $(LIBS) -o $@ clean: -rm -f *.o -rm -f $(TARGET) test: make ./tests