-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
52 lines (35 loc) · 1.22 KB
/
makefile
File metadata and controls
52 lines (35 loc) · 1.22 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
CSRC := $(wildcard *.c) $(wildcard device/*.c)
OBJS := $(CSRC:.c=.o)
DEPS := $(wildcard *.d) $(wildcard device/*.d)
TARGET := cpod
CFLAGS += -MMD -MP -Wall -Wextra -Werror -std=c99 -pedantic -ggdb -O0
CFLAGS += -march=x86-64-v2 -mtune=native
LDFLAGS += -fuse-ld=mold
#CFLAGS += -fsanitize=address
#LDFLAGS += -fsanitize=address
CFLAGS += -Wno-unused-parameter -Wno-gnu-zero-variadic-macro-arguments
CFLAGS += -Wno-error=sign-compare -Wno-error=missing-field-initializers \
-Wno-error=unused-variable -Wno-error=strict-prototypes \
-Wno-error=char-subscripts -Wno-error=format \
-Wno-error=unused-function
CCID := $(shell $(CC) --version |head -1 |grep -Eo '^\S*')
OSID := $(shell uname -s)
ifeq ($(OSID),Linux)
ifneq ($(CCID),clang)
$(warning Compilers other than clang are not guaranteed to work on Linux!)
endif
endif
# SDL3
CFLAGS += $(shell pkg-config --cflags sdl3)
LDLIBS += $(shell pkg-config --libs-only-l sdl3)
LDFLAGS += $(shell pkg-config --libs-only-L --libs-only-other sdl3)
# Grand Central Dispatch
CFLAGS += -fblocks
LDLIBS += -ldispatch -lBlocksRuntime
$(TARGET): $(OBJS)
.PHONY: clean distclean
clean:
$(RM) $(OBJS) $(DEPS)
distclean: clean
$(RM) $(TARGET)
#-include $(DEPS)