aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2021-12-13 17:12:49 +0100
committerHampusM <hampus@hampusmat.com>2021-12-13 17:12:49 +0100
commita41b799c68923c63547f7ee2d2bbbd9176824622 (patch)
tree217847217c0091717d25a3f1ff5833614a4a8035 /Makefile
parent46015c068caaf2c15b450cf8eec3bb3a527aba42 (diff)
build: add makefile debug target & cflags
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index f90b64e..34cc3b3 100644
--- a/Makefile
+++ b/Makefile
@@ -2,11 +2,17 @@ TARGET=mazerator
SRCS=$(TARGET).c stack.c
CC=gcc
CFLAGS=-Wall
+CFLAGS_DEBUG=-fdiagnostics-color=always -g
all: $(TARGET)
$(TARGET): $(TARGET).c
- $(CC) $(CFLAGS) $(SRCS) -o $(TARGET)
+ $(CC) $(CFLAGS) -O2 $(SRCS) -o $(TARGET)
+
+.PHONY: debug clean
+
+debug: $(TARGET).c
+ $(CC) $(CFLAGS) $(CFLAGS_DEBUG) $(SRCS) -o $(TARGET)
clean:
$(RM) $(TARGET)