|
| 1 | +# Put the path to your Python.h here |
| 2 | +includes = -I/usr/include/python2.7 |
| 3 | + |
| 4 | +# Add the path to the directory containing libpython*.a here if the linking fails |
| 5 | +# includes += -L/usr/share/lib/... |
| 6 | + |
| 7 | +# Link your python version |
| 8 | +linkings = -lpython2.7 |
| 9 | + |
| 10 | +# Compiler definitions |
| 11 | +definitions = -std=c++11 |
| 12 | + |
1 | 13 | examples: minimal basic modern animation nonblock xkcd quiver bar surface fill_inbetween fill update
|
2 | 14 |
|
3 | 15 | minimal: examples/minimal.cpp matplotlibcpp.h
|
4 |
| - cd examples && g++ -DWITHOUT_NUMPY minimal.cpp -I/usr/include/python2.7 -lpython2.7 -o minimal -std=c++11 |
| 16 | + cd examples && g++ -DWITHOUT_NUMPY minimal.cpp ${includes} ${linkings} -o minimal ${definitions} |
5 | 17 |
|
6 | 18 | basic: examples/basic.cpp matplotlibcpp.h
|
7 |
| - cd examples && g++ basic.cpp -I/usr/include/python2.7 -lpython2.7 -o basic -std=c++11 |
| 19 | + cd examples && g++ basic.cpp ${includes} ${linkings} -o basic ${definitions} |
8 | 20 |
|
9 | 21 | modern: examples/modern.cpp matplotlibcpp.h
|
10 |
| - cd examples && g++ modern.cpp -I/usr/include/python2.7 -lpython2.7 -o modern -std=c++11 |
| 22 | + cd examples && g++ modern.cpp ${includes} ${linkings} -o modern ${definitions} |
11 | 23 |
|
12 | 24 | animation: examples/animation.cpp matplotlibcpp.h
|
13 |
| - cd examples && g++ animation.cpp -I/usr/include/python2.7 -lpython2.7 -o animation -std=c++11 |
| 25 | + cd examples && g++ animation.cpp ${includes} ${linkings} -o animation ${definitions} |
14 | 26 |
|
15 | 27 | nonblock: examples/nonblock.cpp matplotlibcpp.h
|
16 |
| - cd examples && g++ nonblock.cpp -I/usr/include/python2.7 -lpython2.7 -o nonblock -std=c++11 |
| 28 | + cd examples && g++ nonblock.cpp ${includes} ${linkings} -o nonblock ${definitions} |
17 | 29 |
|
18 | 30 | quiver: examples/quiver.cpp matplotlibcpp.h
|
19 |
| - cd examples && g++ quiver.cpp -I/usr/include/python2.7 -lpython2.7 -o quiver -std=c++11 |
| 31 | + cd examples && g++ quiver.cpp ${includes} ${linkings} -o quiver ${definitions} |
20 | 32 |
|
21 | 33 | xkcd: examples/xkcd.cpp matplotlibcpp.h
|
22 |
| - cd examples && g++ xkcd.cpp -I/usr/include/python2.7 -lpython2.7 -o xkcd -std=c++11 |
| 34 | + cd examples && g++ xkcd.cpp ${includes} ${linkings} -o xkcd ${definitions} |
23 | 35 |
|
24 | 36 | bar: examples/bar.cpp matplotlibcpp.h
|
25 |
| - cd examples && g++ bar.cpp -I/usr/include/python2.7 -lpython2.7 -o bar -std=c++11 |
| 37 | + cd examples && g++ bar.cpp ${includes} ${linkings} -o bar ${definitions} |
26 | 38 |
|
27 | 39 | surface: examples/surface.cpp matplotlibcpp.h
|
28 |
| - cd examples && g++ surface.cpp -I/usr/include/python2.7 -lpython2.7 -o surface -std=c++11 |
| 40 | + cd examples && g++ surface.cpp ${includes} ${linkings} -o surface ${definitions} |
29 | 41 |
|
30 | 42 | fill_inbetween: examples/fill_inbetween.cpp matplotlibcpp.h
|
31 |
| - cd examples && g++ fill_inbetween.cpp -I/usr/include/python2.7 -lpython2.7 -o fill_inbetween -std=c++11 |
| 43 | + cd examples && g++ fill_inbetween.cpp ${includes} ${linkings} -o fill_inbetween ${definitions} |
32 | 44 |
|
33 | 45 | fill: examples/fill.cpp matplotlibcpp.h
|
34 |
| - cd examples && g++ fill.cpp -I/usr/include/python2.7 -lpython2.7 -o fill -std=c++11 |
| 46 | + cd examples && g++ fill.cpp ${includes} ${linkings} -o fill ${definitions} |
35 | 47 |
|
36 | 48 | update: examples/update.cpp matplotlibcpp.h
|
37 |
| - cd examples && g++ update.cpp -I/usr/include/python2.7 -lpython2.7 -o update -std=c++11 |
| 49 | + cd examples && g++ update.cpp ${includes} ${linkings} -o update ${definitions} |
38 | 50 |
|
39 | 51 | clean:
|
40 | 52 | rm -f examples/{minimal,basic,modern,animation,nonblock,xkcd,quiver,bar,surface,fill_inbetween,fill,update}
|
0 commit comments