-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (21 loc) · 755 Bytes
/
Makefile
File metadata and controls
29 lines (21 loc) · 755 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
SOURCEFILES = bubble.c queue.c quick.c set.c shell.c sorting_comparison.c sorting_statistics.c stack.c
OBJECTFILES = bubble.o queue.o quick.o set.o shell.o sorting_comparison.o sorting_statistics.o stack.o
OUTPUT = sorting_comparison
CC = clang
CFLAGS = -Wall -Wextra -Werror -Wpedantic -Ofast
LDFLAGS = -flto -Ofast
.PHONY: all debug clean format
all: $(OUTPUT)
$(OUTPUT): $(OBJECTFILES)
$(CC) $(LDFLAGS) -o $(OUTPUT) $(OBJECTFILES)
$(OBJECTFILES): $(SOURCEFILES)
$(CC) $(CFLAGS) -c $(SOURCEFILES)
debug: CFLAGS += -g -O0
debug: CFLAGS := $(filter-out -Ofast, $(CFLAGS))
debug: LDFLAGS += -O0
debug: LDFLAGS := $(filter-out -flto -Ofast, $(LDFLAGS))
debug: all
clean:
rm -f $(OUTPUT) $(OBJECTFILES)
format:
clang-format -i -style=file *.[ch]