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