forked from lava/matplotlib-cpp
-
Notifications
You must be signed in to change notification settings - Fork 103
/
Makefile
57 lines (41 loc) · 1.75 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
# Python header include: Put the path to Python.h here
includes = -I /usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/include/python3.7m
# Numpy include: Put the path to numpy/arrayobject.h
includes += -I /usr/local/lib/python3.7/site-packages/numpy/core/include
# Python libraries include: Add the path to the directory containing libpython*.a here
includes += -L /usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib
# Link your Python version
linkings = -lpython3.7
# Compiler definitions
definitions = -std=c++11
# Eigen include
eigen_include = -I /usr/local/include/eigen3
# Executable names for examples (w/o Eigen)
example_execs = minimal modern basic animation nonblock xkcd quiver bar surface subplot fill_inbetween fill update
# Executable names for examples using Eigen
eigen_execs = eigen loglog semilogx semilogy small spy
# Example targets (default if just 'make' is called)
examples: $(example_execs)
# Eigen example targets
eigen: $(eigen_execs)
# All examples
all: examples eigen
# Run all examples
run: run_examples run_eigen
# Compiler instructions for examples
$(example_execs): %: examples/%.cpp matplotlibcpp.h
g++ $< $(includes) $(linkings) -o examples/$@ $(definitions)
# Run examples
run_examples:
for exec in $(example_execs); do ./examples/$$exec; done
# Compiler instructions for Eigen examples
$(eigen_execs): %: examples/%.cpp matplotlibcpp.h
g++ $< $(includes) $(eigen_include) $(linkings) -o examples/$@ $(definitions)
# Run Eigen examples
run_eigen:
for exec in $(eigen_execs); do ./examples/$$exec; done
# Clean all
clean:
# -f to silent warnings if file does not exist
for exec in $(example_execs); do rm -f examples/$$exec; done
for exec in $(eigen_execs); do rm -f examples/$$exec; done