ntopng/tools/json2tlv/Makefile.in
Sam James c4cd135323
build: respect environment options more (#6177)
* build: move away from configure.seed -> configure.ac

Analogous to the change in nDPI [0].

[0] cf931fda6b

Signed-off-by: Sam James <sam@gentoo.org>

* build: use $(MAKE)

This ensures that parallel make works correctly, as otherwise, a fresh
make job will be started without the jobserver fd, and hence
not know about its parent, forcing -j1.

Signed-off-by: Sam James <sam@gentoo.org>

* build: respect CXX, CXXFLAGS, LDFLAGS/LIBS

- Use standard CXX variable for the C++ compiler
- Respect CXXFLAGS from the environment
- LDFLAGS needs to be before objects in order for some flags to work
  like -Wl,--as-needed

Signed-off-by: Sam James <sam@gentoo.org>

* build: add comment for dynamic linking nDPI

It seems to work for me but add a commented
in line for now for convenience, not actually
changing behaviour right now.

(May want to make it a proper configure option
in future.)

Signed-off-by: Sam James <sam@gentoo.org>
2022-01-07 10:16:59 +01:00

23 lines
715 B
Makefile

PKG_CONFIG?=pkg-config
HAS_JSON=$(shell $(PKG_CONFIG) --exists json-c; echo $$?)
ifeq ($(HAS_JSON), 0)
JSON_INC = $(shell $(PKG_CONFIG) --cflags json-c)
JSON_LIB = $(shell $(PKG_CONFIG) --libs json-c)
else
JSON_HOME=${PWD}/../../third-party/json-c
JSON_INC=-I$(JSON_HOME)
JSON_LIB=$(JSON_HOME)/.libs/libjson-c.a
endif
NDPI_HOME = ../../../nDPI
NDPI_LIB = $(NDPI_HOME)/src/lib/libndpi.a
NDPI_INC = -I$(NDPI_HOME)/src/include -I$(NDPI_HOME)/src/lib/third_party/include
CXXFLAGS?=-O3 -march=native -Wall -Wextra
CXXFLAGS+=-std=c++11
json2tlv: json2tlv.cpp
$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ json2tlv.cpp $(JSON_INC) $(NDPI_INC) -Iinclude $(JSON_LIB) $(NDPI_LIB) -lzmq -lm
clean:
rm -f json2tlv