-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMakefile
60 lines (43 loc) · 1.18 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
# Makefile
# LOGGING_FDB_CAHNGE is work on wide camp 1203 only
CC = gcc -Wall -g
MODULES = error.o fdb.o iftap.o net.o vxlan.o control.o
PROGNAME = vxland vxlanctl
INITSCRIPT = vxlan
INSTALLDST = /usr/local/sbin/
CONFIGDST = /usr/local/etc/
CONFIGFILE = vxlan.conf
RCDST = /etc/init.d/
UPDATERCD = /usr/sbin/update-rc.d
.PHONY : all
all : vxland vxlanctl
.c.o:
$(CC) -c $< -o $@
modules : $(MODULES)
vxland : main.c common.h $(MODULES)
$(CC) -pthread main.c $(MODULES) -o vxland
vxlanctl : vxlanctl.c common.h
$(CC) vxlanctl.c -o vxlanctl
clean :
rm $(MODULES) $(PROGNAME)
install : $(PROGNAME)
install vxland $(INSTALLDST)
install vxlanctl $(INSTALLDST)
if [ ! -f $(CONFIGDST)/$(CONFIGFILE) ]; then \
install $(CONFIGFILE) $(CONFIGDST); \
fi
install $(INITSCRIPT) $(RCDST)
$(UPDATERCD) $(INITSCRIPT) defaults
uninstall : $(PROGNAME)
rm $(INSTALLDST)/vxland
rm $(INSTALLDST)/vxlanctl
$(UPDATERCD) -f $(INITSCRIPT) remove
rm $(RCDST)/$(INITSCRIPT)
control.c : control.h
error.c : error.h
fdb.c : fdb.h
iftap.c : iftap.h
net.h : common.h
net.c : net.h fdb.h error.h sockaddrmacro.h
vxlan.h : common.h
vxlan.c : net.h fdb.h error.h vxlan.h iftap.h sockaddrmacro.h