-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (41 loc) · 1.23 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
41
42
43
44
45
46
47
48
49
50
51
52
ifndef VERBOSE
MAKEFLAGS += --silent
endif
CMAKE_FLAGS := -DCMAKE_EXPORT_COMPILE_COMMANDS=1
SPOOFY_FLAGS := -DSPOOFY_BUILD_TESTS=0 -DSPOOFY_FETCH_DEPS=1
RDKAFKA_FLAGS := -DRDKAFKA_BUILD_STATIC=1 -DRDKAFKA_BUILD_TESTS=OFF
RAPIDJSON_FLAGS := -DRAPIDJSON_BUILD_TESTS=OFF -DRAPIDJSON_BUILD_EXAMPLES=OFF
ifeq ($(OS), Windows_NT)
LIBTINS_FLAGS := -DLIBTINS_BUILD_TESTS=0 -DLIBTINS_BUILD_SHARED=0 -DPCAP_ROOT_DIR=../ext/WpdPack
RM := rmdir /S /Q
else
LIBTINS_FLAGS := -DLIBTINS_BUILD_TESTS=0 -DLIBTINS_BUILD_SHARED=0
RM := rm -rf
endif
.PHONY: default debug release test clean configure
default:
$(MAKE) debug
configure:
mkdir build
ifeq ($(OS), Windows_NT)
cmd /C configure.bat
else
./configure.sh
endif
debug:
cd build ;\
cmake .. -DCMAKE_BUILD_TYPE=Debug $(CMAKE_FLAGS) $(LIBTINS_FLAGS) $(SPOOFY_FLAGS) $(RDKAFKA_FLAGS) $(RAPIDJSON_FLAGS);\
cmake --build . ;\
echo "Build finished, to run: ./build/bin/spoofy"
release:
$(MK_BUILD_DIR)
cd build ;\
cmake .. -DCMAKE_BUILD_TYPE=Release $(CMAKE_FLAGS) $(LIBTINS_FLAGS) $(SPOOFY_FLAGS) $(RDKAFKA_FLAGS) $(RAPIDJSON_FLAGS);\
cmake --build . ;\
echo "Build finished, to run: ./build/bin/spoofy"
test:
cd build ;\
ctest --rerun-failed --output-on-failure
clean:
$(RM) build
mkdir build