vl: always define no_frame
[qemu/ar7.git] / Makefile.target
blobb0be124d290a612d972eb087e71d7f2ca4fdd927
1 # -*- Mode: makefile -*-
3 include ../config-host.mak
4 include config-target.mak
5 include config-devices.mak
6 include $(SRC_PATH)/rules.mak
8 $(call set-vpath, $(SRC_PATH))
9 ifdef CONFIG_LINUX
10 QEMU_CFLAGS += -I../linux-headers
11 endif
12 QEMU_CFLAGS += -I.. -I$(SRC_PATH)/target-$(TARGET_BASE_ARCH) -DNEED_CPU_H
14 QEMU_CFLAGS+=-I$(SRC_PATH)/include
16 ifdef CONFIG_USER_ONLY
17 # user emulator name
18 QEMU_PROG=qemu-$(TARGET_ARCH2)
19 else
20 # system emulator name
21 ifneq (,$(findstring -mwindows,$(libs_softmmu)))
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
25 QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF)
26 endif
28 PROGS=$(QEMU_PROG)
29 ifdef QEMU_PROGW
30 PROGS+=$(QEMU_PROGW)
31 endif
32 STPFILES=
34 config-target.h: config-target.h-timestamp
35 config-target.h-timestamp: config-target.mak
37 ifdef CONFIG_TRACE_SYSTEMTAP
38 stap: $(QEMU_PROG).stp
40 ifdef CONFIG_USER_ONLY
41 TARGET_TYPE=user
42 else
43 TARGET_TYPE=system
44 endif
46 $(QEMU_PROG).stp: $(SRC_PATH)/trace-events
47         $(call quiet-command,$(TRACETOOL) \
48                 --format=stap \
49                 --backend=$(TRACE_BACKEND) \
50                 --binary=$(bindir)/$(QEMU_PROG) \
51                 --target-arch=$(TARGET_ARCH) \
52                 --target-type=$(TARGET_TYPE) \
53                 < $< > $@,"  GEN   $(TARGET_DIR)$(QEMU_PROG).stp")
54 else
55 stap:
56 endif
58 all: $(PROGS) stap
60 # Dummy command so that make thinks it has done something
61         @true
63 CONFIG_NO_PCI = $(if $(subst n,,$(CONFIG_PCI)),n,y)
64 CONFIG_NO_KVM = $(if $(subst n,,$(CONFIG_KVM)),n,y)
65 CONFIG_NO_XEN = $(if $(subst n,,$(CONFIG_XEN)),n,y)
67 #########################################################
68 # cpu emulator library
69 obj-y = exec.o translate-all.o cpu-exec.o
70 obj-y += tcg/tcg.o tcg/optimize.o
71 obj-$(CONFIG_TCG_INTERPRETER) += tci.o
72 obj-$(CONFIG_TCG_INTERPRETER) += disas/tci.o
73 obj-y += fpu/softfloat.o
74 obj-y += target-$(TARGET_BASE_ARCH)/
75 obj-y += disas.o
76 obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o
77 obj-$(CONFIG_NO_KVM) += kvm-stub.o
79 #########################################################
80 # Linux user emulator target
82 ifdef CONFIG_LINUX_USER
84 QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user
86 obj-y += linux-user/
87 obj-y += gdbstub.o thunk.o user-exec.o
89 endif #CONFIG_LINUX_USER
91 #########################################################
92 # BSD user emulator target
94 ifdef CONFIG_BSD_USER
96 QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
98 obj-y += bsd-user/
99 obj-y += gdbstub.o user-exec.o
101 endif #CONFIG_BSD_USER
103 #########################################################
104 # System emulator target
105 ifdef CONFIG_SOFTMMU
106 obj-y += arch_init.o cpus.o monitor.o gdbstub.o balloon.o ioport.o
107 obj-y += qtest.o
108 obj-y += hw/
109 obj-$(CONFIG_FDT) += device_tree.o
110 obj-$(CONFIG_KVM) += kvm-all.o
111 obj-y += memory.o savevm.o cputlb.o
112 obj-y += memory_mapping.o
113 obj-y += dump.o
114 LIBS+=$(libs_softmmu)
116 # xen support
117 obj-$(CONFIG_XEN) += xen-all.o xen-mapcache.o
118 obj-$(CONFIG_NO_XEN) += xen-stub.o
120 # Hardware support
121 ifeq ($(TARGET_ARCH), sparc64)
122 obj-y += hw/sparc64/
123 else
124 obj-y += hw/$(TARGET_BASE_ARCH)/
125 endif
127 main.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
129 GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h
131 endif # CONFIG_SOFTMMU
133 # Workaround for http://gcc.gnu.org/PR55489, see configure.
134 %/translate.o: QEMU_CFLAGS += $(TRANSLATE_OPT_CFLAGS)
136 nested-vars += obj-y
138 # This resolves all nested paths, so it must come last
139 include $(SRC_PATH)/Makefile.objs
141 all-obj-y = $(obj-y)
142 all-obj-y += $(addprefix ../, $(common-obj-y))
144 ifndef CONFIG_HAIKU
145 LIBS+=-lm
146 endif
148 ifdef QEMU_PROGW
149 # The linker builds a windows executable. Make also a console executable.
150 $(QEMU_PROGW): $(all-obj-y) ../libqemuutil.a ../libqemustub.a
151         $(call LINK,$^)
152 $(QEMU_PROG): $(QEMU_PROGW)
153         $(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW) $(QEMU_PROG),"  GEN   $(TARGET_DIR)$(QEMU_PROG)")
154 else
155 $(QEMU_PROG): $(all-obj-y) ../libqemuutil.a ../libqemustub.a
156         $(call LINK,$^)
157 endif
159 gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh
160         $(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES),"  GEN   $(TARGET_DIR)$@")
162 hmp-commands.h: $(SRC_PATH)/hmp-commands.hx
163         $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
165 qmp-commands-old.h: $(SRC_PATH)/qmp-commands.hx
166         $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
168 clean:
169         rm -f *.a *~ $(PROGS)
170         rm -f $(shell find . -name '*.[od]')
171         rm -f hmp-commands.h qmp-commands-old.h gdbstub-xml.c
172 ifdef CONFIG_TRACE_SYSTEMTAP
173         rm -f *.stp
174 endif
176 install: all
177 ifneq ($(PROGS),)
178         $(INSTALL) -m 755 $(PROGS) "$(DESTDIR)$(bindir)"
179 ifneq ($(STRIP),)
180         $(STRIP) $(patsubst %,"$(DESTDIR)$(bindir)/%",$(PROGS))
181 endif
182 endif
183 ifdef CONFIG_TRACE_SYSTEMTAP
184         $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
185         $(INSTALL_DATA) $(QEMU_PROG).stp "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
186 endif
188 GENERATED_HEADERS += config-target.h
189 Makefile: $(GENERATED_HEADERS)