#
#  GRUB stage1 makefile
#

CFLAGS += $(SHARED_FLAGS)

all: ../bin/stage1

stage1.o:	stage1.S Makefile ../Makefile
	$(CC) $(CFLAGS) -c -o stage1.o stage1.S

../bin/stage1:	stage1.o
	$(LD) -N -Ttext 7C00 -o stage1.exec stage1.o
	dd if=stage1.exec of=stage1.noheader bs=$(HEADER_7C00) skip=1
	dd if=stage1.noheader of=../bin/stage1 bs=512 count=1
	rm stage1.exec stage1.noheader

clean:
	rm -f stage1.o

