2021-09-15 13:56:34 +03:00
|
|
|
include config.mak
|
|
|
|
SRC_DIR := $(TOPSRC_DIR)/pc-bios/optionrom
|
2019-10-08 18:27:24 +03:00
|
|
|
VPATH = $(SRC_DIR)
|
|
|
|
|
2021-10-20 15:55:04 +03:00
|
|
|
all: multiboot.bin multiboot_dma.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin
|
2009-07-31 16:18:32 +04:00
|
|
|
# Dummy command so that make thinks it has done something
|
|
|
|
@true
|
2009-06-29 17:37:40 +04:00
|
|
|
|
2020-08-31 15:36:27 +03:00
|
|
|
CFLAGS = -O2 -g
|
2009-12-21 12:06:55 +03:00
|
|
|
|
2019-10-08 18:27:24 +03:00
|
|
|
quiet-command = $(if $(V),$1,$(if $(2),@printf " %-7s %s\n" $2 $3 && $1, @$1))
|
2020-08-31 15:36:27 +03:00
|
|
|
cc-option = $(if $(shell $(CC) $1 -c -o /dev/null -xc /dev/null >/dev/null 2>&1 && echo OK), $1, $2)
|
2009-06-29 17:37:40 +04:00
|
|
|
|
2022-06-15 12:42:01 +03:00
|
|
|
override CFLAGS += -march=i486 -Wall $(EXTRA_CFLAGS) -m16
|
2016-08-09 23:50:40 +03:00
|
|
|
|
2022-03-23 12:07:13 +03:00
|
|
|
# If -fcf-protection is enabled in flags or compiler defaults that will
|
|
|
|
# conflict with -march=i486
|
|
|
|
override CFLAGS += $(call cc-option, -fcf-protection=none)
|
|
|
|
|
2019-10-08 18:27:24 +03:00
|
|
|
# Flags for dependency generation
|
|
|
|
override CPPFLAGS += -MMD -MP -MT $@ -MF $(@D)/$(*F).d
|
|
|
|
|
2022-03-29 14:01:58 +03:00
|
|
|
override CFLAGS += $(call cc-option, -fno-pie)
|
2022-06-06 12:35:41 +03:00
|
|
|
override CFLAGS += $(call cc-option, -no-pie)
|
2022-03-29 14:01:58 +03:00
|
|
|
override CFLAGS += -ffreestanding -I$(TOPSRC_DIR)/include
|
2019-10-08 18:27:24 +03:00
|
|
|
override CFLAGS += $(call cc-option, -fno-stack-protector)
|
2022-04-13 15:22:12 +03:00
|
|
|
override CFLAGS += $(call cc-option, -Wno-array-bounds)
|
2019-10-08 18:27:24 +03:00
|
|
|
|
2022-06-06 12:35:41 +03:00
|
|
|
override LDFLAGS = -nostdlib -Wl,-T,$(SRC_DIR)/flat.lds
|
2012-01-30 14:27:33 +04:00
|
|
|
|
2019-10-08 18:27:24 +03:00
|
|
|
pvh.img: pvh.o pvh_main.o
|
2016-05-23 21:11:33 +03:00
|
|
|
|
2016-07-08 07:49:36 +03:00
|
|
|
%.o: %.S
|
2022-06-06 12:35:41 +03:00
|
|
|
$(call quiet-command,$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<,"AS","$@")
|
2016-05-23 21:11:33 +03:00
|
|
|
|
2019-10-08 18:27:24 +03:00
|
|
|
%.o: %.c
|
|
|
|
$(call quiet-command,$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@,"CC","$@")
|
2019-01-18 15:01:41 +03:00
|
|
|
|
2009-06-29 17:37:40 +04:00
|
|
|
%.img: %.o
|
2022-06-06 12:35:41 +03:00
|
|
|
$(call quiet-command,$(CC) $(CFLAGS) $(LDFLAGS) -s -o $@ $^,"BUILD","$@")
|
2009-06-29 17:37:40 +04:00
|
|
|
|
2009-07-11 17:48:29 +04:00
|
|
|
%.raw: %.img
|
2019-10-08 18:27:24 +03:00
|
|
|
$(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@,"BUILD","$@")
|
2009-07-11 17:48:29 +04:00
|
|
|
|
|
|
|
%.bin: %.raw
|
2019-10-08 18:27:24 +03:00
|
|
|
$(call quiet-command,$(PYTHON) $(TOPSRC_DIR)/scripts/signrom.py $< $@,"SIGN","$@")
|
|
|
|
|
|
|
|
include $(wildcard *.d)
|
2009-06-29 17:37:40 +04:00
|
|
|
|
|
|
|
clean:
|
2009-10-06 23:11:11 +04:00
|
|
|
rm -f *.o *.d *.raw *.img *.bin *~
|
2019-10-08 18:27:24 +03:00
|
|
|
|
|
|
|
# suppress auto-removal of intermediate files
|
|
|
|
.SECONDARY:
|
|
|
|
|
|
|
|
.PHONY: all clean
|