Statistics
| Branch: | Revision:

root / Makefile.target @ 29002d9e

History | View | Annotate | Download (5.6 kB)

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