udump: udump.c
	cc -o udump udump.c

# Generate prototype
p:
	proto -co -fumsdos_test.p -c+ -fumsdos_test.pm *.c \
		-bumsdos_test.h+umsdos_test.pm=umsdos_test.h


LIB		= umsdos_test.o util.o register.o

# General test cases
TESTGEN	= dev.o dir.o file.o hlink.o perm.o pipe.o time.o syml.o\
		  multi.o name.o #mount.o
utstgen:  $(TESTGEN) $(LIB)
	gcc -g -o utstgen $(TESTGEN) $(LIB)

# UMSDOS specific test cases
TESTSPC	= 
utstspc:  $(TESTSPC) $(LIB)
	gcc -g -o utstspc $(TESTSPC) $(LIB)

.c.o:
	g++ -DPUBLIC= -DPRIVATE= -DPROTECTED= -O2 -g -c $< -o $@


# target to help testing

# format the floppy B and mount
# Because mformat can't format /dev/fd1 (nom removable media ???), I have
# defined f: as /dev/fd1H1440
mount0:
	mformat f:
	sync
	mount -t umsdos /dev/fd1 /mnt

mount:
	mount -t umsdos /dev/fd1 /mnt

# umount and mount again. Useful if you want to find out if inode
# are properly released
mum:
	umount /mnt
	mdir b:
	mount -t umsdos /dev/fd1 /mnt

# Apply the general test to a subdir of tmp
# I use the ext2 filesystem as a reference. Mostly to test utstgen
# in the first place.
TST_EXT=/tmp/umsdos.tst
tst.ext:
	mkdir $(TST_EXT)
	utstgen -p$(TST_EXT) all
	rmdir $(TST_EXT)
	

clean:
	rm -f *.o utstgen utstspc

