]>
Commit | Line | Data |
---|---|---|
562593aa AL |
1 | # -*- Mode: makefile -*- |
2 | ||
deed3ccf | 3 | include ../config-host.mak |
25be210f | 4 | include config-target.mak |
f3aa844b | 5 | include config-devices.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 | |
c1799a84 | 18 | QEMU_PROG=qemu-$(TARGET_NAME) |
40293e58 | 19 | else |
1e43adfc | 20 | # system emulator name |
c12915e6 | 21 | ifneq (,$(findstring -mwindows,$(libs_softmmu))) |
0fa5491e | 22 | # Terminate program name with a 'w' because the linker builds a windows executable. |
c1799a84 | 23 | QEMU_PROGW=qemu-system-$(TARGET_NAME)w$(EXESUF) |
0fa5491e | 24 | endif # windows executable |
c1799a84 | 25 | QEMU_PROG=qemu-system-$(TARGET_NAME)$(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 | |
91880d96 JQ |
34 | config-target.h: config-target.h-timestamp |
35 | config-target.h-timestamp: config-target.mak | |
36 | ||
6d8a764e | 37 | ifdef CONFIG_TRACE_SYSTEMTAP |
c14518e9 | 38 | stap: $(QEMU_PROG).stp-installed $(QEMU_PROG).stp |
c276b17d DB |
39 | |
40 | ifdef CONFIG_USER_ONLY | |
41 | TARGET_TYPE=user | |
42 | else | |
43 | TARGET_TYPE=system | |
44 | endif | |
45 | ||
c14518e9 | 46 | $(QEMU_PROG).stp-installed: $(SRC_PATH)/trace-events |
c0424934 | 47 | $(call quiet-command,$(TRACETOOL) \ |
650ab98d LV |
48 | --format=stap \ |
49 | --backend=$(TRACE_BACKEND) \ | |
50 | --binary=$(bindir)/$(QEMU_PROG) \ | |
b9a7b74f | 51 | --target-name=$(TARGET_NAME) \ |
650ab98d | 52 | --target-type=$(TARGET_TYPE) \ |
c14518e9 AL |
53 | < $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG).stp-installed") |
54 | ||
55 | $(QEMU_PROG).stp: $(SRC_PATH)/trace-events | |
56 | $(call quiet-command,$(TRACETOOL) \ | |
57 | --format=stap \ | |
58 | --backend=$(TRACE_BACKEND) \ | |
59 | --binary=$(realpath .)/$(QEMU_PROG) \ | |
b9a7b74f | 60 | --target-name=$(TARGET_NAME) \ |
c14518e9 | 61 | --target-type=$(TARGET_TYPE) \ |
aaf821fd | 62 | < $< > $@," GEN $(TARGET_DIR)$(QEMU_PROG).stp") |
c14518e9 | 63 | |
c276b17d DB |
64 | else |
65 | stap: | |
66 | endif | |
67 | ||
68 | all: $(PROGS) stap | |
91880d96 | 69 | |
c2fb2637 PB |
70 | # Dummy command so that make thinks it has done something |
71 | @true | |
626df76a | 72 | |
40293e58 | 73 | ######################################################### |
626df76a | 74 | # cpu emulator library |
fbe37ef3 | 75 | obj-y = exec.o translate-all.o cpu-exec.o |
9cdc8df3 PB |
76 | obj-y += tcg/tcg.o tcg/optimize.o |
77 | obj-$(CONFIG_TCG_INTERPRETER) += tci.o | |
50348333 | 78 | obj-$(CONFIG_TCG_INTERPRETER) += disas/tci.o |
9cdc8df3 | 79 | obj-y += fpu/softfloat.o |
5e8861a0 | 80 | obj-y += target-$(TARGET_BASE_ARCH)/ |
76cad711 | 81 | obj-y += disas.o |
b77abd95 | 82 | obj-$(call notempty,$(TARGET_XML_FILES)) += gdbstub-xml.o |
cf01ba9e | 83 | obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o |
5e8861a0 | 84 | |
40293e58 FB |
85 | ######################################################### |
86 | # Linux user emulator target | |
87 | ||
88 | ifdef CONFIG_LINUX_USER | |
89 | ||
c3109ba1 | 90 | QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user |
1c872672 | 91 | |
7fc5152c | 92 | obj-y += linux-user/ |
8a090705 | 93 | obj-y += gdbstub.o thunk.o user-exec.o |
40293e58 | 94 | |
40293e58 FB |
95 | endif #CONFIG_LINUX_USER |
96 | ||
84778508 BS |
97 | ######################################################### |
98 | # BSD user emulator target | |
99 | ||
100 | ifdef CONFIG_BSD_USER | |
101 | ||
b9a7b74f | 102 | QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ABI_DIR) |
84778508 | 103 | |
7fc5152c | 104 | obj-y += bsd-user/ |
8a090705 | 105 | obj-y += gdbstub.o user-exec.o |
84778508 | 106 | |
84778508 BS |
107 | endif #CONFIG_BSD_USER |
108 | ||
40293e58 FB |
109 | ######################################################### |
110 | # System emulator target | |
76dfdd24 | 111 | ifdef CONFIG_SOFTMMU |
fbe37ef3 | 112 | obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o |
872536bf | 113 | obj-y += qtest.o |
c353f261 | 114 | obj-y += hw/ |
320ba5fe | 115 | obj-$(CONFIG_FDT) += device_tree.o |
fbe37ef3 | 116 | obj-$(CONFIG_KVM) += kvm-all.o |
0cac1b66 | 117 | obj-y += memory.o savevm.o cputlb.o |
c22d8e04 | 118 | obj-y += memory_mapping.o |
2a78636b | 119 | obj-y += dump.o |
f544a488 | 120 | LIBS+=$(libs_softmmu) |
4fb240a4 | 121 | |
3285cf4f | 122 | # xen support |
c353f261 | 123 | obj-$(CONFIG_XEN) += xen-all.o xen-mapcache.o |
cf01ba9e | 124 | obj-$(call lnot,$(CONFIG_XEN)) += xen-stub.o |
3285cf4f | 125 | |
a541f297 | 126 | # Hardware support |
b9a7b74f | 127 | ifeq ($(TARGET_NAME), 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) | |
00082344 | 148 | all-obj-y += $(addprefix ../, $(common-obj-y)) |
7fc5152c | 149 | |
f544a488 PB |
150 | ifndef CONFIG_HAIKU |
151 | LIBS+=-lm | |
152 | endif | |
153 | ||
0fa5491e SW |
154 | ifdef QEMU_PROGW |
155 | # The linker builds a windows executable. Make also a console executable. | |
8a090705 | 156 | $(QEMU_PROGW): $(all-obj-y) ../libqemuutil.a ../libqemustub.a |
0fa5491e SW |
157 | $(call LINK,$^) |
158 | $(QEMU_PROG): $(QEMU_PROGW) | |
159 | $(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW) $(QEMU_PROG)," GEN $(TARGET_DIR)$(QEMU_PROG)") | |
160 | else | |
8a090705 | 161 | $(QEMU_PROG): $(all-obj-y) ../libqemuutil.a ../libqemustub.a |
e03b41d4 | 162 | $(call LINK,$^) |
0fa5491e | 163 | endif |
16394485 | 164 | |
4c3b5a48 BS |
165 | gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh |
166 | $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES)," GEN $(TARGET_DIR)$@") | |
56aebc89 | 167 | |
acd0a093 | 168 | hmp-commands.h: $(SRC_PATH)/hmp-commands.hx |
4c3b5a48 | 169 | $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@") |
2313086a | 170 | |
e3193601 | 171 | qmp-commands-old.h: $(SRC_PATH)/qmp-commands.hx |
4c3b5a48 | 172 | $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $(TARGET_DIR)$@") |
2313086a | 173 | |
626df76a | 174 | clean: |
b54fa7dd PM |
175 | rm -f *.a *~ $(PROGS) |
176 | rm -f $(shell find . -name '*.[od]') | |
e3193601 | 177 | rm -f hmp-commands.h qmp-commands-old.h gdbstub-xml.c |
6d8a764e | 178 | ifdef CONFIG_TRACE_SYSTEMTAP |
c276b17d DB |
179 | rm -f *.stp |
180 | endif | |
1e43adfc | 181 | |
5fafdf24 | 182 | install: all |
9b14bb04 | 183 | ifneq ($(PROGS),) |
52ba784d HB |
184 | $(INSTALL) -m 755 $(PROGS) "$(DESTDIR)$(bindir)" |
185 | ifneq ($(STRIP),) | |
186 | $(STRIP) $(patsubst %,"$(DESTDIR)$(bindir)/%",$(PROGS)) | |
187 | endif | |
9b14bb04 | 188 | endif |
6d8a764e | 189 | ifdef CONFIG_TRACE_SYSTEMTAP |
6aae2a2e | 190 | $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset" |
c14518e9 | 191 | $(INSTALL_DATA) $(QEMU_PROG).stp-installed "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset/$(QEMU_PROG).stp" |
c276b17d | 192 | endif |
626df76a | 193 | |
4115852b PB |
194 | GENERATED_HEADERS += config-target.h |
195 | Makefile: $(GENERATED_HEADERS) |