-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (30 loc) · 1.2 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
# This is just to test weather the code compiles when developing under Linux.
CXXFLAGS += -std=c++14 \
-Ibwapi/bwapi/include \
-IBWEM/include \
-Wall -Wextra\
-Wno-unknown-pragmas
HEADERS := $(wildcard src/*.h)
SOURCES := $(wildcard src/*.cpp)
OBJECTS := $(addprefix obj/,$(notdir $(SOURCES:.cpp=.o)))
.PHONY: all
all: obj $(OBJECTS)
obj:
mkdir obj
obj/%.o: src/%.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $^
.PHONY: clean
clean:
rm -rf obj
# Clang Format - Settings in file .clang-format
.PHONY: format
format:
clang-format -i -style=file $(HEADERS) $(SOURCES)
# Clang Tidy - Removed some rules because...
# - cppcoreguidelines-pro-bounds-array-to-pointer-decay: "assert" brings up a lot of these warnings.
# - cppcoreguidelines-pro-type-vararg: We have to use Broodwar->drawText...(). :/
# - readability-braces-around-statements: I don't like that rule. Let's ignore these.
.PHONY: tidy
tidy:
clang-tidy -checks=cppcoreguidelines-*,modernize-*,readability-*,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-type-vararg,-readability-braces-around-statements \
-header-filter=src/ $(SOURCES) -- $(CXXFLAGS)