Sparc: fix carry flag handling (Solaris bootblk fix)
[qemu/mdroth.git] / rules.mak
blob5d7e8bb09203fa77eb04f8c33dee4766452a3046
2 # Don't use implicit rules or variables
3 # we have explicit rules for everything
4 MAKEFLAGS += -rR
6 # Files with this suffixes are final, don't try to generate them
7 # using implicit rules
8 %.d:
9 %.h:
10 %.c:
11 %.m:
12 %.mak:
14 QEMU_CFLAGS += -MMD -MP -MT $@
16 %.o: %.c
17 $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) -c -o $@ $<," CC $(TARGET_DIR)$@")
19 %.o: %.S
20 $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CLAGS) -c -o $@ $<," AS $(TARGET_DIR)$@")
22 %.o: %.m
23 $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) -c -o $@ $<," OBJC $(TARGET_DIR)$@")
25 LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(1) $(ARLIBS_BEGIN) $(ARLIBS) $(ARLIBS_END) $(LIBS)," LINK $(TARGET_DIR)$@")
27 %$(EXESUF): %.o
28 $(call LINK,$^)
30 %.a:
31 $(call quiet-command,rm -f $@ && $(AR) rcs $@ $^," AR $(TARGET_DIR)$@")
33 quiet-command = $(if $(V),$1,$(if $(2),@echo $2 && $1, @$1))
35 # cc-option
36 # Usage: CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0)
38 cc-option = $(if $(shell $(CC) $1 $2 -S -o /dev/null -xc /dev/null \
39 >/dev/null 2>&1 && echo OK), $2, $3)
41 # Generate timestamp files for .h include files
43 %.h: %.h-timestamp
44 @test -f $@ || cp $< $@
46 %.h-timestamp: %.mak
47 $(call quiet-command, $(SRC_PATH)/create_config < $< > $@, " GEN $*.h")
48 @cmp $@ $*.h >/dev/null 2>&1 || cp $@ $*.h