nDPI/tests/performance/Makefile.in
Ivan Nardi b2357c29c3
Build system: Standardize and improve clean/distclean targets (#3039)
This commit improves the nDPI build system by standardizing cleanup
targets, improving portability, and ensuring complete removal of
generated files during `make distclean`.

Changes:

1. Standardize clean targets (replace /bin/rm with portable $(RM))

2. Add distclean-local targets for complete cleanup

3. Add missing clean/distclean targets

4. Remove obsolete commented-out curl detection code

5. fuzz/Makefile.am: Fix out-of-tree build compatibility by replacing hardcoded
   relative paths (../example/fuzz_*.o) with proper $(top_builddir) variables.
   Add distclean-local target.
2025-11-24 18:42:03 +01:00

73 lines
1.9 KiB
Makefile

# Support for out-of-tree builds (VPATH)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
VPATH = @srcdir@
CFLAGS=@CFLAGS@
AM_CFLAGS=@NDPI_CFLAGS@
INC=-I $(top_srcdir)/src/include/ -I $(top_builddir)/src/include/ -I $(top_srcdir)/src/lib/third_party/include/
LIB=$(top_builddir)/src/lib/libndpi.a @ADDITIONAL_LIBS@ @LIBS@
GEN_HEADERS=$(top_builddir)/src/include/ndpi_config.h $(top_builddir)/src/include/ndpi_define.h
TOOLS=substringsearch patriciasearch gcrypt-int gcrypt-gnu strnstr
TESTS=substring_test patricia_test strnstr_test geo_test
all: $(TESTS)
tools: $(TOOLS)
gcrypt-int: $(srcdir)/gcrypt.c Makefile $(GEN_HEADERS)
$(CC) $(INC) $(AM_CFLAGS) $(CFLAGS) $(srcdir)/gcrypt.c -o $@
gcrypt-gnu: $(srcdir)/gcrypt.c Makefile $(GEN_HEADERS)
$(CC) $(INC) $(AM_CFLAGS) $(CFLAGS) -DHAVE_LIBGCRYPT $(srcdir)/gcrypt.c -o $@ -lgcrypt
substringsearch: $(srcdir)/substringsearch.c Makefile $(GEN_HEADERS)
$(CC) $(INC) $(AM_CFLAGS) $(CFLAGS) $(srcdir)/substringsearch.c -o substringsearch $(LIB)
strnstr: $(srcdir)/strnstr.cpp Makefile $(GEN_HEADERS)
$(CXX) $(INC) $(AM_CFLAGS) $(CFLAGS) $(srcdir)/strnstr.cpp -o strnstr
geo: $(srcdir)/geo.c Makefile $(GEN_HEADERS)
$(CC) $(INC) $(AM_CFLAGS) $(CFLAGS) $(srcdir)/geo.c -o geo $(LIB)
substring_test: substringsearch top-1m.csv
./substringsearch
strnstr_test: strnstr
./strnstr
geo_test: geo
./geo
#
patriciasearch: $(srcdir)/patriciasearch.c Makefile $(GEN_HEADERS)
$(CC) $(INC) $(AM_CFLAGS) $(CFLAGS) $(srcdir)/patriciasearch.c -o patriciasearch $(LIB)
patricia_test: patriciasearch blacklist-ip.txt
./patriciasearch
# Alexa Top 1 Million
top-1m.csv:
wget http://s3.amazonaws.com/alexa-static/top-1m.csv.zip
unzip top-1m.csv.zip
blacklist-ip.txt:
wget http://blacklists.ntop.org/blacklist-ip.txt
clean:
$(RM) $(TOOLS) $(TESTS) *.o *.lo
$(RM) *zip top-1m.csv blacklist-ip.txt
$(RM) -r .libs .deps
distclean: clean
$(RM) Makefile
check:
true # nothing to do here, tests run via make all