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