#
# Makefile for the linux CBM-filesystem routines.
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
CFLAGS=-D__KERNEL__ -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \
	-DMODULE -I.

.c.s:
	$(CC) $(CFLAGS) -S $<
.c.o:
	$(CC) $(CFLAGS) -c $<
.s.o:
	$(AS) -o $*.o $<

OBJS=	inode.o misc.o dir.o buffer.o map.o file.o namei.o ioctl.o

cbmfs.o: $(OBJS)
	$(LD) -r -o cbmfs.o $(OBJS)

modules: cbmfs.o
	ln -sf ../fs/cbm/cbmfs.o $(TOPDIR)/modules

dep:
	$(CPP) -I. -M -DMODULE *.c > .depend

clean:
	rm *.o

archive:
	(cd .. ; tar -cvzf cbmfs-0.3/cbmfs-0.3.tar.gz -T cbmfs-0.3/files.lst)

#
# include a dependency file if one exists
#
ifeq (.depend,$(wildcard .depend))
include .depend
endif
