Statistics
| Branch: | Revision:

root / Makefile.target @ 8cfd0495

History | View | Annotate | Download (5.2 kB)

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