# Makefile for KLIPS kernel code
# Copyright (C) 1998, 1999  Richard Guy Briggs.
# 
# 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.  See <http://www.fsf.org/copyleft/gpl.txt>.
# 
# 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.
#
# RCSID $Id: Makefile,v 1.16 1999/04/11 00:28:56 henry Exp $
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definition is now in the main makefile...

ifndef TOPDIR
TOPDIR  := /usr/src/linux
endif

O_TARGET := ipsec.o
O_OBJS := ipsec_init.o ipsec_xform.o ipsec_netlink.o ipsec_radij.o ipsec_tunnel.o ../../../lib/libkernel.a
# sysctl_net_ipsec.o 
OX_OBJS := radij.o
M_OBJS := $(O_TARGET)
CFLAGS += -I../../../lib

O_OBJS += ipsec_rcv.o

ifeq ($(CONFIG_IPSEC_ENC_DES),y)
INCLUDE_DES = y
endif

ifeq ($(CONFIG_IPSEC_ENC_3DES),y)
INCLUDE_DES = y
endif

ifeq ($(CONFIG_IPSEC_AUTH_HMAC_MD5),y)
O_OBJS += ipsec_md5c.o
INCLUDE_DES = y
endif

ifeq ($(CONFIG_IPSEC_AUTH_HMAC_SHA1),y)
O_OBJS += ipsec_sha1.o
INCLUDE_DES = y
endif

ifeq ($(INCLUDE_DES),y)
O_OBJS += libdeslite.o
endif


include $(TOPDIR)/Rules.make

$(O_OBJS) $(OX_OBJS):  $(TOPDIR)/include/linux/config.h $(TOPDIR)/include/linux/autoconf.h

clean:
	-rm -f *.o

tags:
	find . -name '*.[ch]' |xargs etags
	find . -name '*.[ch]' |xargs ctags -t -d

tar:
		tar -cvf /dev/f1 .

DESLIB=../../../lib/libdes.a
libdeslite.o:	$(DESLIB)
	cp $(DESLIB) $@

../../../lib/libkernel.a:
	( cd ../../../lib; $(MAKE) libkernel.a )

#
# $Log: Makefile,v $
# Revision 1.16  1999/04/11 00:28:56  henry
# GPL boilerplate
#
# Revision 1.15  1999/04/06 04:54:25  rgb
# Fix/Add RCSID Id: and Log: bits to make PHMDs happy.  This includes
# patch shell fixes.
#
# Revision 1.14  1999/02/18 16:50:45  henry
# update for new DES library
#
# Revision 1.13  1999/02/12 21:11:45  rgb
# Prepare for newer LIBDES (patch from P.Onion).
#
# Revision 1.12  1999/01/26 02:05:08  rgb
# Remove references to INET_GET_PROTOCOL.
# Removed CONFIG_IPSEC_ALGO_SWITCH macro.
# Change from transform switch to algorithm switch.
#
# Revision 1.11  1999/01/22 06:16:09  rgb
# Added algorithm switch code config option.
#
# Revision 1.10  1998/11/08 05:31:21  henry
# be a little fussier
#
# Revision 1.9  1998/11/08 05:29:41  henry
# revisions for new libdes handling
#
# Revision 1.8  1998/08/12 00:05:48  rgb
# Added new xforms to Makefile (moved des-cbc to des-old).
#
# Revision 1.7  1998/07/27 21:48:47  rgb
# Add libkernel.
#
# Revision 1.6  1998/07/14 15:50:47  rgb
# Add dependancies on linux config files.
#
# Revision 1.5  1998/07/09 17:44:06  rgb
# Added 'clean' and 'tags' targets.
# Added TOPDIR macro.
# Change module back from symbol exporting to not.
#
# Revision 1.3  1998/06/25 19:25:04  rgb
# Rearrange to support static linking and objects with exported symbol
# tables.
#
# Revision 1.1  1998/06/18 21:27:42  henry
# move sources from klips/src to klips/net/ipsec, to keep stupid
# kernel-build scripts happier in the presence of symlinks
#
# Revision 1.3  1998/04/15 23:18:43  rgb
# Unfixed the ../../libdes fix to avoid messing up Henry's script.
#
# Revision 1.2  1998/04/14 17:50:47  rgb
# Fixed to find the new location of libdes.
#
# Revision 1.1  1998/04/09 03:05:22  henry
# sources moved up from linux/net/ipsec
# modifications to centralize libdes code
#
# Revision 1.1.1.1  1998/04/08 05:35:02  henry
# RGB's ipsec-0.8pre2.tar.gz ipsec-0.8
#
# Revision 0.5  1997/06/03 04:24:48  ji
# Added ESP-3DES-MD5-96
#
# Revision 0.4  1997/01/15 01:32:59  ji
# Added new transforms.
#
# Revision 0.3  1996/11/20 14:22:53  ji
# *** empty log message ***
#
