25 lines
390 B
Makefile
25 lines
390 B
Makefile
|
TARGET = tests
|
||
|
LIBS = -lm
|
||
|
CC = c++
|
||
|
CFLAGS = -g -Wall
|
||
|
|
||
|
.PHONY: default all clean
|
||
|
|
||
|
default: $(TARGET)
|
||
|
all: default
|
||
|
|
||
|
OBJECTS = $(patsubst %.cpp, %.o, $(wildcard *.cpp))
|
||
|
HEADERS = $(wildcard *.hpp)
|
||
|
|
||
|
%.o: %.cpp $(HEADERS)
|
||
|
$(CC) $(CFLAGS) -c $< -o $@
|
||
|
|
||
|
.PRECIOUS: $(TARGET) $(OBJECTS)
|
||
|
|
||
|
$(TARGET): $(OBJECTS)
|
||
|
$(CC) $(OBJECTS) -Wall $(LIBS) -o $@
|
||
|
|
||
|
clean:
|
||
|
-rm -f *.o
|
||
|
-rm -f $(TARGET)
|