Index: arch/sparc64/boot/Makefile
===================================================================
--- arch/sparc64/boot/Makefile	(revision 2a99fa8542b11dc1ddaa614e54b07e6b3a03a094)
+++ arch/sparc64/boot/Makefile	(revision 34d9ab28be200edae8133cce97eb8ad2ff9d30a3)
@@ -1,9 +1,30 @@
-.PHONY: nothing build clean
+BINUTILS_DIR=/usr/local/sparc64/bin
+TARGET=sparc64-linux-gnu
+
+.PHONY: nothing build
 
 nothing:
 
-build:
-	touch boot.bin
+build: boot.bin
+	cp boot.bin ../../../load.bin
+
+CC=$(BINUTILS_DIR)/$(TARGET)-gcc
+AS=$(BINUTILS_DIR)/$(TARGET)-as
+LD=$(BINUTILS_DIR)/$(TARGET)-ld
+
+CPPFLAGS=$(DEFS) -nostdinc -I../include
+CFLAGS=$(CPPFLAGS) -nostdlib -fno-builtin -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O2
+LFLAGS=-no-check-sections -N -T _link.ld -s
+
+boot.bin: boot.aout
+	dd if=/dev/zero of=$@ bs=512 count=16
+	dd if=boot.aout of=$@ bs=512 seek=1 conv=notrunc
+
+boot.aout: boot.o
+	$(LD) $(LFLAGS) boot.o -o $@
+
+boot.o: boot.S
+	$(CC) $(CFLAGS) -c boot.S -o $@
 
 clean:
-	-rm *.bin
+	-rm *.o *.bin *.aout
