2 SRC_DIR
:= $(TOPSRC_DIR
)/pc-bios
/optionrom
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
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
,-T
,$(SRC_DIR
)/flat.lds
41 pvh.img
: pvh.o pvh_main.o
44 $(call quiet-command
,$(CC
) $(CPPFLAGS
) $(CFLAGS
) -c
-o
$@
$<,Assembling
)
47 $(call quiet-command
,$(CC
) $(CPPFLAGS
) $(CFLAGS
) -c
$< -o
$@
,Compiling
)
50 $(call quiet-command
,$(CC
) $(CFLAGS
) $(LDFLAGS
) -s
-o
$@
$^
,Linking
)
53 $(call quiet-command
,$(OBJCOPY
) -O binary
-j .text
$< $@
,Extracting raw object
)
56 $(call quiet-command
,$(PYTHON
) $(TOPSRC_DIR
)/scripts
/signrom.py
$< $@
,Computing checksum into
)
58 include $(wildcard *.d
)
61 rm -f
*.o
*.d
*.raw
*.img
*.bin
*~
66 # suppress auto-removal of intermediate files
69 .PHONY
: all clean distclean