CC=gcc
CFLAGS=-pipe -O -I./kernel/include

all: emul

emul:	bounce.o calls.o readin.o fixfile.o segment.o ioctl.o signal.o
	$(CC) -o emul bounce.o calls.o readin.o fixfile.o segment.o ioctl.o signal.o >emul.map
	ld -M emul >emul.map 

hd: hd.o
	$(CC) -o hd hd.o

bounce.o: bounce.s
	as -o bounce.o bounce.s

dist: all
	-rm -r /tmp/dist
	mkdir /tmp/dist
	cp head.h bounce.s calls.c readin.c fixfile.c segment.c ioctl.c signal.c setboot.c /tmp/dist
	cp kernel.diff /tmp/dist
	cp README /tmp/dist
	cp Makefile /tmp/dist
	cp kernel/Image /tmp/dist
	cp emul /tmp/dist
	(cd /tmp/dist;tar -cf - * | compress >/tmp/dist.tar.Z)

