TOP	= ..
HDRS	= $(TOP)/crash.h $(TOP)/def.h
CSRCS	= table.c clean_sched.c clean_size.c clean_module.c clean_sem.c\
	  clean_fs.c clean_buffer.c buffer.c inode.c file.c\
	  operations.c clean_slab.c slab.c clean_mm.c page.c clean_mmzone.c\
	  block_device.c clean_route.c route.c clean_ext2.c\
	  ext2.c timer_vec.c clean_usb.c usb.c clean_neigh.c neighbour.c\
	  clean_blkdev.c blkdev.c clean_namespace.c namespace.c vfsmount.c\
	  clean_net.c socket.c dentry.c vm.c clean_vm.c

include	$(TOP)/Rules.make

OBJS	= $(CSRCS:.c=.o)
CFLAGS	= $(CDEBUG) -I$(TOP) -I$(INCDIR)
ifeq ($(ARCH),i386)
CFLAGS	+= -I$(KERNELDIR)/include/asm/mach-default
endif
TARGET	= libmcrash.a

GENHEAD	= slab.h flags_fs.h flags_mm.h flags_sched.h flags_vmalloc.h flags_gfp.h

all:	$(GENHEAD) $(TARGET)

$(TARGET): $(OBJS)
	$(AR) cr $(TARGET) $(OBJS)

$(OBJS): $(HDRS)

slab.h:
	$(TOP)/script/gethead $(KERNELDIR)/mm/slab.c > slab.h

flags_fs.h:
	$(TOP)/script/bitname sflags:MS_ fsflags:FS_ $(KERNELDIR)/include/linux/fs.h > $@

flags_mm.h:
	$(TOP)/script/bitname pgflags:PG_:1 $(KERNELDIR)/include/linux/page-flags.h > $@

flags_sched.h:
	$(TOP)/script/bitname tsflags:PF_ $(KERNELDIR)/include/linux/sched.h > $@

flags_vmalloc.h:
	$(TOP)/script/bitname vsflags:VM_ $(KERNELDIR)/include/linux/vmalloc.h > $@

flags_gfp.h:
	$(TOP)/script/bitname gfpbit:__GFP_ $(KERNELDIR)/include/linux/gfp.h > $@

clean:
	/bin/rm -f $(OBJS) $(TARGET) *~ *.swp $(GENHEAD)
