-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (29 loc) · 893 Bytes
/
Makefile
File metadata and controls
39 lines (29 loc) · 893 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
32
33
34
35
36
37
38
CFLAGS := -Isrc -std=c11 -g3 -O2 \
-Wall -Wextra -Wpedantic \
-Wconversion -Wdouble-promotion \
-Wformat=2 -Wshadow -Wwrite-strings \
-Wstrict-prototypes -Wold-style-definition \
-Wredundant-decls -Wnested-externs \
-Wmissing-include-dirs \
-Wno-unused-function -Wno-unused-parameter -Wno-sign-conversion \
-fsanitize=undefined -fsanitize-trap
# -DDEBUG
ifeq ($(CC),gcc)
CFLAGS += -Wjump-misses-init -Wlogical-op
endif
SRC=src
BIN=bin
OBJ=obj
SRCS := $(wildcard $(SRC)/*.c)
OBJS := $(patsubst $(SRC)/%.c,$(OBJ)/%.o,$(SRCS))
EXEC := $(BIN)/aurum
.PHONY: all clean mkdirs
all: $(EXEC)
$(EXEC): $(OBJS) | mkdirs
$(CC) $(CFLAGS) $(OBJS) -o $@
$(OBJ)/%.o: $(SRC)/%.c | mkdirs
$(CC) $(CFLAGS) -c $< -o $@
mkdirs:
@mkdir -p $(BIN) $(OBJ)
clean:
@rm -rf $(BIN)/* core* *~ $(SRC)/*~ docs/* *.dSYM $(OBJ)/*