Statistics
| Branch: | Revision:

root / Makefile.target @ 1435ddb8

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