forked from mapbox/geojson-vt-cpp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
59 lines (44 loc) · 1.84 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
53
54
55
56
57
58
59
CXXFLAGS += -I include -std=c++14 -Wall -Wextra -D_GLIBCXX_USE_CXX11_ABI=0
RELEASE_FLAGS ?= -O3 -DNDEBUG
DEBUG_FLAGS ?= -g -O0 -DDEBUG
MASON ?= .mason/mason
VARIANT = variant 1.1.5
GEOMETRY = geometry 0.9.3
GEOJSON = geojson 0.4.2
GLFW = glfw 3.1.2
GTEST = gtest 1.8.0
RAPIDJSON = rapidjson 1.1.0
VARIANT_FLAGS = `$(MASON) cflags $(VARIANT)`
GEOMETRY_FLAGS = `$(MASON) cflags $(GEOMETRY)`
GEOJSON_FLAGS = `$(MASON) cflags $(GEOJSON)`
GLFW_FLAGS = `$(MASON) cflags $(GLFW)` `$(MASON) static_libs $(GLFW)` `$(MASON) ldflags $(GLFW)`
GTEST_FLAGS = `$(MASON) cflags $(GTEST)` `$(MASON) static_libs $(GTEST)` `$(MASON) ldflags $(GTEST)`
RAPIDJSON_FLAGS = `$(MASON) cflags $(RAPIDJSON)`
BASE_FLAGS = $(VARIANT_FLAGS) $(GEOMETRY_FLAGS) $(GEOJSON_FLAGS)
DEPS = mason_packages/headers/geometry include/mapbox/geojsonvt/*.hpp include/mapbox/geojsonvt.hpp bench/util.hpp Makefile
default: test
mason_packages/headers/geometry: Makefile
$(MASON) install $(VARIANT)
$(MASON) install $(GEOMETRY)
$(MASON) install $(GEOJSON)
$(MASON) install $(GLFW)
$(MASON) install $(GTEST)
$(MASON) install $(RAPIDJSON)
build:
mkdir -p build
build/bench: build bench/run.cpp $(DEPS)
$(CXX) $(CFLAGS) $(CXXFLAGS) $(RELEASE_FLAGS) bench/run.cpp -o build/bench $(BASE_FLAGS) $(RAPIDJSON_FLAGS)
build/debug: build debug/debug.cpp $(DEPS)
$(CXX) $(CFLAGS) $(CXXFLAGS) $(DEBUG_FLAGS) debug/debug.cpp -o build/debug $(BASE_FLAGS) $(GLFW_FLAGS) $(RAPIDJSON_FLAGS)
build/test: build test/*.cpp test/*.hpp $(DEPS)
$(CXX) $(CFLAGS) $(CXXFLAGS) $(DEBUG_FLAGS) test/test.cpp test/util.cpp -o build/test $(BASE_FLAGS) $(GTEST_FLAGS) $(RAPIDJSON_FLAGS)
bench: build/bench
./build/bench
debug: build/debug
./build/debug
test: build/test
./build/test
format:
clang-format include/mapbox/geojsonvt/*.hpp include/mapbox/geojsonvt.hpp test/*.cpp test/*.hpp debug/debug.cpp bench/*.cpp -i
clean:
rm -rf build