# $USAGI: Makefile,v 1.8 2004/04/24 08:54:13 nakam Exp $

# Copyright (C)2003 USAGI/WIDE Project
# 
# 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 2 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, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
CC = gcc
CCOPTS = -g -Wall

CWD := $(shell pwd)

# kernel header
ifeq ($(KERNEL_INC),)
	KERNEL_INC=$(CWD)/../include
#	KERNEL_INC = /lib/modules/`/bin/uname -r`/build/include
#	KERNEL_INC=$$HOME/usagi/kernel/linux26/include
endif


INC = -I$(KERNEL_INC) -I$(CWD)/include

ifeq ($(USE_LIBXF),)
DEF = -DDEBUG \
	-DCONFIG_XFRM_ENHANCEMENT -DCONFIG_IPV6_MIP6 -DCONFIG_IPV6_MIP6_DEBUG

SUBDIRS = lib ipmip6 miping6 mip6d
else
#DEF = -DUSE_XFRM_ENHANCEMENT
DEF =

SUBDIRS = lib ipxfrm
endif

CMD = all clean distclean

$(CMD):
	@set -e; \
	for i in $(SUBDIRS); \
	do $(MAKE) -C $$i $@; done

.EXPORT_ALL_VARIABLES:
