TOP	= ..
HDRS	= $(TOP)/crash.h $(TOP)/def.h
CSRCS	= inode.c clean_fs.c clean_sched.c clean_module.c bh.c operations.c\
	  file.c timer_vec.c clean_mm.c page.c block_device.c\
	  clean_sem.c clean_size.c clean_blkdev.c task_queue.c blkdev.c\
	  lvm.c clean_lvm.c table.c buffer.c ext2.c slab.c clean_slab.c\
	  clean_mmzone.c clean_usb.c usb.c clean_route.c route.c\
	  clean_neigh.c neighbour.c char_device.c vfsmount.c clean_tqueue.c\
	  clean_net.c socket.c

include	$(TOP)/Rules.make

OBJS	= $(CSRCS:.c=.o)
CFLAGS	= $(CDEBUG) -I$(TOP) -I$(INCDIR)
TARGET	= libmcrash.a

GENHEAD	= slab.h flags_fs.h flags_mm.h flags_sched.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_ bh_state_bits_bitname:BH_:1 $(KERNELDIR)/include/linux/fs.h > $@

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

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

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