8000 use variables for includes/libs for easy platform-specific corrections · Mgomez-01/matplotlib-cpp@fdbc23a · GitHub
[go: up one dir, main page]

Skip to content

Commit fdbc23a

Browse files
committed
use variables for includes/libs for easy platform-specific corrections
1 parent 40e1571 commit fdbc23a

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

Makefile

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,52 @@
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+
113
examples: minimal basic modern animation nonblock xkcd quiver bar surface fill_inbetween fill update
214

315
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}
517

618
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}
820

921
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}
1123

1224
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}
1426

1527
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}
1729

1830
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}
2032

2133
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}
2335

2436
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}
2638

2739
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}
2941

3042
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}
3244

3345
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}
3547

3648
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}
3850

3951
clean:
4052
rm -f examples/{minimal,basic,modern,animation,nonblock,xkcd,quiver,bar,surface,fill_inbetween,fill,update}

0 commit comments

Comments
 (0)
0