root / Makefile.target @ 29002d9e
History | View | Annotate | Download (5.6 kB)
1 |
# -*- Mode: makefile -*- |
---|---|
2 |
|
3 |
include ../config-host.mak |
4 |
include config-devices.mak |
5 |
include config-target.mak |
6 |
include $(SRC_PATH)/rules.mak |
7 |
|
8 |
$(call set-vpath, $(SRC_PATH)) |
9 |
ifdef CONFIG_LINUX |
10 |
QEMU_CFLAGS += -I../linux-headers |
11 |
endif |
12 |
QEMU_CFLAGS += -I.. -I$(SRC_PATH)/target-$(TARGET_BASE_ARCH) -DNEED_CPU_H |
13 |
|
14 |
QEMU_CFLAGS+=-I$(SRC_PATH)/include |
15 |
QEMU_CFLAGS+=-I$(SRC_PATH)/hw/pci -I$(SRC_PATH)/hw |
16 |
|
17 |
ifdef CONFIG_USER_ONLY |
18 |
# user emulator name |
19 |
QEMU_PROG=qemu-$(TARGET_ARCH2) |
20 |
else |
21 |
# system emulator name |
22 |
ifneq (,$(findstring -mwindows,$(LIBS))) |
23 |
# Terminate program name with a 'w' because the linker builds a windows executable. |
24 |
QEMU_PROGW=qemu-system-$(TARGET_ARCH2)w$(EXESUF) |
25 |
endif # windows executable |
26 |
QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF) |
27 |
endif |
28 |
|
29 |
PROGS=$(QEMU_PROG) |
30 |
ifdef QEMU_PROGW |
31 |
PROGS+=$(QEMU_PROGW) |
32 |
endif |
33 |
STPFILES= |
34 |
|
35 |
ifndef CONFIG_HAIKU |
36 |
LIBS+=-lm |
37 |
endif |
38 |
|
39 |
config-target.h: config-target.h-timestamp |
40 |
config-target.h-timestamp: config-target.mak |
41 |
|
42 |
ifdef CONFIG_TRACE_SYSTEMTAP |
43 |
stap: $(QEMU_PROG).stp |
44 |
|
45 |
ifdef CONFIG_USER_ONLY |
46 |
TARGET_TYPE=user |
47 |
else |
48 |
TARGET_TYPE=system |
49 |
endif |
50 |
|
51 |
$(QEMU_PROG).stp: $(SRC_PATH)/trace-events |
52 |
$(call quiet-command,$(TRACETOOL) \ |
53 |
--format=stap \ |
54 |
--backend=$(TRACE_BACKEND) \ |
55 |
--binary=$(bindir)/$(QEMU_PROG) \ |
56 |
--target-arch=$(TARGET_ARCH) \ |
57 |
--target-type=$(TARGET_TYPE) \ |
58 |
< $< > $@," GEN $(QEMU_PROG).stp") |
59 |
else |
60 |
stap: |
61 |
endif |
62 |
|
63 |
all: $(PROGS) stap |
64 |
|
65 |
# Dummy command so that make thinks it has done something |
66 |
@true |
67 |
|
68 |
######################################################### |
69 |
# cpu emulator library |
70 |
obj-y = exec.o translate-all.o cpu-exec.o |
71 |
obj-y += tcg/tcg.o tcg/optimize.o |
72 |
obj-$(CONFIG_TCG_INTERPRETER) += tci.o |
73 |
obj-y += fpu/softfloat.o |
74 |
obj-y += disas.o |
75 |
obj-$(CONFIG_TCI_DIS) += tci-dis.o |
76 |
obj-y += target-$(TARGET_BASE_ARCH)/ |
77 |
obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o |
78 |
|
79 |
tci-dis.o: QEMU_CFLAGS += -I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/tci |
80 |
|
81 |
######################################################### |
82 |
# Linux user emulator target |
83 |
|
84 |
ifdef CONFIG_LINUX_USER |
85 |
|
86 |
QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user |
87 |
|
88 |
obj-y += linux-user/ |
89 |
obj-y += gdbstub.o thunk.o user-exec.o $(oslib-obj-y) |
90 |
|
91 |
endif #CONFIG_LINUX_USER |
92 |
|
93 |
######################################################### |
94 |
# BSD user emulator target |
95 |
|
96 |
ifdef CONFIG_BSD_USER |
97 |
|
98 |
QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH) |
99 |
|
100 |
obj-y += bsd-user/ |
101 |
obj-y += gdbstub.o user-exec.o $(oslib-obj-y) |
102 |
|
103 |
endif #CONFIG_BSD_USER |
104 |
|
105 |
######################################################### |
106 |
# System emulator target |
107 |
ifdef CONFIG_SOFTMMU |
108 |
CONFIG_NO_PCI = $(if $(subst n,,$(CONFIG_PCI)),n,y) |
109 |
CONFIG_NO_KVM = $(if $(subst n,,$(CONFIG_KVM)),n,y) |
110 |
CONFIG_NO_XEN = $(if $(subst n,,$(CONFIG_XEN)),n,y) |
111 |
CONFIG_NO_GET_MEMORY_MAPPING = $(if $(subst n,,$(CONFIG_HAVE_GET_MEMORY_MAPPING)),n,y) |
112 |
CONFIG_NO_CORE_DUMP = $(if $(subst n,,$(CONFIG_HAVE_CORE_DUMP)),n,y) |
113 |
|
114 |
obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o |
115 |
obj-y += hw/ |
116 |
obj-$(CONFIG_KVM) += kvm-all.o |
117 |
obj-$(CONFIG_NO_KVM) += kvm-stub.o |
118 |
obj-y += memory.o savevm.o cputlb.o |
119 |
obj-$(CONFIG_HAVE_GET_MEMORY_MAPPING) += memory_mapping.o |
120 |
obj-$(CONFIG_HAVE_CORE_DUMP) += dump.o |
121 |
obj-$(CONFIG_NO_GET_MEMORY_MAPPING) += memory_mapping-stub.o |
122 |
obj-$(CONFIG_NO_CORE_DUMP) += dump-stub.o |
123 |
LIBS+=-lz |
124 |
|
125 |
QEMU_CFLAGS += $(VNC_TLS_CFLAGS) |
126 |
QEMU_CFLAGS += $(VNC_SASL_CFLAGS) |
127 |
QEMU_CFLAGS += $(VNC_JPEG_CFLAGS) |
128 |
QEMU_CFLAGS += $(VNC_PNG_CFLAGS) |
129 |
|
130 |
# xen support |
131 |
obj-$(CONFIG_XEN) += xen-all.o xen-mapcache.o |
132 |
obj-$(CONFIG_NO_XEN) += xen-stub.o |
133 |
|
134 |
# Hardware support |
135 |
ifeq ($(TARGET_ARCH), sparc64) |
136 |
obj-y += hw/sparc64/ |
137 |
else |
138 |
obj-y += hw/$(TARGET_BASE_ARCH)/ |
139 |
endif |
140 |
|
141 |
main.o: QEMU_CFLAGS+=$(GPROF_CFLAGS) |
142 |
|
143 |
GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h |
144 |
|
145 |
endif # CONFIG_SOFTMMU |
146 |
|
147 |
# Workaround for http://gcc.gnu.org/PR55489, see configure. |
148 |
%/translate.o: QEMU_CFLAGS += $(TRANSLATE_OPT_CFLAGS) |
149 |
|
150 |
nested-vars += obj-y |
151 |
|
152 |
# This resolves all nested paths, so it must come last |
153 |
include $(SRC_PATH)/Makefile.objs |
154 |
|
155 |
all-obj-y = $(obj-y) |
156 |
all-obj-y += $(addprefix ../, $(universal-obj-y)) |
157 |
|
158 |
ifdef CONFIG_SOFTMMU |
159 |
all-obj-y += $(addprefix ../, $(common-obj-y)) |
160 |
all-obj-y += $(addprefix ../libdis/, $(libdis-y)) |
161 |
all-obj-y += $(addprefix ../, $(trace-obj-y)) |
162 |
else |
163 |
all-obj-y += $(addprefix ../libuser/, $(user-obj-y)) |
164 |
all-obj-y += $(addprefix ../libdis-user/, $(libdis-y)) |
165 |
endif #CONFIG_LINUX_USER |
166 |
|
167 |
ifdef QEMU_PROGW |
168 |
# The linker builds a windows executable. Make also a console executable. |
169 |
$(QEMU_PROGW): $(all-obj-y) ../libqemustub.a |
170 |
$(call LINK,$^) |
171 |
$(QEMU_PROG): $(QEMU_PROGW) |
172 |
$(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW) $(QEMU_PROG)," GEN $(TARGET_DIR)$(QEMU_PROG)") |
173 |
else |
174 |
$(QEMU_PROG): $(all-obj-y) ../libqemustub.a |
175 |
$(call LINK,$^) |
176 |
endif |
177 |
|
178 |
gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh |
179 |
$(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES)," GEN $(TARGET_DIR)$@") |
180 |
|
181 |
hmp-commands.h: $(SRC_PATH)/hmp-commands.hx |
182 |
$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@") |
183 |
|
184 |
qmp-commands-old.h: $(SRC_PATH)/qmp-commands.hx |
185 |
$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@") |
186 |
|
187 |
clean: |
188 |
rm -f *.a *~ $(PROGS) |
189 |
rm -f $(shell find . -name '*.[od]') |
190 |
rm -f hmp-commands.h qmp-commands-old.h gdbstub-xml.c |
191 |
ifdef CONFIG_TRACE_SYSTEMTAP |
192 |
rm -f *.stp |
193 |
endif |
194 |
|
195 |
install: all |
196 |
ifneq ($(PROGS),) |
197 |
$(INSTALL) -m 755 $(PROGS) "$(DESTDIR)$(bindir)" |
198 |
ifneq ($(STRIP),) |
199 |
$(STRIP) $(patsubst %,"$(DESTDIR)$(bindir)/%",$(PROGS)) |
200 |
endif |
201 |
endif |
202 |
ifdef CONFIG_TRACE_SYSTEMTAP |
203 |
$(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset" |
204 |
$(INSTALL_DATA) $(QEMU_PROG).stp "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset" |
205 |
endif |
206 |
|
207 |
GENERATED_HEADERS += config-target.h |
208 |
Makefile: $(GENERATED_HEADERS) |