-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (41 loc) · 1.01 KB
/
Makefile
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
53
NAME := libmoot.so
SRCDIR := src
OBJDIR := .obj
SRC := $(shell find $(SRCDIR) -name '*.cc')
OBJ := $(SRC:$(SRCDIR)/%.cc=$(OBJDIR)/%.o)
DISABLED_WARNINGS := \
implicit-int-float-conversion \
padded \
suggest-destructor-override \
switch-enum \
c99-designator \
pre-c++14-compat \
pre-c++20-compat-pedantic \
c++98-compat \
c++20-compat \
c++20-extensions \
gnu-anonymous-struct \
nested-anon-types \
shadow-field-in-constructor \
global-constructors \
exit-time-destructors \
unsafe-buffer-usage \
CXX := clang++
CXXFLAGS := -fPIC -std=gnu++26 -g -O0 -MMD -MP -I include -isystem lib -Weverything $(addprefix -Wno-,$(DISABLED_WARNINGS))
ifdef $(OS)
LDFLAGS := -LC:\MinGW\bin
endif
LDLIBS := -lsfml-graphics -lsfml-window -lsfml-system -llua
$(NAME): $(OBJ)
$(CXX) -shared -o$@ $^ $(LDFLAGS) $(LDLIBS)
-include $(OBJ:.o=.d)
$(OBJDIR)/%.o: $(SRCDIR)/%.cc
@mkdir -p $(@D)
$(CXX) $(CXXFLAGS) -c -o$@ $<
clean:
rm -rf $(OBJDIR)
distclean: clean
rm -f $(NAME)
re: distclean
make
.PHONY: clean distclean re