#	File	: Makefile

PROJECT=	mcf25
KERNELDIR=	/usr/src/linux
BACKUP=		/root/backup
YMD=		`date +%Y%m%d%H%M`

include	$(KERNELDIR)/.config

CFLAGS += -DMFG_TOOLS
CFLAGS +=  -D__KERNEL__ -DMODULE

ifdef CONFIG_SMP
 CFLAGS += -D__SMP__ -DSMP
endif

CFLAGS		+= -I$(KERNELDIR)/include -I$(shell pwd)/../../io/mcf \
			-I$(shell pwd)/../../wlan \
			-I$(shell pwd)/../../os/linux -I. \
			-O2 -Wall -Wstrict-prototypes

ALL=		if_cf83xx.o

CFOBJS=		if_cf.o

all:		$(ALL)
		@echo "Finished making mcf25 driver..."

build:		$(ALL)
		@if [ ! -d ../../build ]; then \
			mkdir ../../build; \
		fi

if_cf83xx.o:	$(CFOBJS)	
		$(LD) -r $^ -o $@

newlogs:
		killall -9 syslogd klogd
		rm -f /var/log/messages /var/log/debug /var/log/syslog
		sleep 1
		/etc/rc.d/rc.syslog start

tags:		removetags
		ctags -R *.[ch] ../mspio/*.[ch] $(KERNELDIR)/include

removetags:
		rm -f tags

backup:		clean
		tar cfz $(BACKUP)/$(PROJECT)-0.0-$(YMD).tgz *.[ch] Makefile 

clean:
		rm -f *.o *~ core

