########################################################################### 
# RT2400/RT2500 SourceForge Project - http://rt2x00.serialmonkey.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.             # 
#                                                                         # 
#   Licensed under the GNU GPL                                            # 
#   Original code supplied under license from RaLink Inc, 2004.           # 
########################################################################### 

########################################################################### 
#      Module Name: Makefile 
#              
#      Abstract: Makefile for rt2570 kernel module 
#              
#      Revision History: 
#      Who             When            What 
#      --------        -----------     ----------------------------- 
#      MarkW           8th  Dec 04     Rewrite of Makefile 
#      AmirS           1st  Jan 05     Update for gmake compat
#      MarkW           20th Jan 05     Fixed permissions on directory
#      MichalL         5th  Mar 05     Module installation fixes
#      RobinC	       2nd  Jun 05     Import makefile into rt2570 tree	
#      MathiasK        04th Jul 05     Module installation fixes
#      MarkW           29th Jul 05     Allow installation dir override
########################################################################### 



all: module
MODULE_NAME := rt2570

#PATCHLEVEL := 6 
#KERNDIR=/usr/src/linux-2.6
#MODDIR=/lib/modules/2.6.12/extra

ifeq ($(PATCHLEVEL),)
 PATCHLEVEL := $(shell uname -r | cut -d. -f2)
endif

RESMAN_CORE_OBJS := rtusb_main.o
RESMAN_GLUE_OBJS := mlme.o rtusb_bulk.o connect.o sync.o rtusb_init.o rtmp_tkip.o wpa.o rtmp_wep.o rtusb_info.o assoc.o auth.o auth_rsp.o md5.o rtusb_io.o sanity.o rtusb_data.o

$(MODULE_NAME)-objs := $(RESMAN_CORE_OBJS) $(RESMAN_GLUE_OBJS)

ifeq ($(CONFIG_USERMODE),)
ifeq ($(CONFIG_SMP),)
ifneq ($(CONFIG_NET_RADIO),)
obj-m += $(MODULE_NAME).o
endif
endif
endif

EXTRA_CFLAGS = -DRT2500_DBG
KERNEL_SOURCE ?= /lib/modules/$(shell uname -r)/build

modules modules_install clean:
	$(MAKE) -C $(KERNEL_SOURCE) SUBDIRS=$(shell pwd) $@

install: modules_install

