forked from AltraMayor/gatekeeper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (52 loc) · 2.22 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
# Gatekeeper - DoS protection system.
# Copyright (C) 2016 Digirati LTDA.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# XXX This Makefile (in combination with the DPDK Makefiles) does
# not recognize when a file has changed and re-compilation is
# needed -- you need to explicitly do `make clean`. We probably
# need to add a directive to look in the subdirectories.
ifeq ($(RTE_SDK),)
$(error "Please define RTE_SDK environment variable.")
endif
RTE_TARGET ?= x86_64-native-linuxapp-gcc
GATEKEEPER := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
include $(RTE_SDK)/mk/rte.vars.mk
APP = gatekeeper
SRCS-y := main/main.c
# Functional blocks.
SRCS-y += config/static.c config/dynamic.c
SRCS-y += cps/main.c cps/kni.c cps/elf.c
SRCS-y += ggu/main.c
SRCS-y += gk/main.c gk/fib.c gk/bpf.c
SRCS-y += gt/main.c gt/lua_lpm.c
SRCS-y += lls/main.c lls/cache.c lls/arp.c lls/nd.c
SRCS-y += sol/main.c
# Libraries.
SRCS-y += lib/mailbox.c lib/net.c lib/flow.c lib/ipip.c \
lib/luajit-ffi-cdata.c lib/launch.c lib/lpm.c lib/acl.c lib/varip.c \
lib/l2.c lib/ratelimit.c lib/memblock.c lib/log_ratelimit.c
LDLIBS += $(LDIR) -Bstatic -lluajit-5.1 -Bdynamic -lm -lmnl -lkmod
CFLAGS += $(WERROR_FLAGS) -I${GATEKEEPER}/include -I/usr/local/include/luajit-2.0/
EXTRA_CFLAGS += -O3 -g -Wfatal-errors -DALLOW_EXPERIMENTAL_API \
-Wno-deprecated-declarations
include $(RTE_SDK)/mk/rte.extapp.mk
# This file needs to include luajit's internal headers,
# which don't compile with stricter parameter of GCC.
lib/luajit-ffi-cdata.o: lib/luajit-ffi-cdata.c
$(CC) -o $@ -c $(CFLAGS) $(EXTRA_CFLAGS) -Wno-error=undef -Wno-undef \
-Wno-cast-qual $^
cscope:
cscope -b -R -s.
.PHONY: cscope