-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
97 lines (86 loc) · 1.63 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Snoopy from harvey (from Plan 9)
# Rules: keep this simple. Make sure the gcc is in your path and nobody gets hurt.
###
# This allows snoopy to be built from within the Akaros distribution (maybe).
# The Makefrag exports a few things like CROSS_COMPILE and KFS_ROOT, which
# we'll use. We'll provide defaults if we couldn't find them.
-include ../../Makefrag
ifndef CROSS_COMPILE
CROSS_COMPILE := x86_64-ucb-akaros-
endif
ifndef KFS_ROOT
KFS_ROOT := $(AKAROS_ROOT)/kern/kfs
endif
ifndef Q
Q ?= @
endif
### Build flags for all targets
#
CFLAGS = -O2 -std=gnu99 -fno-stack-protector -fgnu89-inline -fPIC -static -fno-omit-frame-pointer -g -Iinclude -Wall -Werror
LDFLAGS =
LDLIBS = -lpthread -lbenchutil -lm -liplib -lndblib -lvmm -lbenchutil
DEST = $(KFS_ROOT)/bin/
### Build tools
#
CC=$(CROSS_COMPILE)gcc
AR=$(CROSS_COMPILE)ar
ALL=snoopy
FILES= \
aoeata.c \
aoe.c \
aoecmd.c \
aoemask.c \
aoemd.c \
aoerr.c \
arp.c \
bootp.c \
cec.c \
dhcp.c \
dump.c \
eap.c \
eap_identity.c \
eapol.c \
eapol_key.c \
ether.c \
gre.c \
hdlc.c \
icmp6.c \
icmp.c \
il.c \
ip6.c \
ip.c \
main.c \
protos.c \
rarp.c \
rc4keydesc.c \
rtcp.c \
rtp.c \
tcp.c \
ttls.c \
udp.c \
readn.c util.c \
y.tab.c
NO=\
ospf.c \
ppp.c \
ppp_ccp.c \
ppp_chap.c \
ppp_comp.c \
ppp_ipcp.c \
ppp_lcp.c \
pppoe_disc.c \
pppoe_sess.c \
dns.c \
ninep.c \
all: $(ALL)
y.tab.c: y.tab.h
y.tab.h: filter.y
yacc --defines filter.y
install: all
$(Q)echo "Installing $(ALL) in $(DEST)"
$(Q)cp $(ALL) $(DEST)
# compilers are fast. Just rebuild it each time.
snoopy: $(FILES)
$(CC) $(CFLAGS) $(LDFLAGS) -o snoopy $(FILES) $(LDLIBS)
clean:
rm -f $(ALL) *.o