-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
40 lines (33 loc) · 1.49 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
## Copyright 2015/2016 Yahoo Inc.
## Licensed under the BSD license, see LICENSE file for terms.
## Written by Chris Rohlf
CXX = clang++
CXXFLAGS = -std=c++11 -Wall -pedantic
LDFLAGS = -L /usr/local/lib -luv -lcurl
MATHILDA_LDFLAGS = build/libmathilda.so
INCLUDE_DIR = -I utils/ -I lib/ -I/usr/local/include
DEBUG_FLAGS = -DDEBUG -ggdb
UNIT_TEST = -DMATHILDA_TESTING
ASAN = -fsanitize=address -lasan
all: library spider dirbuster test
## Builds libmathilda library shared object
## This includes everything in utils/
library:
mkdir build/ ; $(CXX) $(CXXFLAGS) $(DEBUG_FLAGS) -fPIC lib/mathilda.cpp lib/mathilda_fork.cpp lib/mathilda_c.cpp \
utils/mathilda_utils.cpp utils/mathilda_dns.cpp \
$(LDFLAGS) $(INCLUDE_DIR) -shared -o build/libmathilda.so && chmod 644 build/libmathilda.so
## Builds a stand alone spider for testing
spider: library
$(CXX) $(CXXFLAGS) $(DEBUG_FLAGS) $(INCLUDE_DIR) -DSPIDER utils/spider.cpp -o build/spider $(LDFLAGS) $(MATHILDA_LDFLAGS) -lgumbo
## Builds a stand alone dirbuster for testing
dirbuster: library
$(CXX) $(CXXFLAGS) $(DEBUG_FLAGS) $(INCLUDE_DIR) -DDIRBUSTER utils/dirbuster.cpp -o build/dirbuster $(LDFLAGS) $(MATHILDA_LDFLAGS)
## Builds the standard unit tests found
## in mathilda.cpp
test: library
$(CXX) $(CXXFLAGS) $(UNIT_TEST) $(INCLUDE_DIR) $(DEBUG_FLAGS) lib/mathilda.cpp lib/mathilda_fork.cpp \
utils/mathilda_utils.cpp -o build/mathilda_test $(LDFLAGS) $(MATHILDA_LDFLAGS)
## Cleans up all build artificats by
## deleting everything in build/
clean:
rm -rf build/*