blob: bfcb6a8e9ac16b332211f592375dcfde116c880d [file] [log] [blame]
## Linux Loader for SPARC
include ../Rules.make
# Relocate to 2.5MB. The Hitchhiker's Guide to Open Boot Rev 3 claims
# that 3MB are guaranteed to be mapped.
# Changing this value will require changing a bunch of other constants throughout the code
LDFLAGS=-N -Ttext 0x4000
$(CC) $(CFLAGS) -c $*.S
all: first.b first.h ultra.b ultra.h generic.b generic.h fd.b ieee32.b
first.h: first
sed -n 's/^\(000000000000\|0000\)4\([0-9a-f][0-9a-f][0-9a-f]\) .*digit_here.*$$/#define DIGIT_OFFSET_TMP 0x\2/p' < > first.h
sed -n 's/^\(000000000000\|0000\)4\([0-9a-f][0-9a-f][0-9a-f]\) .*letter_here.*$$/#define LETTER_OFFSET_TMP 0x\2/p' < >> first.h
sed -n 's/^\(000000000000\|0000\)4\([0-9a-f][0-9a-f][0-9a-f]\) .*number_here.*$$/#define NUMBER_OFFSET_TMP 0x\2/p' < >> first.h
ultra.h: ultra
sed -n 's/^\(000000000000\|0000\)4\([0-9a-f][0-9a-f][0-9a-f]\) .*letter_here.*$$/#define ULTRA_LETTER_OFFSET_TMP 0x\2/p' < > ultra.h
sed -n 's/^\(000000000000\|0000\)4\([0-9a-f][0-9a-f][0-9a-f]\) .*number_here.*$$/#define ULTRA_NUMBER_OFFSET_TMP 0x\2/p' < >> ultra.h
generic.h: generic
sed -n 's/^\(000000000000\|0000\)4\([0-9a-f][0-9a-f][0-9a-f]\) .*digit_here.*$$/#define GENERIC_DIGIT_OFFSET_TMP 0x\2/p' < > generic.h
sed -n 's/^\(000000000000\|0000\)4\([0-9a-f][0-9a-f][0-9a-f]\) .*letter_here.*$$/#define GENERIC_LETTER_OFFSET_TMP 0x\2/p' < >> generic.h
sed -n 's/^\(000000000000\|0000\)4\([0-9a-f][0-9a-f][0-9a-f]\) .*number_here.*$$/#define GENERIC_NUMBER_OFFSET_TMP 0x\2/p' < >> generic.h
fd.h: fd
sed -n 's/^\(000000000000\|0000\)4\([0-9a-f][0-9a-f][0-9a-f]\) .*digit_here.*$$/#define FD_DIGIT_OFFSET_TMP 0x\2/p' < > fd.h
sed -n 's/^\(000000000000\|0000\)4\([0-9a-f][0-9a-f][0-9a-f]\) .*letter_here.*$$/#define FD_LETTER_OFFSET_TMP 0x\2/p' < >> fd.h
first.o: first.S
$(CC) $(CFLAGS) -c first.S -o first.o
first: first.o
$(LD) $(LDFLAGS) -o first first.o
$(NM) first | grep -v '*ABS*' | sort >
$(STRIP) first
first.b: first
$(ELFTOAOUT) -o first.b first
printf 'SILO'$(IMGVERSION) | $(DD) of=first.b bs=8 conv=notrunc seek=3 count=1
$(DD) if=/dev/zero of=first.b bs=4 count=1 seek=127
ultra.o: ultra.S
$(CC) $(CFLAGS) -c -Wa,-Av9a ultra.S
ultra: ultra.o
$(LD) $(LDFLAGS) -o ultra ultra.o
$(NM) ultra | grep -v '*ABS*' | sort >
$(STRIP) ultra
ultra.b: ultra
$(ELFTOAOUT) -o ultra.b ultra
printf 'SILO'$(IMGVERSION) | $(DD) of=ultra.b bs=8 conv=notrunc seek=3 count=1
printf '\340' | $(DD) of=ultra.b bs=1 count=1 seek=7 conv=notrunc
$(DD) if=/dev/zero of=ultra.b bs=4 count=1 seek=127
generic.o: generic.S
$(CC) $(CFLAGS) -c -Wa,-Av9a generic.S
generic: generic.o
$(LD) $(LDFLAGS) -o generic generic.o
$(NM) generic | grep -v '*ABS*' | sort >
$(STRIP) generic
generic.b: generic
$(ELFTOAOUT) -o generic.b generic
printf 'SILO'$(IMGVERSION) | $(DD) of=generic.b bs=8 conv=notrunc seek=3 count=1
printf '\340' | $(DD) of=generic.b bs=1 count=1 seek=7 conv=notrunc
$(DD) if=/dev/zero of=generic.b bs=4 count=1 seek=255
fd.o: fd.S
$(CC) $(CFLAGS) -c -Wa,-Av9a fd.S
fd: fd.o
$(LD) $(LDFLAGS) -o fd fd.o
$(NM) fd | grep -v '*ABS*' | sort >
$(STRIP) fd
fd.b: fd
$(ELFTOAOUT) -o fd.b fd
printf 'SILO'$(IMGVERSION) | $(DD) of=fd.b bs=8 conv=notrunc seek=3 count=1
printf '\340' | $(DD) of=fd.b bs=1 count=1 seek=7 conv=notrunc
$(DD) if=/dev/zero of=fd.b bs=4 count=1 seek=255
ieee32.o: ieee32.S ieee32.h
ieee32.b: ieee32.o
$(LD) $(LDFLAGS) -o ieee32.b ieee32.o
$(NM) ieee32.b | grep -v '*ABS*' | sort >
$(STRIP) ieee32.b
chmod 644 ieee32.b
$(RM) *.o *.map *.b first first.h ultra ultra.h \
generic generic.h fd fd.h