Print this page
HVM-785 kvm-cmd build should use CTFMERGE and CTFCONVERT
Split |
Close |
Expand all |
Collapse all |
--- old/./rules.mak
+++ new/./rules.mak
1 1
2 2 # Don't use implicit rules or variables
3 3 # we have explicit rules for everything
4 4 MAKEFLAGS += -rR
5 5
6 6 # Files with this suffixes are final, don't try to generate them
7 7 # using implicit rules
8 8 %.d:
9 9 %.h:
10 10 %.c:
11 11 %.m:
12 12 %.mak:
13 13
14 14 # Flags for dependency generation
15 15 QEMU_DGFLAGS += -MMD -MP -MT $@ -MF $(*D)/$(*F).d
16 16
17 17 %.o: %.c
↓ open down ↓ |
17 lines elided |
↑ open up ↑ |
18 18 $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," CC $(TARGET_DIR)$@")
19 19
20 20 %.o: %.S
21 21 $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," AS $(TARGET_DIR)$@")
22 22
23 23 %.o: %.m
24 24 $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_INCLUDES) $(QEMU_DGFLAGS) $(CFLAGS) -c -o $@ $<," OBJC $(TARGET_DIR)$@")
25 25
26 26 LINK = $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(1) $(LIBS)," LINK $(TARGET_DIR)$@")
27 27
28 -CTFMERGE = $(call quiet-command, $$(which ctfmerge) -L VERSION -o $@ $(1)," CTFMERGE $(TARGET_DIR)$@")
28 +CTFMERGE_CMD = $(call quiet-command, $(CTFMERGE) -L VERSION -o $@ $(1)," CTFMERGE $(TARGET_DIR)$@")
29 +
30 +CTFCONVERT_CMD = $(call quiet-command, CTFCONVERT=$(CTFCONVERT) find ../ -type f -name '*.o' -exec ../ctf.sh '{}' \;)
29 31
30 32 ifeq ($(TRACE_BACKEND),dtrace)
31 33 ifneq ($(strip $(CONFIG_SOLARIS)),)
32 34 %$(EXESUF): %.o
33 35 $(call quiet-command, dtrace $(CONFIG_DTRACE_FLAGS) -o trace-dtrace.o -s trace-dtrace.dtrace -G $^," LINK $(TARGET_DIR)$@.dtrace")
34 36 $(call LINK,$^ trace-dtrace.o)
35 37 else
36 38 %$(EXESUF): %.o
37 39 $(call LINK,$^)
38 40 endif
39 41 else
40 42 %$(EXESUF): %.o
41 43 $(call LINK,$^)
42 44 endif
43 45
44 46 %.a:
45 47 $(call quiet-command,rm -f $@ && $(AR) rcs $@ $^," AR $(TARGET_DIR)$@")
46 48
47 49 quiet-command = $(if $(V),$1,$(if $(2),@echo $2 && $1, @$1))
48 50
49 51 # cc-option
50 52 # Usage: CFLAGS+=$(call cc-option, -falign-functions=0, -malign-functions=0)
51 53
52 54 cc-option = $(if $(shell $(CC) $1 $2 -S -o /dev/null -xc /dev/null \
53 55 >/dev/null 2>&1 && echo OK), $2, $3)
54 56
55 57 VPATH_SUFFIXES = %.c %.h %.S %.m %.mak %.texi
56 58 set-vpath = $(if $1,$(foreach PATTERN,$(VPATH_SUFFIXES),$(eval vpath $(PATTERN) $1)))
57 59
58 60 # find-in-path
59 61 # Usage: $(call find-in-path, prog)
60 62 # Looks in the PATH if the argument contains no slash, else only considers one
61 63 # specific directory. Returns an # empty string if the program doesn't exist
62 64 # there.
63 65 find-in-path = $(if $(find-string /, $1), \
64 66 $(wildcard $1), \
65 67 $(wildcard $(patsubst %, %/$1, $(subst :, ,$(PATH)))))
66 68
67 69 # Generate timestamp files for .h include files
68 70
69 71 %.h: %.h-timestamp
70 72 @test -f $@ || cp $< $@
71 73
72 74 %.h-timestamp: %.mak
73 75 $(call quiet-command, sh $(SRC_PATH)/scripts/create_config < $< > $@, " GEN $*.h")
74 76 @cmp $@ $*.h >/dev/null 2>&1 || cp $@ $*.h
75 77
76 78 # will delete the target of a rule if commands exit with a nonzero exit status
77 79 .DELETE_ON_ERROR:
↓ open down ↓ |
39 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX