blob: b01b82f3bd1f3957ff71470cae8e94ae38efb6ac (
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
|
CC = gcc
CFLAGS += -Wall -Wextra $(EXTRA_CFLAGS)
LIBS += -pthread -lpcap -lm
ifneq ($(CUSTOM_LIBNDPI),)
LIBS += '$(CUSTOM_LIBNDPI)'
CFLAGS += '-I$(shell dirname $(CUSTOM_LIBNDPI))/../include'
ifeq ($(findstring $*.so, $(CUSTOM_LIBNDPI)),.so)
CFLAGS += -Wl,-rpath='$(shell dirname $(CUSTOM_LIBNDPI))'
endif
else
LIBS += -lndpi
endif
ifeq ($(ENABLE_DEBUG),yes)
CFLAGS += -Og -g3
endif
ifeq ($(ENABLE_SANITIZER),yes)
CFLAGS += -fsanitize=address -fsanitize=undefined -fsanitize=leak
LIBS += -lasan -lubsan
endif
ifeq ($(VERBOSE),yes)
CFLAGS += -DVERBOSE
endif
RM = rm -f
main: main.c
$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LIBS)
clean:
$(RM) main
|