-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
69 lines (51 loc) · 1.7 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
#!/usr/bin/make -f
# This file is part of iouyap, a program to bridge IOU with
# network interfaces.
#
# Copyright (C) 2013, 2014 James E. Carpenter
#
# iouyap 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.
#
# iouyap 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/>.
NAME = iouyap
BINDIR = /usr/local/bin
CC ?= gcc #-O3
CFLAGS += -Wall
LDLIBS = -lpthread
YACC = bison -y
YFLAGS = -d
LEX = flex
SANITIZERS ?=
SANITIZER_FLAGS = $(foreach sanitizer,$(SANITIZERS),-fsanitize=$(sanitizer))
SRCDIR = .
ifeq ($(SYSTEM_INIPARSER),1)
LDLIBS += -liniparser
CFLAGS += -DUSE_SYSTEM_INIPARSER
else
SRCDIR += ,iniparser
endif
ifeq ($(DEBUG),1)
CFLAGS += -fno-omit-frame-pointer -g -O0 $(SANITIZER_FLAGS)
LDFLAGS += $(SANITIZER_FLAGS)
endif
OBJECTS = netmap_parse.o netmap_scan.o netmap.o config.o iouyap.o iniparser/iniparser.o iniparser/dictionary.o
$(OBJECTS) = iouyap.h netmap.h config.h iniparser/iniparser.h iniparser/dictionary.h
all: $(NAME)
$(NAME): $(OBJECTS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $(NAME) $(OBJECTS) $(LDLIBS)
.PHONY : clean
clean :
rm -f iouyap y.tab.* *.o */*.o
install : $(NAME)
chmod +x iouyap
cp iouyap $(BINDIR)
setcap cap_net_admin,cap_net_raw=ep $(BINDIR)/$(NAME)