# Comment/uncomment the following line to enable/disable debugging

WFLAGS := -Wall -Wstrict-prototypes -Wno-trigraphs

#include ./config.mk
obj-m := rt2500.o

rt2500-objs := rtmp_main.o 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 rtmp_tkip.o wpa.o md5.o

clean:
	rm -f *.o *~ .*.cmd *.ko *.mod.c
install:
	@touch config.mk
	#mkdir -p $(TARGET_MODDIR)
	echo $(TARGET_MODDIR)
	install $(DRIVERPATH) $(TARGET_MODDIR)
	
	@if [ ! -f /etc/sysconfig/network-scripts/ifcfg-ra0 ]; then \
		echo "Create 'ifcfg-ra0' in /etc/sysconfig/network-scripts/"; \
		cp ifcfg-ra0 /etc/sysconfig/network-scripts/ ; \
	fi
	@if [  -d /etc/sysconfig/network ]; then \
		echo "Create 'ifcfg-ra0' in /etc/sysconfig/network/"; \
		cp ./suse/ifcfg-ra0 /etc/sysconfig/network/ ; \
	fi

	@if ! grep 'ra0' $(PROBEPATH) ; then \
		echo "alias ra0 rt2500" >> $(PROBEPATH) ; \
	fi
		
config:
	@touch config.mk
	@./Configure
	
#make command :   make -C path/to/src SUBDIRS=$PWD modules
#example :        make -C /usr/src/linux-2.6.3-4mdk SUBDIRS=$PWD modules
