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