076d247142
The vpath directive has two advantages over the VPATH variable: 1) it allows to skip searching of .o files; 2) the default semantics are to append to the vpath, so there is no confusion between "VPATH=xyz" and "VPATH+=xyz". Since "vpath %.c %.h PATH" is not valid, I'm introducing a wrapper macro to append one or more directories to the vpath. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
30 lines
817 B
Makefile
30 lines
817 B
Makefile
all: build-all
|
|
# Dummy command so that make thinks it has done something
|
|
@true
|
|
|
|
include ../../config-host.mak
|
|
include $(SRC_PATH)/rules.mak
|
|
|
|
$(call set-vpath, $(SRC_PATH)/pc-bios/optionrom)
|
|
|
|
.PHONY : all clean build-all
|
|
|
|
CFLAGS := -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin
|
|
CFLAGS += -I$(SRC_PATH)
|
|
CFLAGS += $(call cc-option, $(CFLAGS), -fno-stack-protector)
|
|
QEMU_CFLAGS = $(CFLAGS)
|
|
|
|
build-all: multiboot.bin linuxboot.bin
|
|
|
|
%.img: %.o
|
|
$(call quiet-command,$(LD) -Ttext 0 -e _start -s -o $@ $<," Building $(TARGET_DIR)$@")
|
|
|
|
%.raw: %.img
|
|
$(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@," Building $(TARGET_DIR)$@")
|
|
|
|
%.bin: %.raw
|
|
$(call quiet-command,$(SHELL) $(SRC_PATH)/pc-bios/optionrom/signrom.sh $< $@," Signing $(TARGET_DIR)$@")
|
|
|
|
clean:
|
|
rm -f *.o *.d *.raw *.img *.bin *~
|