-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
39 lines (28 loc) · 937 Bytes
/
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
BUILD_DIR = build/linux
SRC_DIR = src
INCLUDE_DIR = include
CXX = clang++
CXXFLAGS = -std=c++11 -I$(INCLUDE_DIR)
LDFLAGS = -lgumbo -lboost_regex -lboost_system -lboost_filesystem -lcurl
SOURCES = $(wildcard $(SRC_DIR)/*.cpp)
OBJECTS = $(patsubst $(SRC_DIR)/%.cpp, $(BUILD_DIR)/%.o, $(SOURCES))
EXECUTABLE = $(BUILD_DIR)/lol.gg
ifeq ($(CXX), clang++)
CXXFLAGS += -Weverything -Werror -Wno-c++98-compat -Wno-disabled-macro-expansion
else
CXXFLAGS += -Wall -Wextra -pedantic -Werror -pedantic-errors
endif
all: release
debug: CXXFLAGS += -DDEBUG -g -DGLIBCXX_FORCE_NEW
debug: $(SOURCES) $(EXECUTABLE)
release: CXXFLAGS += -O3
release: $(SOURCES) $(EXECUTABLE)
lint: CXXFLAGS += -fsyntax-only
lint: $(SOURCES) $(OBJECTS)
$(EXECUTABLE): $(OBJECTS)
$(CXX) $(LDFLAGS) $(OBJECTS) -o $@
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp
$(CXX) $(CXXFLAGS) -c -o $@ $<
clean:
rm -rf $(EXECUTABLE) $(OBJECTS) $(BUILD_DIR)/Config
.PHONY: all clean