# 
#   Affix - Bluetooth Protocol Stack for Linux
#   Copyright (C) 2001 Nokia Corporation
#   Original Author: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
#
#   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.
#
#
#   $Id: Makefile,v 1.5 2003/08/13 13:06:35 jh Exp $
#
#   Makefile for compiling btuart pcmcia driver
#
#   Fixes:	Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
#               Imre Deak <ext-imre.deak@nokia.com>
#		

ifdef src
    clean-files := .*o.cmd *.ko *.o *.mod.*
else
    src = .
endif

include $(src)/../../config.mk

SRCS_M = btuart_cs.c
DMODULE = affix_uart_cs.o
KMODULE = affix_uart_cs.ko

ifdef NEW_KERNEL
    OBJS_M += $(SRCS_M:%.c=%.o)
    OBJS_MX += $(SRCS_MX:%.c=%.o)
    obj-m += $(DMODULE)
    affix_uart_cs-objs += $(OBJS_M) $(OBJS_MX)
    MODULE = $(KMODULE)
    MODFILE = $(KMODULE)
else
    MODFILE = $(DMODULE)
    MODULE = ../../bin/affix_uart_cs.o
endif

all: $(MODULE)

install: $(MODULE)
	install -m 0755 -d $(DESTDIR)$(MODDIR)/kernel/drivers/affix
	install -m 0644 $(MODULE) $(DESTDIR)$(MODDIR)/kernel/drivers/affix

uninstall:
	@rm -f $(DESTDIR)$(MODDIR)/kernel/drivers/affix/$(MODFILE)

clean:
	@rm -f core core.* *.o .*.o *.s *.a *.e tmp_make *~
	@rm -f *.ko .*o.cmd *mod.c
	@rm -rf .depfiles

ifdef OLD_KERNEL
    include $(src)/../../rules.mk
endif

