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