diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -1,5 +1,5 @@ -CC = gcc -CFLAGS = -Wall -Wextra -std=c11 -O3 -fwrapv -flto +CXX = g++ +CXXFLAGS = -Wall -Wextra -std=c++17 -O3 -fwrapv -flto LDFLAGS = TARGET = ttt3d @@ -8,8 +8,11 @@ TARGET = ttt3d all: $(TARGET) clean: - rm -f $(TARGET) + rm -f $(TARGET) *.o -$(TARGET): $(wildcard *.c *.h) - $(CC) $(CFLAGS) -o $@ $(filter %.c,$^) $(LDFLAGS) +$(TARGET): $(patsubst %.cpp,%.o,$(wildcard *.cpp)) + $(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) + +%.o: %.cpp $(wildcard *.h) + $(CXX) $(CXXFLAGS) -c -o $@ $< |