Skip to content

Commit dfa2f54

Browse files
committed
DEBUG as a make option
1 parent 693ad16 commit dfa2f54

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: comsock/Makefile

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
TARGET = comsock
22
LIBS = -lm
33
CC = gcc
4-
CFLAGS = -g -Wall -Isrc -I../libraries/CiC/src -I../libraries/Stubborn/src -DDEBUG=1
4+
CFLAGS = -g -Wall -Isrc -I../libraries/CiC/src -I../libraries/Stubborn/src
55
OBJDIR = ./build
6+
DEBUGFLAGS = -DDEBUG
67

78
.PHONY: test all clean
89

@@ -23,5 +24,9 @@ build/%.o: %.c $(HEADERS)
2324
$(TARGET): main.c $(OBJECTS) $(CICOBJECTS)
2425
$(CC) $(CFLAGS) $< $(OBJECTS) $(CICOBJECTS) $(LIBS) -o $@
2526

27+
# Target to enable debug option
28+
debug: CFLAGS += $(DEBUGFLAGS)
29+
debug: all
30+
2631
clean:
27-
-rm -f $(OBJDIR)/*.o $(TARGET)
32+
-rm -f $(OBJDIR)/*.o $(TARGET)

0 commit comments

Comments
 (0)