xref: /openbmc/qemu/pc-bios/s390-ccw/Makefile (revision 3e4415a7)
1b462fcd5SAlexander Grafall: build-all
2b462fcd5SAlexander Graf# Dummy command so that make thinks it has done something
3b462fcd5SAlexander Graf	@true
4b462fcd5SAlexander Graf
5b462fcd5SAlexander Grafinclude ../../config-host.mak
6b462fcd5SAlexander Grafinclude $(SRC_PATH)/rules.mak
7b462fcd5SAlexander Graf
8b462fcd5SAlexander Graf$(call set-vpath, $(SRC_PATH)/pc-bios/s390-ccw)
9b462fcd5SAlexander Graf
10b462fcd5SAlexander Graf.PHONY : all clean build-all
11b462fcd5SAlexander Graf
12867e039aSThomas HuthOBJECTS = start.o main.o bootmap.o sclp.o virtio.o virtio-scsi.o virtio-blkdev.o
13c86c03cfSChristian BorntraegerQEMU_CFLAGS := $(filter -W%, $(QEMU_CFLAGS))
14c86c03cfSChristian BorntraegerQEMU_CFLAGS += -ffreestanding -fno-delete-null-pointer-checks -msoft-float
15c86c03cfSChristian BorntraegerQEMU_CFLAGS += -march=z900 -fPIE -fno-strict-aliasing
16c86c03cfSChristian BorntraegerQEMU_CFLAGS += $(call cc-option, $(QEMU_CFLAGS), -fno-stack-protector)
17d884c86dSThomas HuthLDFLAGS += -Wl,-pie -nostdlib
18b462fcd5SAlexander Graf
19*3e4415a7SThomas Huthbuild-all: s390-ccw.img s390-netboot.img
20b462fcd5SAlexander Graf
21b462fcd5SAlexander Grafs390-ccw.elf: $(OBJECTS)
220bdb12c7SPeter Maydell	$(call quiet-command,$(CC) $(LDFLAGS) -o $@ $(OBJECTS),"BUILD","$(TARGET_DIR)$@")
23b462fcd5SAlexander Graf
24c68f4503SGreg KurzSTRIP ?= strip
25c68f4503SGreg Kurz
26b462fcd5SAlexander Grafs390-ccw.img: s390-ccw.elf
27c68f4503SGreg Kurz	$(call quiet-command,$(STRIP) --strip-unneeded $< -o $@,"STRIP","$(TARGET_DIR)$@")
28d884c86dSThomas Huth
29d884c86dSThomas Huth$(OBJECTS): Makefile
30b462fcd5SAlexander Graf
31*3e4415a7SThomas Huthifneq ($(wildcard $(SRC_PATH)/roms/SLOF/lib/libnet),)
32*3e4415a7SThomas Huthinclude $(SRC_PATH)/pc-bios/s390-ccw/netboot.mak
33*3e4415a7SThomas Huthelse
34*3e4415a7SThomas Huths390-netboot.img:
35*3e4415a7SThomas Huth	@echo "s390-netboot.img not built since roms/SLOF/ is not available."
36*3e4415a7SThomas Huthendif
37*3e4415a7SThomas Huth
38b462fcd5SAlexander Grafclean:
39*3e4415a7SThomas Huth	$(RM) *.o *.d *.img *.elf *~ *.a
40