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