]>
Commit | Line | Data |
---|---|---|
562593aa AL |
1 | # -*- Mode: makefile -*- |
2 | ||
6b4ad3b2 PC |
3 | BUILD_DIR?=$(CURDIR)/.. |
4 | ||
deed3ccf | 5 | include ../config-host.mak |
25be210f | 6 | include config-target.mak |
f3aa844b | 7 | include config-devices.mak |
17759187 | 8 | include $(SRC_PATH)/rules.mak |
626df76a | 9 | |
12a1ddc1 | 10 | $(call set-vpath, $(SRC_PATH):$(BUILD_DIR)) |
af2be207 JK |
11 | ifdef CONFIG_LINUX |
12 | QEMU_CFLAGS += -I../linux-headers | |
13 | endif | |
fcf5ef2a | 14 | QEMU_CFLAGS += -I.. -I$(SRC_PATH)/target/$(TARGET_BASE_ARCH) -DNEED_CPU_H |
40293e58 | 15 | |
2f28d2ff AL |
16 | QEMU_CFLAGS+=-I$(SRC_PATH)/include |
17 | ||
40293e58 FB |
18 | ifdef CONFIG_USER_ONLY |
19 | # user emulator name | |
c1799a84 | 20 | QEMU_PROG=qemu-$(TARGET_NAME) |
5c40c739 | 21 | QEMU_PROG_BUILD = $(QEMU_PROG) |
40293e58 | 22 | else |
1e43adfc | 23 | # system emulator name |
5c40c739 | 24 | QEMU_PROG=qemu-system-$(TARGET_NAME)$(EXESUF) |
c12915e6 | 25 | ifneq (,$(findstring -mwindows,$(libs_softmmu))) |
0fa5491e | 26 | # Terminate program name with a 'w' because the linker builds a windows executable. |
c1799a84 | 27 | QEMU_PROGW=qemu-system-$(TARGET_NAME)w$(EXESUF) |
5c40c739 | 28 | $(QEMU_PROG): $(QEMU_PROGW) |
0bdb12c7 | 29 | $(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW) $(QEMU_PROG),"GEN","$(TARGET_DIR)$(QEMU_PROG)") |
5c40c739 MT |
30 | QEMU_PROG_BUILD = $(QEMU_PROGW) |
31 | else | |
32 | QEMU_PROG_BUILD = $(QEMU_PROG) | |
a541f297 | 33 | endif |
0fa5491e | 34 | endif |
5c40c739 MT |
35 | |
36 | PROGS=$(QEMU_PROG) $(QEMU_PROGW) | |
b8841706 | 37 | STPFILES= |
626df76a | 38 | |
91880d96 JQ |
39 | config-target.h: config-target.h-timestamp |
40 | config-target.h-timestamp: config-target.mak | |
41 | ||
6d8a764e | 42 | ifdef CONFIG_TRACE_SYSTEMTAP |
e0b2fd0e | 43 | stap: $(QEMU_PROG).stp-installed $(QEMU_PROG).stp $(QEMU_PROG)-simpletrace.stp |
c276b17d DB |
44 | |
45 | ifdef CONFIG_USER_ONLY | |
46 | TARGET_TYPE=user | |
47 | else | |
48 | TARGET_TYPE=system | |
49 | endif | |
50 | ||
ed865058 DB |
51 | tracetool-y = $(SRC_PATH)/scripts/tracetool.py |
52 | tracetool-y += $(shell find $(SRC_PATH)/scripts/tracetool -name "*.py") | |
53 | ||
54 | $(QEMU_PROG).stp-installed: $(BUILD_DIR)/trace-events-all $(tracetool-y) | |
c0424934 | 55 | $(call quiet-command,$(TRACETOOL) \ |
2098c56a | 56 | --group=all \ |
650ab98d | 57 | --format=stap \ |
5b808275 | 58 | --backends=$(TRACE_BACKENDS) \ |
650ab98d | 59 | --binary=$(bindir)/$(QEMU_PROG) \ |
b9a7b74f | 60 | --target-name=$(TARGET_NAME) \ |
650ab98d | 61 | --target-type=$(TARGET_TYPE) \ |
0bc6484d | 62 | $< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG).stp-installed") |
c14518e9 | 63 | |
ed865058 | 64 | $(QEMU_PROG).stp: $(BUILD_DIR)/trace-events-all $(tracetool-y) |
c14518e9 | 65 | $(call quiet-command,$(TRACETOOL) \ |
2098c56a | 66 | --group=all \ |
c14518e9 | 67 | --format=stap \ |
5b808275 | 68 | --backends=$(TRACE_BACKENDS) \ |
c14518e9 | 69 | --binary=$(realpath .)/$(QEMU_PROG) \ |
b9a7b74f | 70 | --target-name=$(TARGET_NAME) \ |
c14518e9 | 71 | --target-type=$(TARGET_TYPE) \ |
0bc6484d | 72 | $< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG).stp") |
c14518e9 | 73 | |
ed865058 | 74 | $(QEMU_PROG)-simpletrace.stp: $(BUILD_DIR)/trace-events-all $(tracetool-y) |
e0b2fd0e | 75 | $(call quiet-command,$(TRACETOOL) \ |
2098c56a | 76 | --group=all \ |
e0b2fd0e SH |
77 | --format=simpletrace-stap \ |
78 | --backends=$(TRACE_BACKENDS) \ | |
79 | --probe-prefix=qemu.$(TARGET_TYPE).$(TARGET_NAME) \ | |
0bc6484d | 80 | $< > $@,"GEN","$(TARGET_DIR)$(QEMU_PROG)-simpletrace.stp") |
e0b2fd0e | 81 | |
c276b17d DB |
82 | else |
83 | stap: | |
84 | endif | |
a273f4ce | 85 | .PHONY: stap |
c276b17d DB |
86 | |
87 | all: $(PROGS) stap | |
91880d96 | 88 | |
c2fb2637 PB |
89 | # Dummy command so that make thinks it has done something |
90 | @true | |
626df76a | 91 | |
40293e58 | 92 | ######################################################### |
626df76a | 93 | # cpu emulator library |
92229a57 | 94 | obj-y += exec.o |
d9bb58e5 | 95 | obj-y += accel/ |
e4b4b642 YZ |
96 | obj-$(CONFIG_TCG) += tcg/tcg.o tcg/tcg-op.o tcg/optimize.o |
97 | obj-$(CONFIG_TCG) += tcg/tcg-common.o tcg/tcg-runtime.o | |
8dfaf23a | 98 | obj-$(CONFIG_TCG_INTERPRETER) += tcg/tci.o |
50348333 | 99 | obj-$(CONFIG_TCG_INTERPRETER) += disas/tci.o |
9cdc8df3 | 100 | obj-y += fpu/softfloat.o |
fcf5ef2a | 101 | obj-y += target/$(TARGET_BASE_ARCH)/ |
76cad711 | 102 | obj-y += disas.o |
b77abd95 | 103 | obj-$(call notempty,$(TARGET_XML_FILES)) += gdbstub-xml.o |
b0cb0a66 | 104 | obj-$(call lnot,$(CONFIG_HAX)) += hax-stub.o |
5e8861a0 | 105 | |
e58f8d1f TM |
106 | obj-$(CONFIG_LIBDECNUMBER) += libdecnumber/decContext.o |
107 | obj-$(CONFIG_LIBDECNUMBER) += libdecnumber/decNumber.o | |
108 | obj-$(CONFIG_LIBDECNUMBER) += libdecnumber/dpd/decimal32.o | |
109 | obj-$(CONFIG_LIBDECNUMBER) += libdecnumber/dpd/decimal64.o | |
110 | obj-$(CONFIG_LIBDECNUMBER) += libdecnumber/dpd/decimal128.o | |
111 | ||
40293e58 FB |
112 | ######################################################### |
113 | # Linux user emulator target | |
114 | ||
115 | ifdef CONFIG_LINUX_USER | |
116 | ||
4d330cee | 117 | QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) \ |
ba453780 | 118 | -I$(SRC_PATH)/linux-user/host/$(ARCH) \ |
4d330cee | 119 | -I$(SRC_PATH)/linux-user |
1c872672 | 120 | |
7fc5152c | 121 | obj-y += linux-user/ |
5564edb1 | 122 | obj-y += gdbstub.o thunk.o user-exec.o user-exec-stub.o |
40293e58 | 123 | |
40293e58 FB |
124 | endif #CONFIG_LINUX_USER |
125 | ||
84778508 BS |
126 | ######################################################### |
127 | # BSD user emulator target | |
128 | ||
129 | ifdef CONFIG_BSD_USER | |
130 | ||
adfc3e91 SS |
131 | QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ABI_DIR) \ |
132 | -I$(SRC_PATH)/bsd-user/$(HOST_VARIANT_DIR) | |
84778508 | 133 | |
7fc5152c | 134 | obj-y += bsd-user/ |
5564edb1 | 135 | obj-y += gdbstub.o user-exec.o user-exec-stub.o |
84778508 | 136 | |
84778508 BS |
137 | endif #CONFIG_BSD_USER |
138 | ||
40293e58 FB |
139 | ######################################################### |
140 | # System emulator target | |
76dfdd24 | 141 | ifdef CONFIG_SOFTMMU |
96d0e26c | 142 | obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o numa.o |
5ddc6482 | 143 | obj-y += qtest.o |
c353f261 | 144 | obj-y += hw/ |
d9bb58e5 | 145 | obj-y += memory.o |
c22d8e04 | 146 | obj-y += memory_mapping.o |
2a78636b | 147 | obj-y += dump.o |
46d702b1 | 148 | obj-y += migration/ram.o |
7398dfc7 | 149 | LIBS := $(libs_softmmu) $(LIBS) |
4fb240a4 | 150 | |
a541f297 | 151 | # Hardware support |
b9a7b74f | 152 | ifeq ($(TARGET_NAME), sparc64) |
5e8861a0 | 153 | obj-y += hw/sparc64/ |
3475187d | 154 | else |
5e8861a0 | 155 | obj-y += hw/$(TARGET_BASE_ARCH)/ |
9637443f JQ |
156 | endif |
157 | ||
4f04f13c | 158 | GENERATED_FILES += hmp-commands.h hmp-commands-info.h |
0e8c9214 | 159 | |
76dfdd24 | 160 | endif # CONFIG_SOFTMMU |
00a67ba1 | 161 | |
cbdd1999 PB |
162 | # Workaround for http://gcc.gnu.org/PR55489, see configure. |
163 | %/translate.o: QEMU_CFLAGS += $(TRANSLATE_OPT_CFLAGS) | |
164 | ||
ba1183da | 165 | dummy := $(call unnest-vars,,obj-y) |
d608cc5c | 166 | all-obj-y := $(obj-y) |
ba1183da | 167 | |
341ea691 | 168 | target-obj-y := |
ba1183da FZ |
169 | block-obj-y := |
170 | common-obj-y := | |
32d955a4 | 171 | chardev-obj-y := |
99100dc3 | 172 | include $(SRC_PATH)/Makefile.objs |
341ea691 LV |
173 | dummy := $(call unnest-vars,,target-obj-y) |
174 | target-obj-y-save := $(target-obj-y) | |
cc475698 FZ |
175 | dummy := $(call unnest-vars,.., \ |
176 | block-obj-y \ | |
177 | block-obj-m \ | |
32d955a4 | 178 | chardev-obj-y \ |
fb37726d DB |
179 | crypto-obj-y \ |
180 | crypto-aes-obj-y \ | |
0c7012e0 | 181 | qom-obj-y \ |
666a3af9 | 182 | io-obj-y \ |
cc475698 | 183 | common-obj-y \ |
3d1baccb | 184 | common-obj-m) |
341ea691 | 185 | target-obj-y := $(target-obj-y-save) |
d608cc5c | 186 | all-obj-y += $(common-obj-y) |
341ea691 | 187 | all-obj-y += $(target-obj-y) |
0c7012e0 | 188 | all-obj-y += $(qom-obj-y) |
32d955a4 | 189 | all-obj-$(CONFIG_SOFTMMU) += $(block-obj-y) $(chardev-obj-y) |
fb37726d DB |
190 | all-obj-$(CONFIG_USER_ONLY) += $(crypto-aes-obj-y) |
191 | all-obj-$(CONFIG_SOFTMMU) += $(crypto-obj-y) | |
666a3af9 | 192 | all-obj-$(CONFIG_SOFTMMU) += $(io-obj-y) |
7fc5152c | 193 | |
a9ad5e1e MT |
194 | $(QEMU_PROG_BUILD): config-devices.mak |
195 | ||
3d1baccb | 196 | COMMON_LDADDS = ../libqemuutil.a ../libqemustub.a |
0ab8ed18 | 197 | |
5c40c739 | 198 | # build either PROG or PROGW |
0ab8ed18 | 199 | $(QEMU_PROG_BUILD): $(all-obj-y) $(COMMON_LDADDS) |
a9ad5e1e | 200 | $(call LINK, $(filter-out %.mak, $^)) |
4e34017c | 201 | ifdef CONFIG_DARWIN |
0bdb12c7 PM |
202 | $(call quiet-command,Rez -append $(SRC_PATH)/pc-bios/qemu.rsrc -o $@,"REZ","$(TARGET_DIR)$@") |
203 | $(call quiet-command,SetFile -a C $@,"SETFILE","$(TARGET_DIR)$@") | |
4e34017c | 204 | endif |
16394485 | 205 | |
4c3b5a48 | 206 | gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh |
0bdb12c7 | 207 | $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES),"GEN","$(TARGET_DIR)$@") |
56aebc89 | 208 | |
077de81a | 209 | hmp-commands.h: $(SRC_PATH)/hmp-commands.hx $(SRC_PATH)/scripts/hxtool |
0bdb12c7 | 210 | $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$(TARGET_DIR)$@") |
2313086a | 211 | |
077de81a | 212 | hmp-commands-info.h: $(SRC_PATH)/hmp-commands-info.hx $(SRC_PATH)/scripts/hxtool |
0bdb12c7 | 213 | $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$(TARGET_DIR)$@") |
da76ee76 | 214 | |
dced7eec | 215 | clean: clean-target |
b54fa7dd PM |
216 | rm -f *.a *~ $(PROGS) |
217 | rm -f $(shell find . -name '*.[od]') | |
84289499 | 218 | rm -f hmp-commands.h gdbstub-xml.c |
6d8a764e | 219 | ifdef CONFIG_TRACE_SYSTEMTAP |
c276b17d DB |
220 | rm -f *.stp |
221 | endif | |
1e43adfc | 222 | |
5fafdf24 | 223 | install: all |
9b14bb04 | 224 | ifneq ($(PROGS),) |
0d659426 | 225 | $(call install-prog,$(PROGS),$(DESTDIR)$(bindir)) |
9b14bb04 | 226 | endif |
6d8a764e | 227 | ifdef CONFIG_TRACE_SYSTEMTAP |
6aae2a2e | 228 | $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset" |
c14518e9 | 229 | $(INSTALL_DATA) $(QEMU_PROG).stp-installed "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG).stp" |
e0b2fd0e | 230 | $(INSTALL_DATA) $(QEMU_PROG)-simpletrace.stp "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG)-simpletrace.stp" |
c276b17d | 231 | endif |
626df76a | 232 | |
4f04f13c DB |
233 | GENERATED_FILES += config-target.h |
234 | Makefile: $(GENERATED_FILES) |