master
text 23 lines 576 Bytes
Raw
1 # To specify cross compiler prefix, use CROSS_PREFIX=
2 # $ make CROSS_PREFIX=x86_64-linux-gnu-
3
4 .PHONY: all clean
5 all: a-b-bootblock.h
6
7 a-b-bootblock.h: x86.bootsect x86.o
8 echo "$$__note" > header.tmp
9 xxd -i $< | sed -e '/.*int.*/d' >> header.tmp
10 nm x86.o | awk '{print "#define SYM_"$$3" 0x"$$1}' >> header.tmp
11 mv header.tmp $@
12
13 x86.bootsect: x86.boot
14 dd if=$< of=$@ bs=256 count=2 skip=124
15
16 x86.boot: x86.o
17 $(CROSS_PREFIX)objcopy -O binary $< $@
18
19 x86.o: a-b-bootblock.S
20 $(CROSS_PREFIX)gcc -I.. -m32 -march=i486 -c $< -o $@
21
22 clean:
23 @rm -rf *.boot *.o *.bootsect *.h