xref: /openbmc/qemu/tests/migration/s390x/Makefile (revision 6016b7b4)
1# To specify cross compiler prefix, use CROSS_PREFIX=
2#   $ make CROSS_PREFIX=s390x-linux-gnu-
3
4.PHONY: all clean
5all: a-b-bios.h
6fwdir=../../../pc-bios/s390-ccw
7
8CFLAGS+=-ffreestanding -fno-delete-null-pointer-checks -fPIE -Os \
9	-msoft-float -march=z900 -fno-asynchronous-unwind-tables -Wl,-pie \
10	-Wl,--build-id=none -nostdlib
11
12a-b-bios.h: s390x.elf
13	echo "$$__note" > header.tmp
14	xxd -i $< | sed -e 's/.*int.*//' >> header.tmp
15	mv header.tmp $@
16
17# We use common-page-size=16 to avoid big padding in the ELF file
18s390x.elf: a-b-bios.c
19	$(CROSS_PREFIX)gcc $(CFLAGS) -I$(fwdir) $(fwdir)/start.S \
20		$(fwdir)/sclp.c -Wl,-zcommon-page-size=16 -o $@ $<
21	$(CROSS_PREFIX)strip $@
22
23clean:
24	@rm -rf *.elf *.o
25