-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsender.mk
56 lines (44 loc) · 784 Bytes
/
sender.mk
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
IDIR = include
CC=gcc
CFLAGS= \
-ggdb\
-I$(IDIR)\
-Wall
ODIR=obj
LDIR=lib
BDIR=bin
LIBS= \
-lm\
-lpthread\
-lpcap
_OBJ = \
sender.o\
common.o\
file_utils.o\
packet/custom_header.o\
packet/eth_header.o\
packet/ip_header.o\
packet/udp_header.o\
packet/packet.o
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))
_DEPS = \
common.h\
file_utils.h\
packet/custom_header.h\
packet/eth_header.h\
packet/ip_header.h\
packet/udp_header.h\
packet/packet.h
DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))
$(ODIR)/%.o: src/%.c $(BDIR) $(ODIR)
$(CC) -c -o $@ $< $(CFLAGS)
$(BDIR)/sender: $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(LIBS)
.PHONY: clean
clean:
rm -f $(BDIR)/sender $(ODIR)/*.o *~ core $(INCDIR)/*~
$(ODIR):
mkdir -p $(ODIR)
mkdir -p $(ODIR)/packet
$(BDIR):
mkdir -p $(BDIR)