]> git.proxmox.com Git - qemu.git/blame - Makefile.target
qom: allow turning cast debugging off
[qemu.git] / Makefile.target
CommitLineData
562593aa
AL
1# -*- Mode: makefile -*-
2
deed3ccf 3include ../config-host.mak
25be210f 4include config-target.mak
f3aa844b 5include config-devices.mak
17759187 6include $(SRC_PATH)/rules.mak
626df76a 7
fec90ff0 8$(call set-vpath, $(SRC_PATH))
af2be207
JK
9ifdef CONFIG_LINUX
10QEMU_CFLAGS += -I../linux-headers
11endif
fec90ff0 12QEMU_CFLAGS += -I.. -I$(SRC_PATH)/target-$(TARGET_BASE_ARCH) -DNEED_CPU_H
40293e58 13
2f28d2ff
AL
14QEMU_CFLAGS+=-I$(SRC_PATH)/include
15
40293e58
FB
16ifdef CONFIG_USER_ONLY
17# user emulator name
18QEMU_PROG=qemu-$(TARGET_ARCH2)
19else
1e43adfc 20# system emulator name
c12915e6 21ifneq (,$(findstring -mwindows,$(libs_softmmu)))
0fa5491e
SW
22# Terminate program name with a 'w' because the linker builds a windows executable.
23QEMU_PROGW=qemu-system-$(TARGET_ARCH2)w$(EXESUF)
24endif # windows executable
40293e58 25QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF)
a541f297 26endif
626df76a 27
40293e58 28PROGS=$(QEMU_PROG)
0fa5491e
SW
29ifdef QEMU_PROGW
30PROGS+=$(QEMU_PROGW)
31endif
b8841706 32STPFILES=
626df76a 33
91880d96
JQ
34config-target.h: config-target.h-timestamp
35config-target.h-timestamp: config-target.mak
36
6d8a764e 37ifdef CONFIG_TRACE_SYSTEMTAP
c276b17d
DB
38stap: $(QEMU_PROG).stp
39
40ifdef CONFIG_USER_ONLY
41TARGET_TYPE=user
42else
43TARGET_TYPE=system
44endif
45
2174e238 46$(QEMU_PROG).stp: $(SRC_PATH)/trace-events
c0424934 47 $(call quiet-command,$(TRACETOOL) \
650ab98d
LV
48 --format=stap \
49 --backend=$(TRACE_BACKEND) \
50 --binary=$(bindir)/$(QEMU_PROG) \
51 --target-arch=$(TARGET_ARCH) \
52 --target-type=$(TARGET_TYPE) \
aaf821fd 53 < $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG).stp")
c276b17d
DB
54else
55stap:
56endif
57
58all: $(PROGS) stap
91880d96 59
c2fb2637
PB
60# Dummy command so that make thinks it has done something
61 @true
626df76a 62
c4cfef5e
IM
63CONFIG_NO_PCI = $(if $(subst n,,$(CONFIG_PCI)),n,y)
64CONFIG_NO_KVM = $(if $(subst n,,$(CONFIG_KVM)),n,y)
65CONFIG_NO_XEN = $(if $(subst n,,$(CONFIG_XEN)),n,y)
66CONFIG_NO_GET_MEMORY_MAPPING = $(if $(subst n,,$(CONFIG_HAVE_GET_MEMORY_MAPPING)),n,y)
67CONFIG_NO_CORE_DUMP = $(if $(subst n,,$(CONFIG_HAVE_CORE_DUMP)),n,y)
68
40293e58 69#########################################################
626df76a 70# cpu emulator library
fbe37ef3 71obj-y = exec.o translate-all.o cpu-exec.o
9cdc8df3
PB
72obj-y += tcg/tcg.o tcg/optimize.o
73obj-$(CONFIG_TCG_INTERPRETER) += tci.o
50348333 74obj-$(CONFIG_TCG_INTERPRETER) += disas/tci.o
9cdc8df3 75obj-y += fpu/softfloat.o
5e8861a0 76obj-y += target-$(TARGET_BASE_ARCH)/
76cad711 77obj-y += disas.o
9cdc8df3 78obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o
c4cfef5e 79obj-$(CONFIG_NO_KVM) += kvm-stub.o
5e8861a0 80
40293e58
FB
81#########################################################
82# Linux user emulator target
83
84ifdef CONFIG_LINUX_USER
85
c3109ba1 86QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user
1c872672 87
7fc5152c 88obj-y += linux-user/
8a090705 89obj-y += gdbstub.o thunk.o user-exec.o
40293e58 90
40293e58
FB
91endif #CONFIG_LINUX_USER
92
84778508
BS
93#########################################################
94# BSD user emulator target
95
96ifdef CONFIG_BSD_USER
97
a558ee17 98QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
84778508 99
7fc5152c 100obj-y += bsd-user/
8a090705 101obj-y += gdbstub.o user-exec.o
84778508 102
84778508
BS
103endif #CONFIG_BSD_USER
104
40293e58
FB
105#########################################################
106# System emulator target
76dfdd24 107ifdef CONFIG_SOFTMMU
fbe37ef3 108obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o
872536bf 109obj-y += qtest.o
c353f261 110obj-y += hw/
320ba5fe 111obj-$(CONFIG_FDT) += device_tree.o
fbe37ef3 112obj-$(CONFIG_KVM) += kvm-all.o
0cac1b66 113obj-y += memory.o savevm.o cputlb.o
fbe37ef3
PB
114obj-$(CONFIG_HAVE_GET_MEMORY_MAPPING) += memory_mapping.o
115obj-$(CONFIG_HAVE_CORE_DUMP) += dump.o
5f86146f
PB
116obj-$(CONFIG_NO_GET_MEMORY_MAPPING) += memory_mapping-stub.o
117obj-$(CONFIG_NO_CORE_DUMP) += dump-stub.o
f544a488 118LIBS+=$(libs_softmmu)
4fb240a4 119
3285cf4f 120# xen support
c353f261 121obj-$(CONFIG_XEN) += xen-all.o xen-mapcache.o
3285cf4f
AP
122obj-$(CONFIG_NO_XEN) += xen-stub.o
123
a541f297 124# Hardware support
3475187d 125ifeq ($(TARGET_ARCH), sparc64)
5e8861a0 126obj-y += hw/sparc64/
3475187d 127else
5e8861a0 128obj-y += hw/$(TARGET_BASE_ARCH)/
9637443f
JQ
129endif
130
ad96090a 131main.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
5824d651 132
4115852b 133GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h
0e8c9214 134
76dfdd24 135endif # CONFIG_SOFTMMU
00a67ba1 136
cbdd1999
PB
137# Workaround for http://gcc.gnu.org/PR55489, see configure.
138%/translate.o: QEMU_CFLAGS += $(TRANSLATE_OPT_CFLAGS)
139
99100dc3
PB
140nested-vars += obj-y
141
142# This resolves all nested paths, so it must come last
143include $(SRC_PATH)/Makefile.objs
144
145all-obj-y = $(obj-y)
00082344 146all-obj-y += $(addprefix ../, $(common-obj-y))
7fc5152c 147
f544a488
PB
148ifndef CONFIG_HAIKU
149LIBS+=-lm
150endif
151
0fa5491e
SW
152ifdef QEMU_PROGW
153# The linker builds a windows executable. Make also a console executable.
8a090705 154$(QEMU_PROGW): $(all-obj-y) ../libqemuutil.a ../libqemustub.a
0fa5491e
SW
155 $(call LINK,$^)
156$(QEMU_PROG): $(QEMU_PROGW)
157 $(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW) $(QEMU_PROG)," GEN $(TARGET_DIR)$(QEMU_PROG)")
158else
8a090705 159$(QEMU_PROG): $(all-obj-y) ../libqemuutil.a ../libqemustub.a
e03b41d4 160 $(call LINK,$^)
0fa5491e 161endif
16394485 162
4c3b5a48
BS
163gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh
164 $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES)," GEN $(TARGET_DIR)$@")
56aebc89 165
acd0a093 166hmp-commands.h: $(SRC_PATH)/hmp-commands.hx
4c3b5a48 167 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@")
2313086a 168
e3193601 169qmp-commands-old.h: $(SRC_PATH)/qmp-commands.hx
4c3b5a48 170 $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@")
2313086a 171
626df76a 172clean:
b54fa7dd
PM
173 rm -f *.a *~ $(PROGS)
174 rm -f $(shell find . -name '*.[od]')
e3193601 175 rm -f hmp-commands.h qmp-commands-old.h gdbstub-xml.c
6d8a764e 176ifdef CONFIG_TRACE_SYSTEMTAP
c276b17d
DB
177 rm -f *.stp
178endif
1e43adfc 179
5fafdf24 180install: all
9b14bb04 181ifneq ($(PROGS),)
52ba784d
HB
182 $(INSTALL) -m 755 $(PROGS) "$(DESTDIR)$(bindir)"
183ifneq ($(STRIP),)
184 $(STRIP) $(patsubst %,"$(DESTDIR)$(bindir)/%",$(PROGS))
185endif
9b14bb04 186endif
6d8a764e 187ifdef CONFIG_TRACE_SYSTEMTAP
6aae2a2e
EH
188 $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
189 $(INSTALL_DATA) $(QEMU_PROG).stp "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
c276b17d 190endif
626df76a 191
4115852b
PB
192GENERATED_HEADERS += config-target.h
193Makefile: $(GENERATED_HEADERS)