summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 8 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 3652a5d..59e28d0 100644
--- a/Makefile
+++ b/Makefile
@@ -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 $@ $<