-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
82 lines (61 loc) · 1.19 KB
/
Makefile
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
PROG=etherdump
CFLAGS=-Os -W
#-Wall
# For gdb debugging, does not change ethereal '-d' option
DEBUG=0
USE_IP=1
USE_TCP=1
USE_UDP=1
USE_ICMP=1
USE_ARP=1
USE_FILTERING=1
FLAGS=$(CFLAGS)
OBJECTS=
ifeq ($(DEBUG),1)
FLAGS = -Wall -g -ggdb3
endif
ifeq ($(USE_TCP),1)
OBJECTS += tcp.o
FLAGS += -DUSE_TCP
endif
ifeq ($(USE_UDP),1)
OBJECTS += udp.o
FLAGS += -DUSE_UDP
endif
ifeq ($(USE_IP),1)
OBJECTS += ip.o
FLAGS += -DUSE_IP
endif
ifeq ($(USE_ARP),1)
OBJECTS += arp.o
FLAGS += -DUSE_ARP
endif
ifeq ($(USE_ICMP),1)
OBJECTS += icmp.o
FLAGS += -DUSE_ICMP
endif
ifeq ($(USE_FILTERING),1)
OBJECTS += filtering.o
FLAGS += -DUSE_FILTERING
endif
#ifeq ($(OSTYPE),cygwin)
# OBJECTS += -lws2_32
#endif
all: ethereal
tcp.o: tcp.c
$(CC) $(FLAGS) -c tcp.c
udp.o: udp.c
$(CC) $(FLAGS) -c udp.c
icmp.o: icmp.c
$(CC) $(FLAGS) -c icmp.c
ip.o: ip.c
$(CC) $(FLAGS) -c ip.c
arp.o: arp.c
$(CC) $(FLAGS) -c arp.c
filtering.o: filtering.c
$(CC) $(FLAGS) -c filtering.c
ethereal: $(OBJECTS)
if [ "$$OSTYPE" = "cygwin" ] ; then $(CC) $(FLAGS) ${PROG}.c -o ${PROG} $(OBJECTS) -lws2_32 ; else $(CC) $(FLAGS) ${PROG}.c -o ${PROG} $(OBJECTS) ; fi
[ $(DEBUG) -eq 1 ] || strip ${PROG}
clean:
rm -f etherdump *~ *.o