-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (36 loc) · 949 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
40
41
42
43
44
45
46
47
48
49
50
APPNAME=reon
INCLUDE=include
LIBDIR = lib/ctf
LIBINCLUDE = $(LIBDIR)/include
LIBSRC = $(LIBDIR)/src
SRC=src
CXXFLAGS += -std=c++14 -Wall -Wextra -pedantic -I. -I $(INCLUDE) -I $(LIBINCLUDE)
OBJ=obj
$(shell mkdir -p $(OBJ))
HEADERS=$(wildcard $(INCLUDE)/*.h)
LIBHEADERS=$(wildcard $(LIBSRC)/*.hpp)
OBJFILES=$(patsubst $(SRC)/%.cpp,$(OBJ)/%.o,$(wildcard $(SRC)/*.cpp))
.PHONY: all format clean debug build test pack doc run libbuild cleanall
all: deploy
build: $(APPNAME)
debug: CXXFLAGS+=-g -O0
debug: build
deploy: CXXFLAGS+=-O3 -DNDEBUG
deploy: build
$(APPNAME): $(OBJFILES)
$(CXX) $(CXXFLAGS) $(OBJFILES) -o $@ $(LDLIBS)
$(OBJ)/%.o: $(SRC)/%.cpp $(HEADERS) $(LIBHEADERS)
$(CXX) $(CXXFLAGS) -c $< -o $@
clean:
-rm -rf $(OBJFILES) $(APPNAME) doc/html
format:
clang-format -style=file -i $(SRC)/*.cpp $(INCLUDE)/*.h
test: all
make -C test test
pack: all
pack:
zip ctf.zip include/*.h $(APPNAME)
doc:
make -C doc
run: all
./reon