KERNEL_SOURCE=/usr/src/linux

all: 

ipxkern.tar:
	tk

release: 
	mkdir ../release/kernel
	ln af_ipx.c ipx.h.diff proc_fs.h.diff makefile ../release/kernel
	echo DO NOT DELETE >../release/kernel/no_patch

no_patch:
	echo You have kernel already patched!
	exit 1

patch:  no_patch
	patch -u $(KERNEL_SOURCE)/include/linux/ipx.h ipx.h.diff
	patch -u $(KERNEL_SOURCE)/include/linux/proc_fs.h proc_fs.h.diff
	mv $(KERNEL_SOURCE)/net/ipx/af_ipx.c $(KERNEL_SOURCE)/net/ipx/af_ipx.c.orig
	cp af_ipx.c $(KERNEL_SOURCE)/net/ipx
	echo DO NOT DELETE > patch_done
	rm -f no_patch

patch_done:
	echo You have not kernel patched!
	exit 1

unpatch: patch_done
	patch -R -u $(KERNEL_SOURCE)/include/linux/ipx.h ipx.h.diff
	patch -R -u $(KERNEL_SOURCE)/include/linux/proc_fs.h proc_fs.h.diff
	mv $(KERNEL_SOURCE)/net/ipx/af_ipx.c.orig $(KERNEL_SOURCE)/net/ipx/af_ipx.c
	echo DO NOT DELETE > no_patch
	rm -f patch_done
	