aboutsummaryrefslogtreecommitdiff
path: root/tests/benchmark/Makefile.in
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2021-07-19 22:41:11 +0200
committerToni Uhlig <matzeton@googlemail.com>2021-07-19 22:41:11 +0200
commit14df89ffb00264b014bca355b2f34941fe4f0d03 (patch)
tree07064045b6685f2319b32f5ecdd81854dea3f488 /tests/benchmark/Makefile.in
parent32275543c421eae55fd98a5a98e00059a0407953 (diff)
Added benchmarking support via Google's libbenchmark.add/google-benchmark
* disabled confusing GMake builtin rules which are not used anyway * updated .gitignore Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'tests/benchmark/Makefile.in')
-rw-r--r--tests/benchmark/Makefile.in49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/benchmark/Makefile.in b/tests/benchmark/Makefile.in
new file mode 100644
index 000000000..8ce5044b9
--- /dev/null
+++ b/tests/benchmark/Makefile.in
@@ -0,0 +1,49 @@
+MAKEFLAGS += --no-builtin-rules
+BUILD_BENCHMARK=@BUILD_BENCHMARK@
+
+ifneq ($(BUILD_BENCHMARK),)
+
+CC=@CC@
+CXX=@CXX@
+
+SRCHOME=../../src
+
+CXXFLAGS=-g -fPIC -DPIC -I$(SRCHOME)/include -I$(SRCHOME)/../example @PCAP_INC@ @CFLAGS@
+LIBNDPI=$(SRCHOME)/../example/libndpiReader.a $(SRCHOME)/lib/libndpi.a
+LDFLAGS=$(LIBNDPI) @PCAP_LIB@ @LIBS@ @ADDITIONAL_LIBS@ -lpthread -lm @LDFLAGS@
+HEADERS=$(SRCHOME)/include/ndpi_api.h $(SRCHOME)/include/ndpi_typedefs.h $(SRCHOME)/include/ndpi_protocol_ids.h \
+ $(SRCHOME)/../example/reader_util.h
+PREFIX?=@prefix@
+
+all: benchmark
+
+benchmark: $(LIBNDPI) benchmark.o
+ $(CXX) $(CXXFLAGS) benchmark.o -o $@ $(LDFLAGS)
+
+%.o: %.cpp $(HEADERS) Makefile
+ $(CXX) $(CXXFLAGS) -c $< -o $@
+
+clean:
+ /bin/rm -f *.o benchmark
+ /bin/rm -f .*.o.cmd .*.o.d
+ /bin/rm -rf build
+
+install:
+ echo ""
+
+distclean: clean
+ /bin/rm -f Makefile
+
+else
+
+all: benchmark
+benchmark:
+clean:
+install:
+distclean:
+%.o: %.cpp
+
+endif
+
+distdir:
+ find . -maxdepth 1 -type f -name '*.cpp' -o -name '*.h' -o -name '*.py' | xargs -I'{}' cp '{}' '$(distdir)/{}'