3 include ..
/..
/config-host.mak
5 VPATH
=$(SRC_PATH
)/pc-bios
/optionrom
8 # from kernel sources - scripts/Kbuild.include
10 # Usage: option = $(call try-run, $(CC)...-o "$$TMP",option-ok,otherwise)
11 # Exit code chooses option. "$$TMP" is can be used as temporary file and
12 # is automatically cleaned up.
13 try-run
= $(shell set
-e
; \
14 TMP
="$(TMPOUT).$$$$.tmp"; \
15 if
($(1)) >/dev
/null
2>&1; \
22 # Usage: flag := $(call cc-option-yn,-march=winchip-c6)
23 cc-option-yn
= $(call try-run
,\
24 $(CC
) $(KBUILD_CFLAGS
) $(1) -S
-xc
/dev
/null
-o
"$$TMP",y
,n
)
26 CFLAGS
= -Wall
-Wstrict-prototypes
-Werror
-fomit-frame-pointer
-fno-builtin
27 CFLAGS
+= -I
$(SRC_PATH
)
28 ifeq ($(call cc-option-yn
,-fno-stack-protector
),y
)
29 CFLAGS
+= -fno-stack-protector
32 build-all
: multiboot.bin
35 $(CC
) $(CFLAGS
) -o
$@
-c
$<
38 $(LD
) --oformat binary
-Ttext
0 -o
$@
$<
42 cp
$@
$(SRC_PATH
)/pc-bios
/
45 $(CC
) -o
$@
-g
-Wall
$^
48 $(RM
) *.o
*.img
*.bin signrom
*~