3 # from kernel sources - scripts/Kbuild.include
5 # Usage: option = $(call try-run, $(CC)...-o "$$TMP",option-ok,otherwise)
6 # Exit code chooses option. "$$TMP" is can be used as temporary file and
7 # is automatically cleaned up.
8 try-run
= $(shell set
-e
; \
9 TMP
="$(TMPOUT).$$$$.tmp"; \
10 if
($(1)) >/dev
/null
2>&1; \
17 # Usage: flag := $(call cc-option-yn,-march=winchip-c6)
18 cc-option-yn
= $(call try-run
,\
19 $(CC
) $(KBUILD_CFLAGS
) $(1) -S
-xc
/dev
/null
-o
"$$TMP",y
,n
)
21 CFLAGS
= -Wall
-Wstrict-prototypes
-Werror
-fomit-frame-pointer
-fno-builtin
22 ifeq ($(call cc-option-yn
,-fno-stack-protector
),y
)
23 CFLAGS
+= -fno-stack-protector
29 $(CC
) $(CFLAGS
) -o
$@
-c
$<
31 extboot.img
: extboot.o
32 $(LD
) --oformat binary
-Ttext
0 -o
$@
$<
34 extboot.bin
: extboot.img signrom
35 .
/signrom extboot.img extboot.bin
38 $(CC
) -o
$@
-g
-Wall
$^
41 $(RM
) *.o
*.img
*.bin signrom
*~