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