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