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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
CXXFLAGS+=$(shell dpkg-buildflags --get CXXFLAGS)
LDFLAGS+= $(shell dpkg-buildflags --get CXXFLAGS) -lutil -lboost_iostreams -lboost_system -lboost_filesystem
CXXFLAGS+=--std=c++11 -DUSE_ARMA=1
ALL_EXAMPLES=example-misc example-data-1d example-data-2d example-interactive
TEST_BINARIES=test-noncopyable test-outputs
all: $(ALL_EXAMPLES)
%.o: %.cc gnuplot-iostream.h
$(CXX) $(CXXFLAGS) -c $< -o $@
example-misc: example-misc.o
$(CXX) -o $@ $^ $(LDFLAGS)
example-data-1d: example-data-1d.o
$(CXX) -o $@ $^ $(LDFLAGS)
example-data-2d: example-data-2d.o
$(CXX) -o $@ $^ $(LDFLAGS)
example-interactive: example-interactive.o
$(CXX) -o $@ $^ $(LDFLAGS)
test-noncopyable: test-noncopyable.o
$(CXX) -o $@ $^ $(LDFLAGS)
test-outputs: test-outputs.o
$(CXX) -o $@ $^ $(LDFLAGS)
test-asserts: test-assert-depth.error.txt test-assert-depth-colmajor.error.txt
%.error.txt: %.cc gnuplot-iostream.h
! $(CXX) $(CXXFLAGS) -c $< -o $<.o 2> $@
grep -q 'container not deep enough\|boost::STATIC_ASSERTION_FAILURE' $@
test: $(TEST_BINARIES) test-asserts
mkdir -p unittest-output
rm -f unittest-output/*
./test-outputs
clean:
rm -f *.o
rm -f *.error.txt
rm -f $(ALL_EXAMPLES) $(TEST_BINARIES)
rm -f *.exe *.obj
rm -f my_graph_*.png external_binary.dat external_binary.gnu external_text.dat external_text.gnu inline_binary.gnu inline_text.gnu
lint:
cpplint.py --filter=-whitespace,-readability/streams,-build/header_guard gnuplot-iostream.h
cppcheck:
cppcheck *.cc *.h --template gcc --enable=all -q
|