blob: 34eb50558538b2e4938b1f4fad0ed60ffbc7a8d7 (
plain)
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
|
CC=@CC@
CXX=@CXX@
BUILD_MINGW=@BUILD_MINGW@
EXE_SUFFIX=@EXE_SUFFIX@
SRCHOME=../../src
ifneq ($(OS),Windows_NT)
CFLAGS+=-fPIC -DPIC
endif
CFLAGS+=-g -I$(SRCHOME)/include @NDPI_CFLAGS@ @JSONC_CFLAGS@ @PCAP_INC@
LIBNDPI=$(SRCHOME)/lib/libndpi.a
LIBS=$(LIBNDPI) @PCAP_LIB@ @ADDITIONAL_LIBS@ @JSONC_LIBS@ @LIBS@
LDFLAGS+=@NDPI_LDFLAGS@
HEADERS=$(SRCHOME)/include/ndpi_api.h $(SRCHOME)/include/ndpi_typedefs.h $(SRCHOME)/include/ndpi_protocol_ids.h
OBJS=unit
PREFIX?=@prefix@
ifneq ($(BUILD_MINGW),)
ifeq ($(DISABLE_NPCAP),0)
CFLAGS+=-I@srcdir@/../windows/WpdPack/Include -I@srcdir@/../windows/WpdPack/Include/pcap
else
CFLAGS+=-DDISABLE_NPCAP
endif
ifeq ($(DISABLE_NPCAP),0)
ifneq ($(BUILD_MINGW_X64),)
LIBS+=@srcdir@/../windows/WpdPack/Lib/x64/wpcap.lib
else
LIBS+=@srcdir@/../windows/WpdPack/Lib/wpcap.lib
endif
endif
LIBS+=-Wl,-Bstatic -lpthread -Wl,-Bdynamic
else
LIBS+=-pthread
endif
all: unit$(EXE_SUFFIX)
EXECUTABLE_SOURCES := unit.c
COMMON_SOURCES := $(filter-out $(EXECUTABLE_SOURCES),$(wildcard *.c ))
unit$(EXE_SUFFIX): $(LIBNDPI) unit.o
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) unit.o $(LIBS) -o $@
%.o: %.c $(HEADERS) Makefile
$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
clean:
/bin/rm -f *.o unit$(EXE_SUFFIX)
/bin/rm -f .*.o.cmd .*.o.d
/bin/rm -rf build
install:
echo ""
distdir:
distclean: clean
/bin/rm -f Makefile
check:
true # nothing to do here, done by invoking tests/do-unit.sh
|