Fix multiboot.bin build on mingw32
[qemu] / pc-bios / optionrom / Makefile
index 7f987d8..69e6c22 100644 (file)
@@ -3,7 +3,6 @@ all: build-all
 include ../../config-host.mak
 
 VPATH=$(SRC_PATH)/pc-bios/optionrom
-OBJCOPY=objcopy
 
 # from kernel sources - scripts/Kbuild.include
 # try-run
@@ -35,9 +34,12 @@ build-all: multiboot.bin
        $(CC) $(CFLAGS) -o $@ -c $<
 
 %.img: %.o
-       $(LD) --oformat binary -Ttext 0 -o $@ $<
+       $(LD) -Ttext 0 -e _start -s -o $@ $<
 
-%.bin: %.img
+%.raw: %.img
+       $(OBJCOPY) -O binary -j .text $< $@
+
+%.bin: %.raw
        $(SRC_PATH)/pc-bios/optionrom/signrom.sh $< $@
        cp $@ $(SRC_PATH)/pc-bios/