]> git.proxmox.com Git - qemu.git/blame - pc-bios/optionrom/Makefile
Use quiet-command for building optionrom
[qemu.git] / pc-bios / optionrom / Makefile
CommitLineData
253d0942
AG
1all: build-all
2
3include ../../config-host.mak
791e08c7 4include ../../rules.mak
253d0942
AG
5
6VPATH=$(SRC_PATH)/pc-bios/optionrom
253d0942
AG
7
8# from kernel sources - scripts/Kbuild.include
9# try-run
10# Usage: option = $(call try-run, $(CC)...-o "$$TMP",option-ok,otherwise)
11# Exit code chooses option. "$$TMP" is can be used as temporary file and
12# is automatically cleaned up.
13try-run = $(shell set -e; \
14 TMP="$(TMPOUT).$$$$.tmp"; \
15 if ($(1)) >/dev/null 2>&1; \
16 then echo "$(2)"; \
17 else echo "$(3)"; \
18 fi; \
19 rm -f "$$TMP")
20
21# cc-option-yn
22# Usage: flag := $(call cc-option-yn,-march=winchip-c6)
23cc-option-yn = $(call try-run,\
24 $(CC) $(KBUILD_CFLAGS) $(1) -S -xc /dev/null -o "$$TMP",y,n)
25
791e08c7
JQ
26CPPFLAGS = -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin
27CPPFLAGS += -I$(SRC_PATH)
253d0942 28ifeq ($(call cc-option-yn,-fno-stack-protector),y)
791e08c7 29CPPFLAGS += -fno-stack-protector
253d0942
AG
30endif
31
32build-all: multiboot.bin
33
253d0942 34%.img: %.o
791e08c7 35 $(call quiet-command,$(LD) -Ttext 0 -e _start -s -o $@ $<," Building $(TARGET_DIR)$@")
253d0942 36
7aa486fe 37%.raw: %.img
791e08c7 38 $(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@," Building $(TARGET_DIR)$@")
7aa486fe
AL
39
40%.bin: %.raw
791e08c7 41 $(call quiet-command,$(SRC_PATH)/pc-bios/optionrom/signrom.sh $< $@," Signing $(TARGET_DIR)$@")
253d0942 42
253d0942 43clean:
89e671e3 44 $(RM) *.o *.img *.bin *~