From a41b799c68923c63547f7ee2d2bbbd9176824622 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 13 Dec 2021 17:12:49 +0100 Subject: build: add makefile debug target & cflags --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3-18-g5258