xref: /qemu/pc-bios/optionrom/Makefile (revision 85aad98a)
1all: build-all
2# Dummy command so that make thinks it has done something
3	@true
4
5include ../../config-host.mak
6include $(SRC_PATH)/rules.mak
7
8$(call set-vpath, $(SRC_PATH)/pc-bios/optionrom)
9
10.PHONY : all clean build-all
11
12CFLAGS := -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin
13CFLAGS += -I$(SRC_PATH)
14CFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector)
15CFLAGS += $(CFLAGS_NOPIE)
16QEMU_CFLAGS = $(CFLAGS)
17
18build-all: multiboot.bin linuxboot.bin kvmvapic.bin
19
20# suppress auto-removal of intermediate files
21.SECONDARY:
22
23%.o: %.S
24	$(call quiet-command,$(CPP) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) $(CFLAGS) -c -o - $< | $(AS) $(ASFLAGS) -o $@,"  AS    $(TARGET_DIR)$@")
25
26%.img: %.o
27	$(call quiet-command,$(LD) $(LDFLAGS_NOPIE) -Ttext 0 -e _start -s -o $@ $<,"  Building $(TARGET_DIR)$@")
28
29%.raw: %.img
30	$(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@,"  Building $(TARGET_DIR)$@")
31
32%.bin: %.raw
33	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/signrom.py $< $@,"  Signing $(TARGET_DIR)$@")
34
35clean:
36	rm -f *.o *.d *.raw *.img *.bin *~
37