aboutsummaryrefslogtreecommitdiffstats
path: root/tools/vnet/vnetd/Makefile
blob: fe54c21bd16701b111511ca3f6b5761764b27759 (plain)
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# -*- mode: Makefile; -*-
#----------------------------------------------------------------------------
# Copyright (C) 2004 Mike Wray <mike.wray@hp.com>.
#
# This library is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of the
# License, or  (at your option) any later version. This library 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 Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
#----------------------------------------------------------------------------

VNET_ROOT = $(shell cd .. && pwd)
include $(VNET_ROOT)/Make.env

.PHONY: all
all: vnetd

#----------------------------------------------------------------------------

include $(XEN_ROOT)/tools/Rules.mk

VNETD_INSTALL_DIR = /usr/sbin

INCLUDES += -I$(LIBXUTIL_DIR)
INCLUDES += -I$(VNET_MODULE_DIR)
INCLUDES += -I$(shell pwd)

#----------------------------------------------------------------------------
# GC.

INCLUDES += -I$(GC_INCLUDE)
#LIBS += -L$(GC_LIB_DIR)
CPPFLAGS += -D USE_GC

# Sometimes linux/atomic.h is not #ifdef __KERNEL__.
CPPFLAGS += -D __ARCH_I386_ATOMIC__

#----------------------------------------------------------------------------
CFLAGS += $(INCLUDES) $(LIBS)

LDFLAGS += $(LIBS)

# Dependencies. Gcc generates them for us.
CFLAGS += -Wp,-MD,.$(@F).d
PROG_DEP = .*.d

vpath %.c $(LIBXUTIL_DIR)
vpath %.c $(VNET_MODULE_DIR)

IPATHS:=$(INCLUDES:-I=)
vpath %.h $(IPATHS)

#----------------------------------------------------------------------------
VNETD_SRC:=
VNETD_SRC+= connection.c
VNETD_SRC+= select.c
VNETD_SRC+= timer.c
VNETD_SRC+= spinlock.c
VNETD_SRC+= skbuff.c
VNETD_SRC+= vnetd.c

VNETD_SRC+= skb_util.c
VNETD_SRC+= sxpr_util.c
VNETD_SRC+= timer_util.c
VNETD_SRC+= etherip.c
VNETD_SRC+= vnet.c
VNETD_SRC+= vnet_eval.c
VNETD_SRC+= vnet_forward.c
VNETD_SRC+= vif.c
VNETD_SRC+= tunnel.c
VNETD_SRC+= sa.c
VNETD_SRC+= varp.c

#----------------------------------------------------------------------------
LIB_SRC:=
LIB_SRC+= allocate.c
LIB_SRC+= enum.c
LIB_SRC+= file_stream.c
LIB_SRC+= hash_table.c
LIB_SRC+= iostream.c
LIB_SRC+= lexis.c
LIB_SRC+= socket_stream.c
LIB_SRC+= string_stream.c
LIB_SRC+= sxpr.c
LIB_SRC+= sxpr_parser.c
LIB_SRC+= sys_net.c
LIB_SRC+= sys_string.c
LIB_SRC+= util.c

VNETD_SRC+=$(LIB_SRC)

VNETD_OBJ := $(VNETD_SRC:.c=.o)

#VNETD_LIBS:= $(GC_LIB_SO)
#VNETD_LIBS:= -lgc
VNETD_LIBS:= $(GC_LIB_A)

vnetd: $(VNETD_OBJ)
	$(CC) $(CFLAGS) -o $@ $^ $(VNETD_LIBS) -ldl -lpthread

.PHONY: install
install: vnetd
	mkdir -p $(DESTDIR)$(VNETD_INSTALL_DIR)
	install -m 0755 vnetd $(DESTDIR)$(VNETD_INSTALL_DIR)

.PHONY: clean
clean:
	-@$(RM) *.a *.o *~
	-@$(RM) vnetd
	-@$(RM) $(PROG_DEP)

-include $(PROG_DEP)