-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (24 loc) · 758 Bytes
/
Makefile
File metadata and controls
31 lines (24 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
.POSIX:
CC = cc
CFLAGS = -Wall -pedantic -O2 -Wno-unused-function
LDFLAGS =
OBJFILES = main.o cJSON.o fileLoading.o converting.o
TARGET = sdc
ifeq ($(OS),Windows_NT)
TARGET = sdc.exe
endif # Windows
all: $(TARGET)
$(TARGET): $(OBJFILES)
$(CC) $(CFLAGS) -o $(TARGET) $(OBJFILES) $(LDFLAGS)
debug: CFLAGS = -Wall -pg -Wextra -Wpedantic -ggdb -Og -DDEBUG_LOGGING
debug: CFLAGS += -fsanitize=address -fsanitize=leak
debug: CFLAGS += -fsanitize=undefined
debug: CFLAGS += -Wdouble-promotion -Wformat -Wformat-overflow
debug: CFLAGS += -Wnull-dereference -Winfinite-recursion
debug: CFLAGS += -Wstrict-overflow -Wno-unused-function -Wconversion
debug: all
rebuild: clean
rebuild: all
clean:
rm -f $(OBJFILES) $(TARGET)
.PHONY: debug rebuild clean