-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
43 lines (31 loc) · 966 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
# External configuration discovery
MAPNIK_CPPFLAGS := $(shell mapnik-config --cflags)
MAPNIK_LIBS := $(shell mapnik-config --libs)
MAPNIK_INPUT_PLUGIN_DIR := $(shell mapnik-config --input-plugins)
# Variable defaults
AGG_INCLUDE?=/usr/include/agg2
CPPFLAGS ?= -I$(AGG_INCLUDE)
CXXFLAGS ?=
CXXFLAGS_SHARED ?= -fPIC
LDFLAGS ?=
CXX ?= g++
# Customizations
CPPFLAGS += $(MAPNIK_CPPFLAGS)
# Rules
%.os: %.cpp
$(CXX) -c $(CXXFLAGS) $(CXXFLAGS_SHARED) $(CPPFLAGS) -MMD -MP -MF .$<.d $< -o $@
# Phony targets
all: heatmap.input
install: all
cp $(wildcard *.input) $(MAPNIK_INPUT_PLUGIN_DIR)
clean:
$(RM) $(wildcard *.os) $(wildcard .*.d) $(wildcard *.input)
.PHONY: all install clean
# Dependencies
include $(wildcard .*.d)
# Explicit Targets
heatmap.input: \
heatmap_datasource.os chained_datasource.os \
rasterizer_datasource.os density_mask.os
$(CXX) -o $@ $(CXXFLAGS) $(CXXFLAGS_SHARED) -shared $+ \
$(LDFLAGS) -Wl,--no-undefined $(MAPNIK_LIBS)