-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (30 loc) · 808 Bytes
/
Makefile
File metadata and controls
40 lines (30 loc) · 808 Bytes
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
CXX = g++
FLAGS = -std=c++11 -g -Wall -Wextra -Werror
LFLAGS = -lssl -lcrypto
BINCPP = $(wildcard src/problem*.cpp)
BIN = $(BINCPP:src/problem%.cpp=p%)
LIBCPP = src/bytevector.cpp \
src/cookie.cpp \
src/MT19937.cpp \
src/Crypto.cpp
LIBOBJ = $(LIBCPP:src/%.cpp=build/%.o)
LIBHEAD = $(LIBCPP:%.cpp=%.h)
CPP = $(BINCPP) $(LIBCPP)
OBJ = $(CPP:src/%.cpp=build/%.o)
ifdef ASAN
FLAGS += -fsanitize=address
LFLAGS += -fsanitize=address
endif
all: $(BIN)
p% : build/problem%.o $(LIBOBJ) $(LIBHEAD)
@ echo "Linking $@"
@ $(CXX) $(FLAGS) $< $(LIBOBJ) -o $@ $(LFLAGS)
build/%.o: src/%.cpp
@ mkdir -p $(@D)
@ echo "Compiling $@"
@ $(CXX) $(FLAGS) -c $< -o $@
clean:
@ echo "Removing build files"
@ rm -f $(BIN)
@ rm -rf build
.PRECIOUS: $(OBJ)