#################################################################
# some configuration lines...

# the location of the linux kernel sources
LINUXSRC = /usr/src/linux

# the location of the bootprom code you want to use
# DOS_COM  = ../../src-32/wd.com
DOS_COM  = ../../src-32/all.com

# your floppy drive
FLOPPY   = /dev/fd0

##################################################################

BUILD    = $(LINUXSRC)/arch/i386/boot/tools/build
BOOT     = $(LINUXSRC)/arch/i386/boot/bootsect

netImage: $(BUILD) $(BOOT) netsetup netkernel
	$(BUILD) $(BOOT) netsetup netkernel > netImage

netsetup: netsetup.s
	as86 -0 -a -o netsetup.o netsetup.s
	ld86 -0 -s -o netsetup netsetup.o

netkernel: $(DOS_COM)
	dd if=/dev/zero  of=netkernel bs=256 count=1
	dd if=$(DOS_COM) of=netkernel bs=256 seek=1

floppy: netImage
	dd if=netImage of=$(FLOPPY)

##################################################################

clean:
	rm -f *~ netsetup.o netsetup netkernel

realclean: clean
	rm -f netImage

##################################################################
# some stuff to get (hopefully) bootsect and build compiled
#
# Yes, it's a little bit tricky, don't touch it unless you
# know what you are doing

$(BUILD):
	$(MAKE) -C $(LINUXSRC) -f `pwd`/Makefile.kernel \
		arch/i386/boot/tools/build

$(BOOT):
	$(MAKE) -C $(LINUXSRC) -f `pwd`/Makefile.kernel \
		arch/i386/boot/bootsect
