target/s390x/cpu topology: activate CPU topology
[qemu/armbru.git] / pc-bios / optionrom / Makefile
blob30d07026c790a6b6b50af028ea7e0ab99d9f56c8
1 include config.mak
2 SRC_DIR := $(TOPSRC_DIR)/pc-bios/optionrom
3 VPATH = $(SRC_DIR)
5 all: multiboot.bin multiboot_dma.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin
6 # Dummy command so that make thinks it has done something
7 @true
9 CFLAGS = -O2 -g
11 NULL :=
12 SPACE := $(NULL) #
13 TARGET_PREFIX := $(patsubst %/,%:$(SPACE),$(TARGET_DIR))
15 quiet-@ = $(if $(V),,@$(if $1,printf "%s\n" "$(TARGET_PREFIX)$1" && ))
16 quiet-command = $(call quiet-@,$2 $@)$1
18 # Flags for dependency generation
19 override CPPFLAGS += -MMD -MP -MT $@ -MF $(@D)/$(*F).d
21 override CFLAGS += -march=i486 -Wall $(EXTRA_CFLAGS) -m16
22 override CFLAGS += -ffreestanding -I$(TOPSRC_DIR)/include
24 cc-test = $(CC) -Werror $1 -c -o /dev/null -xc /dev/null >/dev/null 2>/dev/null
25 cc-option = if $(call cc-test, $1); then \
26 echo "$(TARGET_PREFIX)$1 detected" && echo "override CFLAGS += $1" >&3; else \
27 echo "$(TARGET_PREFIX)$1 not detected" $(if $2,&& echo "override CFLAGS += $2" >&3); fi
29 # If -fcf-protection is enabled in flags or compiler defaults that will
30 # conflict with -march=i486
31 config-cc.mak: Makefile
32 $(quiet-@)($(call cc-option,-fcf-protection=none); \
33 $(call cc-option,-fno-pie); \
34 $(call cc-option,-no-pie); \
35 $(call cc-option,-fno-stack-protector); \
36 $(call cc-option,-Wno-array-bounds)) 3> config-cc.mak
37 -include config-cc.mak
39 override LDFLAGS = -nostdlib -Wl,--build-id=none,-T,$(SRC_DIR)/flat.lds
41 pvh.img: pvh.o pvh_main.o
43 %.o: %.S
44 $(call quiet-command,$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<,Assembling)
46 %.o: %.c
47 $(call quiet-command,$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@,Compiling)
49 %.img: %.o
50 $(call quiet-command,$(CC) $(CFLAGS) $(LDFLAGS) -s -o $@ $^,Linking)
52 %.raw: %.img
53 $(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@,Extracting raw object)
55 %.bin: %.raw
56 $(call quiet-command,$(PYTHON) $(TOPSRC_DIR)/scripts/signrom.py $< $@,Computing checksum into)
58 include $(wildcard *.d)
60 clean:
61 rm -f *.o *.d *.raw *.img *.bin *~
63 distclean:
64 rm -f config-cc.mak
66 # suppress auto-removal of intermediate files
67 .SECONDARY:
69 .PHONY: all clean distclean