forked from outscale/packetgraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.mk
60 lines (44 loc) · 2.44 KB
/
example.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
56
57
58
59
60
EXAMPLE=true
.PHONY: exampleclean examplefclean
################################################################################
## Examples ##
################################################################################
example_firewall_SOURCES = examples/firewall/firewall.c
example_firewall_OBJECTS = $(example_firewall_SOURCES:.c=.o)
example_switch_SOURCES = examples/switch/switch.c
example_switch_OBJECTS = examples/switch/switch.o
example_rxtx_SOURCES = examples/rxtx/rxtx.c
example_rxtx_OBJECTS = examples/rxtx/rxtx.o
example_nic_SOURCES = examples/nic/nic.c
example_nic_OBJECTS = examples/nic/nic.o
example_dperf_SOURCES = examples/dperf/dperf.c
example_dperf_OBJECTS = examples/dperf/dperf.o
example_dperf_CFLAGS = $(PG_CFLAGS) -Wno-address-of-packed-member
example_CFLAGS = $(PG_CFLAGS)
example_HEADERS = $(PG_HEADERS)
example_LDFLAGS = -lpacketgraph $(PG_LIBADD) -L$(srcdir) -ldl -lm -lnuma -lpthread -lpcap -lz
example: all example-firewall example-switch example-rxtx example-nic example-dperf
example-firewall: $(example_firewall_OBJECTS)
$(CC) $(example_CFLAGS) $(example_HEADERS) $(example_firewall_OBJECTS) $(example_LDFLAGS) -o $@
$(example_firewall_OBJECTS): %.o : %.c
$(CC) -c $(example_CFLAGS) $(example_HEADERS) $< -o $@
example-switch: $(example_switch_OBJECTS)
$(CC) $(example_CFLAGS) $(example_HEADERS) $(example_switch_OBJECTS) $(example_LDFLAGS) -o $@
$(example_switch_OBJECTS): %.o : %.c
$(CC) -c $(example_CFLAGS) $(example_HEADERS) $< -o $@
example-rxtx: $(example_rxtx_OBJECTS)
$(CC) $(example_CFLAGS) $(example_HEADERS) $(example_rxtx_OBJECTS) $(example_LDFLAGS) -o $@
$(example_rxtx_OBJECTS): %.o : %.c
$(CC) -c $(example_CFLAGS) $(example_HEADERS) $< -o $@
example-nic: $(example_nic_OBJECTS)
$(CC) $(example_CFLAGS) $(example_HEADERS) $(example_nic_OBJECTS) $(example_LDFLAGS) -o $@
$(example_nic_OBJECTS): %.o : %.c
$(CC) -c $(example_CFLAGS) $(example_HEADERS) $< -o $@
example-dperf: $(example_dperf_OBJECTS)
$(CC) $(example_dperf_CFLAGS) $(example_HEADERS) $(example_dperf_OBJECTS) $(example_LDFLAGS) -o $@
$(example_dperf_OBJECTS): %.o : %.c
$(CC) -c $(example_dperf_CFLAGS) $(example_HEADERS) $< -o $@
exampleclean:
rm -fv $(example_firewall_OBJECTS) $(example_switch_OBJECTS) $(example_rxtx_OBJECTS) $(example_nic_OBJECTS) $(example_dperf_OBJECTS)
examplefclean: exampleclean
rm -fv example-firewall example-switch example-rxtx example-nic example-dperf