########################################################################### 
# RT2400 SourceForge Project - http://rt2400.sourceforge.net              # 
#                                                                         # 
#   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, 2003.           # 
########################################################################### 

########################################################################### 
#      Module Name: Makefile 
#              
#      Abstract: Makefile for rt2400 kernel module 
#              
#      Revision History: 
#      Who             When            What 
#      --------        -----------     ----------------------------- 
#      MarkW           9th  Feb 04     Baseline of code
#      JerzyK          21st Feb 04     Rewrite for 2.4 and 2.6
#      mags            23rd Feb 04     Fix for PATCHLEVEL
#      fstanchina      30th May 04     Removed extra defines
#      Ivo             27th Jun 04     Changed module install destination
#      AmirS           1st  Jan 05     Update for gmake compat
#      MarkW           20th Jan 05     Fixed permissions on module dir
#      MarkW           29th Jun 05     Allow installation dir override
########################################################################### 



all: module
MODULE_NAME := rt2400

#PATCHLEVEL := 6 
#KERNDIR := /usr/src/linux-2.4.31
#MODDIR := /var/lib/modules/2.4.31/extra

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

RESMAN_CORE_OBJS := rtmp_main.o
RESMAN_GLUE_OBJS := mlme.o connect.o sync.o assoc.o auth.o auth_rsp.o rtmp_data.o rtmp_init.o sanity.o rtmp_wep.o rtmp_info.o eeprom.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 = -DRT2400_DBG

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

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

install: modules_install
