2 # Don't use implicit rules or variables
3 # we have explicit rules for everything
6 # Files with this suffixes are final, don't try to generate them
14 # Flags for dependency generation
15 QEMU_DGFLAGS
+= -MMD
-MP
-MT
$@
17 %.o
: %.c
$(GENERATED_HEADERS
)
18 $(call quiet-command
,$(CC
) $(QEMU_CFLAGS
) $(QEMU_DGFLAGS
) $(CFLAGS
) -c
-o
$@
$<," CC $(TARGET_DIR)$@")
21 $(call quiet-command
,$(CC
) $(QEMU_CFLAGS
) $(QEMU_DGFLAGS
) $(CFLAGS
) -c
-o
$@
$<," AS $(TARGET_DIR)$@")
24 $(call quiet-command
,$(CC
) $(QEMU_CFLAGS
) $(QEMU_DGFLAGS
) $(CFLAGS
) -c
-o
$@
$<," OBJC $(TARGET_DIR)$@")
26 LINK
= $(call quiet-command
,$(CC
) $(QEMU_CFLAGS
) $(CFLAGS
) $(LDFLAGS
) -o
$@
$(1) $(ARLIBS_BEGIN
) $(ARLIBS
) $(ARLIBS_END
) $(LIBS
)," LINK $(TARGET_DIR)$@")
32 $(call quiet-command
,rm -f
$@
&& $(AR
) rcs
$@
$^
," AR $(TARGET_DIR)$@")
34 quiet-command
= $(if
$(V
),$1,$(if
$(2),@echo
$2 && $1, @
$1))
37 # Usage: CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0)
39 cc-option
= $(if
$(shell $(CC
) $1 $2 -S
-o
/dev
/null
-xc
/dev
/null \
40 >/dev
/null
2>&1 && echo OK
), $2, $3)
42 # Generate timestamp files for .h include files
45 @
test -f
$@ || cp
$< $@
48 $(call quiet-command
, sh
$(SRC_PATH
)/create_config
< $< > $@
, " GEN $*.h")
49 @cmp
$@
$*.h
>/dev
/null
2>&1 || cp
$@
$*.h