-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
80 lines (60 loc) · 2.43 KB
/
Makefile.in
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
KSRC = @KERNBUILDDIR@
LIBS = -lpthread
DEFS =
ifeq ("NETMAP@NETMAP@", "NETMAPy")
LIBS += -lnetmap
DEFS += -DWITH_NETMAP
endif
all: ker proxy
install: ker_install
clean: ker_clean proxy_clean
ifeq ("DRIVER@DRIVER@", "DRIVERy")
ker:
$(MAKE) -C $(KSRC) M=@SRCDIR@/driver EXTRA_CFLAGS="$(EXTRA_CFLAGS) -g -Werror -I@SRCDIR@/include" modules
ker_install:
$(MAKE) -C $(KSRC) M=@SRCDIR@/driver EXTRA_CFLAGS="$(EXTRA_CFLAGS) -g -Werror -I@SRCDIR@/include" modules_install
ker_clean:
$(MAKE) -C $(KSRC) M=@SRCDIR@/driver clean
else
ker:
ker_install:
ker_clean:
endif
ifeq ("PROXY@PROXY@", "PROXYy")
PROGS = proxy/backend proxy/sring_progs.o proxy/sring_gso_progs.o proxy/vring_packed_progs.o
proxy: $(PROGS)
BESRCS=proxy/backend.c proxy/sring.c proxy/sring_gso.c proxy/vring_packed.c
BEHDRS=include/bpfhv-proxy.h include/bpfhv.h proxy/sring.h proxy/sring_gso.h proxy/vring_packed.h proxy/backend.h sched16/pspat.h include/net_headers.h proxy/mark_fun.h
BEHDRS+=sched16/tsc.h
BEOBJS=$(BESRCS:%.c=%.o)
# scheduler related sources
SCHHDRS= sched16/sched16.h sched16/dn_test.h sched16/cqueue.h proxy/backend.h
SCHSRCS= sched16/dn_sched_fifo.c sched16/dn_sched_rr.c sched16/dn_sched_qfq.c sched16/dn_sched_wf2q.c
SCHSRCS+=sched16/dn_heap.c sched16/test_dn_sched.c sched16/sched_main.c sched16/dn_cfg.c
SCHSRCS+=sched16/sess.c sched16/dn_cfg.c sched16/tsc.c sched16/pspat.c
SCHOBJS=$(SCHSRCS:%.c=%.o)
SCHCFLAGS = -O3 -pipe -g
SCHCFLAGS += -Werror -Wall -Wunused-function -Wunused-result
SCHCFLAGS += -Wextra -I. -Iinclude
ifeq ($(shell uname),Linux)
LIBS += -lrt # on linux
endif
all: $(PROGS)
sched16/%.o: sched16/%.c $(SCHHDRS)
$(CC) $(SCHCFLAGS) -I @SRCDIR@/sched16 -c $< -o $@
proxy/%.o: proxy/%.c $(BEHDRS)
$(CC) -O2 -g -Wall -Werror -Wno-address-of-packed-member -I @SRCDIR@/include $(DEFS) -I @SRCDIR@/sched16 -c $< -o $@
proxy/backend: $(BEOBJS) $(SCHOBJS)
$(CC) -o $@ $(BEOBJS) $(SCHOBJS) $(LIBS)
proxy/sring_progs.o: proxy/sring_progs.c proxy/sring.h include/bpfhv.h
clang -O2 -Wall -I @SRCDIR@/include -target bpf -c $< -o $@
proxy/sring_gso_progs.o: proxy/sring_gso_progs.c proxy/sring_gso.h include/bpfhv.h
clang -O2 -Wall -DWITH_GSO -I @SRCDIR@/include -target bpf -c $< -o $@
proxy/vring_packed_progs.o: proxy/vring_packed_progs.c proxy/vring_packed.h include/bpfhv.h include/net_headers.h proxy/mark_fun.h
clang -O2 -Wall -I @SRCDIR@/include -target bpf -c $< -o $@
proxy_clean:
-rm -rf $(PROGS) $(BEOBJS) $(SCHOBJS)
else
proxy:
proxy_clean:
endif