Statistics
| Branch: | Revision:

root / Makefile @ c09015dd

History | View | Annotate | Download (16 kB)

1 0cb3fb1e pbrook
# Makefile for QEMU.
2 0cb3fb1e pbrook
3 519e1693 Stefan Weil
# Always point to the root of the build tree (needs GNU make).
4 519e1693 Stefan Weil
BUILD_DIR=$(CURDIR)
5 388d4758 Lluís Vilanova
6 df2943ba Michael S. Tsirkin
GENERATED_HEADERS = config-host.h trace.h qemu-options.def
7 b3d08c02 Daniel P. Berrange
ifeq ($(TRACE_BACKEND),dtrace)
8 b3d08c02 Daniel P. Berrange
GENERATED_HEADERS += trace-dtrace.h
9 b3d08c02 Daniel P. Berrange
endif
10 e3193601 Anthony Liguori
GENERATED_HEADERS += qmp-commands.h qapi-types.h qapi-visit.h
11 611b7273 Michael S. Tsirkin
GENERATED_SOURCES += qmp-marshal.c qapi-types.c qapi-visit.c
12 f527c579 Juan Quintela
13 55d7e8f6 aurel32
ifneq ($(wildcard config-host.mak),)
14 1ad2134f Paul Brook
# Put the all: rule here so that config-host.mak can contain dependencies.
15 1ad2134f Paul Brook
all: build-all
16 ad064840 pbrook
include config-host.mak
17 17759187 aliguori
include $(SRC_PATH)/rules.mak
18 59bc10ee Paolo Bonzini
config-host.mak: $(SRC_PATH)/configure
19 e5efe7f5 Juan Quintela
	@echo $@ is out-of-date, running configure
20 e5efe7f5 Juan Quintela
	@sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh
21 55d7e8f6 aurel32
else
22 55d7e8f6 aurel32
config-host.mak:
23 55d7e8f6 aurel32
	@echo "Please call configure before running make!"
24 55d7e8f6 aurel32
	@exit 1
25 55d7e8f6 aurel32
endif
26 766a487a bellard
27 d9ace8b3 Juan Quintela
# Don't try to regenerate Makefile or configure
28 d9ace8b3 Juan Quintela
# We don't generate any of them
29 d9ace8b3 Juan Quintela
Makefile: ;
30 d9ace8b3 Juan Quintela
configure: ;
31 d9ace8b3 Juan Quintela
32 818220f5 aliguori
.PHONY: all clean cscope distclean dvi html info install install-doc \
33 20cc9997 Stefan Weil
	pdf recurse-all speed tar tarbin test build-all
34 0cb3fb1e pbrook
35 076d2471 Paolo Bonzini
$(call set-vpath, $(SRC_PATH):$(SRC_PATH)/hw)
36 8c462f8f pbrook
37 3e2e0e6b Juan Quintela
LIBS+=-lz $(LIBS_TOOLS)
38 67c0f08d Juan Quintela
39 cc8ae6de pbrook
ifdef BUILD_DOCS
40 b40292e7 Jan Kiszka
DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt
41 a2d8f1be M. Mohan Kumar
DOCS+=fsdev/virtfs-proxy-helper.1
42 cc8ae6de pbrook
else
43 cc8ae6de pbrook
DOCS=
44 cc8ae6de pbrook
endif
45 aa05ae6f bellard
46 388d4758 Lluís Vilanova
SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory) BUILD_DIR=$(BUILD_DIR)
47 1f3d3c8f Juan Quintela
SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
48 bd9141bb Paul Brook
SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %/config-devices.mak.d, $(TARGET_DIRS))
49 1f3d3c8f Juan Quintela
50 1f3d3c8f Juan Quintela
config-all-devices.mak: $(SUBDIR_DEVICES_MAK)
51 01d86a85 Stefan Weil
	$(call quiet-command,cat $(SUBDIR_DEVICES_MAK) | grep =y | sort -u > $@,"  GEN   $@")
52 1f3d3c8f Juan Quintela
53 bd9141bb Paul Brook
-include $(SUBDIR_DEVICES_MAK_DEP)
54 bd9141bb Paul Brook
55 a992fe3d Paul Brook
%/config-devices.mak: default-configs/%.mak
56 4c3b5a48 Blue Swirl
	$(call quiet-command,$(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $@ $<, "  GEN   $@")
57 012f0879 Stefan Weil
	@if test -f $@; then \
58 904fe1fb Blue Swirl
	  if cmp -s $@.old $@; then \
59 bd9141bb Paul Brook
	    mv $@.tmp $@; \
60 bd9141bb Paul Brook
	    cp -p $@ $@.old; \
61 012f0879 Stefan Weil
	  else \
62 012f0879 Stefan Weil
	    if test -f $@.old; then \
63 012f0879 Stefan Weil
	      echo "WARNING: $@ (user modified) out of date.";\
64 012f0879 Stefan Weil
	    else \
65 012f0879 Stefan Weil
	      echo "WARNING: $@ out of date.";\
66 012f0879 Stefan Weil
	    fi; \
67 012f0879 Stefan Weil
	    echo "Run \"make defconfig\" to regenerate."; \
68 012f0879 Stefan Weil
	    rm $@.tmp; \
69 012f0879 Stefan Weil
	  fi; \
70 a992fe3d Paul Brook
	 else \
71 012f0879 Stefan Weil
	  mv $@.tmp $@; \
72 012f0879 Stefan Weil
	  cp -p $@ $@.old; \
73 a992fe3d Paul Brook
	 fi
74 a992fe3d Paul Brook
75 a992fe3d Paul Brook
defconfig:
76 a992fe3d Paul Brook
	rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
77 a992fe3d Paul Brook
78 1f3d3c8f Juan Quintela
-include config-all-devices.mak
79 1215c6e7 Juan Quintela
80 fffbeb75 Gerd Hoffmann
build-all: $(DOCS) $(TOOLS) $(CHECKS) recurse-all
81 b9dea4fb pbrook
82 1215c6e7 Juan Quintela
config-host.h: config-host.h-timestamp
83 1215c6e7 Juan Quintela
config-host.h-timestamp: config-host.mak
84 e14056ad Blue Swirl
qemu-options.def: $(SRC_PATH)/qemu-options.hx
85 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
86 1215c6e7 Juan Quintela
87 cec7d0b6 pbrook
SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
88 cec7d0b6 pbrook
89 f527c579 Juan Quintela
subdir-%: $(GENERATED_HEADERS)
90 0087375e Paul Brook
	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
91 4aa42531 pbrook
92 b88bc808 Stefan Weil
ifneq ($(wildcard config-host.mak),)
93 0e8c9214 Andreas Färber
include $(SRC_PATH)/Makefile.objs
94 b88bc808 Stefan Weil
endif
95 0e8c9214 Andreas Färber
96 0e8c9214 Andreas Färber
$(common-obj-y): $(GENERATED_HEADERS)
97 41a74826 Anthony Liguori
subdir-libcacard: $(oslib-obj-y) $(trace-obj-y) qemu-timer-common.o
98 6774e44a Paolo Bonzini
99 91f16900 Andreas Färber
$(filter %-softmmu,$(SUBDIR_RULES)): $(trace-obj-y) $(common-obj-y) subdir-libdis
100 c05ac895 Paul Brook
101 91f16900 Andreas Färber
$(filter %-user,$(SUBDIR_RULES)): $(GENERATED_HEADERS) $(trace-obj-y) subdir-libdis-user subdir-libuser
102 add16157 Blue Swirl
103 c05ac895 Paul Brook
ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
104 c05ac895 Paul Brook
romsubdir-%:
105 c05ac895 Paul Brook
	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/",)
106 c05ac895 Paul Brook
107 c05ac895 Paul Brook
ALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS))
108 c05ac895 Paul Brook
109 c05ac895 Paul Brook
recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
110 83f64091 bellard
111 98b068a9 Juan Quintela
audio/audio.o audio/fmodaudio.o: QEMU_CFLAGS += $(FMOD_CFLAGS)
112 0e22fd2f Juan Quintela
113 a558ee17 Juan Quintela
QEMU_CFLAGS+=$(CURL_CFLAGS)
114 769ce76d Alexander Graf
115 e18df141 Anthony Liguori
QEMU_CFLAGS+=$(GLIB_CFLAGS)
116 e18df141 Anthony Liguori
117 3e230dd2 Corentin Chary
ui/cocoa.o: ui/cocoa.m
118 4fb240a4 bellard
119 3e230dd2 Corentin Chary
ui/sdl.o audio/sdlaudio.o ui/sdl_zoom.o baum.o: QEMU_CFLAGS += $(SDL_CFLAGS)
120 0483755a aliguori
121 3e230dd2 Corentin Chary
ui/vnc.o: QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
122 fb599c9a balrog
123 a558ee17 Juan Quintela
bt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS)
124 4fb240a4 bellard
125 7948a665 Blue Swirl
version.o: $(SRC_PATH)/version.rc config-host.h
126 9fe6de94 Blue Swirl
	$(call quiet-command,$(WINDRES) -I. -o $@ $<,"  RC    $(TARGET_DIR)$@")
127 9fe6de94 Blue Swirl
128 9fe6de94 Blue Swirl
version-obj-$(CONFIG_WIN32) += version.o
129 4fb240a4 bellard
######################################################################
130 44dc0ca3 Alon Levy
# Support building shared library libcacard
131 44dc0ca3 Alon Levy
132 44dc0ca3 Alon Levy
.PHONY: libcacard.la install-libcacard
133 44dc0ca3 Alon Levy
ifeq ($(LIBTOOL),)
134 44dc0ca3 Alon Levy
libcacard.la:
135 44dc0ca3 Alon Levy
	@echo "libtool is missing, please install and rerun configure"; exit 1
136 44dc0ca3 Alon Levy
137 44dc0ca3 Alon Levy
install-libcacard:
138 44dc0ca3 Alon Levy
	@echo "libtool is missing, please install and rerun configure"; exit 1
139 44dc0ca3 Alon Levy
else
140 92f562ec Anthony Liguori
libcacard.la: $(GENERATED_HEADERS) $(oslib-obj-y) qemu-timer-common.o $(addsuffix .lo, $(basename $(trace-obj-y)))
141 44dc0ca3 Alon Levy
	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" libcacard.la,)
142 44dc0ca3 Alon Levy
143 44dc0ca3 Alon Levy
install-libcacard: libcacard.la
144 44dc0ca3 Alon Levy
	$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" install-libcacard,)
145 44dc0ca3 Alon Levy
endif
146 44dc0ca3 Alon Levy
######################################################################
147 4fb240a4 bellard
148 3c089e15 Juan Quintela
qemu-img.o: qemu-img-cmds.h
149 48ff7a62 Michael Roth
qemu-img.o qemu-tool.o qemu-nbd.o qemu-io.o cmd.o qemu-ga.o: $(GENERATED_HEADERS)
150 153859be Stuart Brady
151 cbcfa041 Paolo Bonzini
tools-obj-y = $(oslib-obj-y) $(trace-obj-y) qemu-tool.o qemu-timer.o \
152 cbcfa041 Paolo Bonzini
	qemu-timer-common.o main-loop.o notify.o iohandler.o cutils.o async.o
153 cbcfa041 Paolo Bonzini
tools-obj-$(CONFIG_POSIX) += compatfd.o
154 0e8c9214 Andreas Färber
155 4ab328d6 Paolo Bonzini
qemu-img$(EXESUF): qemu-img.o $(tools-obj-y) $(block-obj-y)
156 4ab328d6 Paolo Bonzini
qemu-nbd$(EXESUF): qemu-nbd.o $(tools-obj-y) $(block-obj-y)
157 4ab328d6 Paolo Bonzini
qemu-io$(EXESUF): qemu-io.o cmd.o $(tools-obj-y) $(block-obj-y)
158 0a8e1acd aliguori
159 ea75fc4e M. Mohan Kumar
fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o oslib-posix.o $(trace-obj-y)
160 17bff52b M. Mohan Kumar
fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
161 17bff52b M. Mohan Kumar
162 153859be Stuart Brady
qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
163 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $@")
164 153859be Stuart Brady
165 aa7ee42e Stefan Hajnoczi
check-qint.o check-qstring.o check-qdict.o check-qlist.o check-qfloat.o check-qjson.o test-coroutine.o: $(GENERATED_HEADERS)
166 4091da4b Jan Kiszka
167 4ab328d6 Paolo Bonzini
check-qint: check-qint.o qint.o $(tools-obj-y)
168 4ab328d6 Paolo Bonzini
check-qstring: check-qstring.o qstring.o $(tools-obj-y)
169 4ab328d6 Paolo Bonzini
check-qdict: check-qdict.o qdict.o qfloat.o qint.o qstring.o qbool.o qlist.o $(tools-obj-y)
170 4ab328d6 Paolo Bonzini
check-qlist: check-qlist.o qlist.o qint.o $(tools-obj-y)
171 4ab328d6 Paolo Bonzini
check-qfloat: check-qfloat.o qfloat.o $(tools-obj-y)
172 4ab328d6 Paolo Bonzini
check-qjson: check-qjson.o $(qobject-obj-y) $(tools-obj-y)
173 4ab328d6 Paolo Bonzini
test-coroutine: test-coroutine.o qemu-timer-common.o async.o $(coroutine-obj-y) $(tools-obj-y)
174 33837ba6 Luiz Capitulino
175 640e5404 Michael Roth
$(qapi-obj-y): $(GENERATED_HEADERS)
176 9b129408 Michael Roth
qapi-dir := $(BUILD_DIR)/qapi-generated
177 81244ff5 Luiz Capitulino
test-qmp-input-visitor.o test-qmp-output-visitor.o test-qmp-commands.o qemu-ga$(EXESUF): QEMU_CFLAGS += -I $(qapi-dir)
178 957f1f99 Michael Roth
qemu-ga$(EXESUF): LIBS = $(LIBS_QGA)
179 640e5404 Michael Roth
180 19bf7c87 Avi Kivity
gen-out-type = $(subst .,-,$(suffix $@))
181 8d3bc517 Avi Kivity
182 599825c5 Michael S. Tsirkin
$(qapi-dir)/test-qapi-types.c $(qapi-dir)/test-qapi-types.h :\
183 599825c5 Michael S. Tsirkin
$(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-types.py
184 8d3bc517 Avi Kivity
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o "$(qapi-dir)" -p "test-" < $<, "  GEN   $@")
185 599825c5 Michael S. Tsirkin
$(qapi-dir)/test-qapi-visit.c $(qapi-dir)/test-qapi-visit.h :\
186 599825c5 Michael S. Tsirkin
$(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-visit.py
187 8d3bc517 Avi Kivity
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o "$(qapi-dir)" -p "test-" < $<, "  GEN   $@")
188 599825c5 Michael S. Tsirkin
$(qapi-dir)/test-qmp-commands.h $(qapi-dir)/test-qmp-marshal.c :\
189 599825c5 Michael S. Tsirkin
$(SRC_PATH)/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-commands.py
190 8d3bc517 Avi Kivity
	    $(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -o "$(qapi-dir)" -p "test-" < $<, "  GEN   $@")
191 640e5404 Michael Roth
192 599825c5 Michael S. Tsirkin
$(qapi-dir)/qga-qapi-types.c $(qapi-dir)/qga-qapi-types.h :\
193 599825c5 Michael S. Tsirkin
$(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-types.py
194 8d3bc517 Avi Kivity
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o "$(qapi-dir)" -p "qga-" < $<, "  GEN   $@")
195 599825c5 Michael S. Tsirkin
$(qapi-dir)/qga-qapi-visit.c $(qapi-dir)/qga-qapi-visit.h :\
196 599825c5 Michael S. Tsirkin
$(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-visit.py
197 8d3bc517 Avi Kivity
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o "$(qapi-dir)" -p "qga-" < $<, "  GEN   $@")
198 599825c5 Michael S. Tsirkin
$(qapi-dir)/qga-qmp-commands.h $(qapi-dir)/qga-qmp-marshal.c :\
199 599825c5 Michael S. Tsirkin
$(SRC_PATH)/qapi-schema-guest.json $(SRC_PATH)/scripts/qapi-commands.py
200 8d3bc517 Avi Kivity
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -o "$(qapi-dir)" -p "qga-" < $<, "  GEN   $@")
201 e3d4d252 Michael Roth
202 599825c5 Michael S. Tsirkin
qapi-types.c qapi-types.h :\
203 599825c5 Michael S. Tsirkin
$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py
204 8d3bc517 Avi Kivity
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-types.py $(gen-out-type) -o "." < $<, "  GEN   $@")
205 599825c5 Michael S. Tsirkin
qapi-visit.c qapi-visit.h :\
206 599825c5 Michael S. Tsirkin
$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-visit.py
207 8d3bc517 Avi Kivity
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-visit.py $(gen-out-type) -o "."  < $<, "  GEN   $@")
208 599825c5 Michael S. Tsirkin
qmp-commands.h qmp-marshal.c :\
209 599825c5 Michael S. Tsirkin
$(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py
210 8d3bc517 Avi Kivity
	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi-commands.py $(gen-out-type) -m -o "." < $<, "  GEN   $@")
211 e3193601 Anthony Liguori
212 f294f82a Luiz Capitulino
test-qmp-output-visitor.o: $(addprefix $(qapi-dir)/, test-qapi-types.c test-qapi-types.h test-qapi-visit.c test-qapi-visit.h) $(qapi-obj-y)
213 f294f82a Luiz Capitulino
test-qmp-output-visitor: test-qmp-output-visitor.o $(qobject-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o
214 f294f82a Luiz Capitulino
215 d88f5fd1 Luiz Capitulino
test-qmp-input-visitor.o: $(addprefix $(qapi-dir)/, test-qapi-types.c test-qapi-types.h test-qapi-visit.c test-qapi-visit.h) $(qapi-obj-y)
216 d88f5fd1 Luiz Capitulino
test-qmp-input-visitor: test-qmp-input-visitor.o $(qobject-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o
217 d88f5fd1 Luiz Capitulino
218 69ed8366 Michael Roth
test-qmp-commands.o: $(addprefix $(qapi-dir)/, test-qapi-types.c test-qapi-types.h test-qapi-visit.c test-qapi-visit.h test-qmp-marshal.c test-qmp-commands.h) $(qapi-obj-y)
219 4ab328d6 Paolo Bonzini
test-qmp-commands: test-qmp-commands.o $(qobject-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qapi-dir)/test-qapi-visit.o $(qapi-dir)/test-qapi-types.o $(qapi-dir)/test-qmp-marshal.o module.o
220 69ed8366 Michael Roth
221 1b14254b Michael S. Tsirkin
QGALIB_OBJ=$(addprefix $(qapi-dir)/, qga-qapi-types.o qga-qapi-visit.o qga-qmp-marshal.o)
222 1b14254b Michael S. Tsirkin
QGALIB_GEN=$(addprefix $(qapi-dir)/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
223 1b14254b Michael S. Tsirkin
$(QGALIB_OBJ): $(QGALIB_GEN) $(GENERATED_HEADERS)
224 1b14254b Michael S. Tsirkin
$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) $(GENERATED_HEADERS)
225 957f1f99 Michael Roth
226 1b14254b Michael S. Tsirkin
qemu-ga$(EXESUF): qemu-ga.o $(qga-obj-y) $(qapi-obj-y) $(tools-obj-y) $(qobject-obj-y) $(version-obj-y) $(QGALIB_OBJ)
227 48ff7a62 Michael Roth
228 111a38b0 Robert Relyea
QEMULIBS=libhw32 libhw64 libuser libdis libdis-user
229 111a38b0 Robert Relyea
230 31e31b8a bellard
clean:
231 2d80ae89 bellard
# avoid old build problems by removing potentially incorrect old files
232 25be210f Juan Quintela
	rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
233 df2943ba Michael S. Tsirkin
	rm -f qemu-options.def
234 fffbeb75 Gerd Hoffmann
	rm -f *.o *.d *.a *.lo $(TOOLS) $(CHECKS) qemu-ga TAGS cscope.* *.pod *~ */*~
235 44dc0ca3 Alon Levy
	rm -Rf .libs
236 13a286d5 Michael Roth
	rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d block/*.o block/*.d net/*.o net/*.d fsdev/*.o fsdev/*.d ui/*.o ui/*.d qapi/*.o qapi/*.d qga/*.o qga/*.d
237 07b44ce9 Blue Swirl
	rm -f qemu-img-cmds.h
238 edb47ec4 Lluís
	rm -f trace/*.o trace/*.d
239 d7489b72 Blue Swirl
	rm -f trace.c trace.h trace.c-timestamp trace.h-timestamp
240 b3d08c02 Daniel P. Berrange
	rm -f trace-dtrace.dtrace trace-dtrace.dtrace-timestamp
241 b3d08c02 Daniel P. Berrange
	rm -f trace-dtrace.h trace-dtrace.h-timestamp
242 611b7273 Michael S. Tsirkin
	rm -f $(GENERATED_SOURCES)
243 640e5404 Michael Roth
	rm -rf $(qapi-dir)
244 c09015dd Anthony Liguori
	$(MAKE) -C tests/tcg clean
245 111a38b0 Robert Relyea
	for d in $(ALL_SUBDIRS) $(QEMULIBS) libcacard; do \
246 fc8e320e Magnus Damm
	if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
247 df2943ba Michael S. Tsirkin
	rm -f $$d/qemu-options.def; \
248 626df76a bellard
        done
249 31e31b8a bellard
250 7d13299d bellard
distclean: clean
251 fc8e320e Magnus Damm
	rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
252 a992fe3d Paul Brook
	rm -f config-all-devices.mak
253 fc8e320e Magnus Damm
	rm -f roms/seabios/config.mak roms/vgabios/config.mak
254 7a734b8f Brad Hards
	rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps qemu-doc.dvi
255 7a734b8f Brad Hards
	rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys
256 7a734b8f Brad Hards
	rm -f qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp
257 7a734b8f Brad Hards
	rm -f qemu-doc.vr
258 793553ac Alexandre Raymond
	rm -f config.log
259 e1a068b2 Hidetoshi Seto
	rm -f qemu-tech.info qemu-tech.aux qemu-tech.cp qemu-tech.dvi qemu-tech.fn qemu-tech.info qemu-tech.ky qemu-tech.log qemu-tech.pdf qemu-tech.pg qemu-tech.toc qemu-tech.tp qemu-tech.vr
260 111a38b0 Robert Relyea
	for d in $(TARGET_DIRS) $(QEMULIBS); do \
261 bc1b050d bellard
	rm -rf $$d || exit 1 ; \
262 76bc6838 bellard
        done
263 7d13299d bellard
264 fed4a9ad bellard
KEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
265 fed4a9ad bellard
ar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
266 fed4a9ad bellard
common  de-ch  es     fo  fr-ca  hu     ja  mk  nl-be      pt  sl     tr
267 fed4a9ad bellard
268 77755340 ths
ifdef INSTALL_BLOBS
269 6329866f Paolo Bonzini
BLOBS=bios.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
270 7943a2fa Gerd Hoffmann
vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin \
271 3b3d448e Gerd Hoffmann
ppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc \
272 5ee8ad71 Alex Williamson
pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
273 5ee8ad71 Alex Williamson
pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
274 00914b7d Michal Simek
bamboo.dtb petalogix-s3adsp1800.dtb petalogix-ml605.dtb \
275 fbd659b7 Alexander Graf
mpc8544ds.dtb \
276 fe270d04 Alexander Graf
multiboot.bin linuxboot.bin \
277 39ac8455 David Gibson
s390-zipl.rom \
278 753d11f2 Richard Henderson
spapr-rtas.bin slof.bin \
279 753d11f2 Richard Henderson
palcode-clipper
280 77755340 ths
else
281 77755340 ths
BLOBS=
282 77755340 ths
endif
283 77755340 ths
284 38954dca pbrook
install-doc: $(DOCS)
285 58f8aead aliguori
	$(INSTALL_DIR) "$(DESTDIR)$(docdir)"
286 58f8aead aliguori
	$(INSTALL_DATA) qemu-doc.html  qemu-tech.html "$(DESTDIR)$(docdir)"
287 96d409eb Juan Quintela
ifdef CONFIG_POSIX
288 58f8aead aliguori
	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
289 58f8aead aliguori
	$(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
290 58f8aead aliguori
	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
291 58f8aead aliguori
	$(INSTALL_DATA) qemu-nbd.8 "$(DESTDIR)$(mandir)/man8"
292 38954dca pbrook
endif
293 a2d8f1be M. Mohan Kumar
ifdef CONFIG_VIRTFS
294 a2d8f1be M. Mohan Kumar
	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
295 a2d8f1be M. Mohan Kumar
	$(INSTALL_DATA) fsdev/virtfs-proxy-helper.1 "$(DESTDIR)$(mandir)/man1"
296 a2d8f1be M. Mohan Kumar
endif
297 b5ec5ce0 john cooper
install-sysconfig:
298 990caaf1 Andre Przywara
	$(INSTALL_DIR) "$(DESTDIR)$(sysconfdir)/qemu"
299 990caaf1 Andre Przywara
	$(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(sysconfdir)/qemu"
300 b5ec5ce0 john cooper
301 b5ec5ce0 john cooper
install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig
302 58f8aead aliguori
	$(INSTALL_DIR) "$(DESTDIR)$(bindir)"
303 932a79df ths
ifneq ($(TOOLS),)
304 58f8aead aliguori
	$(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
305 932a79df ths
endif
306 77755340 ths
ifneq ($(BLOBS),)
307 58f8aead aliguori
	$(INSTALL_DIR) "$(DESTDIR)$(datadir)"
308 77755340 ths
	set -e; for x in $(BLOBS); do \
309 58f8aead aliguori
		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
310 ad064840 pbrook
	done
311 77755340 ths
endif
312 58f8aead aliguori
	$(INSTALL_DIR) "$(DESTDIR)$(datadir)/keymaps"
313 18be8d77 blueswir1
	set -e; for x in $(KEYMAPS); do \
314 79fd42aa Anthony Liguori
		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
315 ad064840 pbrook
	done
316 626df76a bellard
	for d in $(TARGET_DIRS); do \
317 7d3505c5 bellard
	$(MAKE) -C $$d $@ || exit 1 ; \
318 626df76a bellard
        done
319 612384d7 bellard
320 367e86e8 bellard
# various test targets
321 9b0b8203 bellard
test speed: all
322 c09015dd Anthony Liguori
	$(MAKE) -C tests/tcg $@
323 31e31b8a bellard
324 ea7f7804 Gerd Hoffmann
.PHONY: check
325 ea7f7804 Gerd Hoffmann
check: $(patsubst %,run-check-%,$(CHECKS))
326 ea7f7804 Gerd Hoffmann
327 ea7f7804 Gerd Hoffmann
run-check-%: %
328 ea7f7804 Gerd Hoffmann
	./$<
329 ea7f7804 Gerd Hoffmann
330 21d4e8e3 Alexandre Bique
.PHONY: TAGS
331 5fafdf24 ths
TAGS:
332 21d4e8e3 Alexandre Bique
	find "$(SRC_PATH)" -name '*.[hc]' -print0 | xargs -0 etags
333 31e31b8a bellard
334 6688bc6d bellard
cscope:
335 6688bc6d bellard
	rm -f ./cscope.*
336 45b75ae4 Alexandre Raymond
	find "$(SRC_PATH)" -name "*.[chsS]" -print | sed 's,^\./,,' > ./cscope.files
337 6688bc6d bellard
	cscope -b
338 6688bc6d bellard
339 3ef693a0 bellard
# documentation
340 01668d98 Stefan Weil
MAKEINFO=makeinfo
341 01668d98 Stefan Weil
MAKEINFOFLAGS=--no-headers --no-split --number-sections
342 20cc9997 Stefan Weil
TEXIFLAG=$(if $(V),,--quiet)
343 20cc9997 Stefan Weil
%.dvi: %.texi
344 20cc9997 Stefan Weil
	$(call quiet-command,texi2dvi $(TEXIFLAG) -I . $<,"  GEN   $@")
345 20cc9997 Stefan Weil
346 1f673135 bellard
%.html: %.texi
347 01668d98 Stefan Weil
	$(call quiet-command,$(MAKEINFO) $(MAKEINFOFLAGS) --html $< -o $@, \
348 01668d98 Stefan Weil
	"  GEN   $@")
349 3ef693a0 bellard
350 f3548328 bellard
%.info: %.texi
351 01668d98 Stefan Weil
	$(call quiet-command,$(MAKEINFO) $< -o $@,"  GEN   $@")
352 f3548328 bellard
353 20cc9997 Stefan Weil
%.pdf: %.texi
354 20cc9997 Stefan Weil
	$(call quiet-command,texi2pdf $(TEXIFLAG) -I . $<,"  GEN   $@")
355 5824d651 blueswir1
356 5824d651 blueswir1
qemu-options.texi: $(SRC_PATH)/qemu-options.hx
357 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
358 f3548328 bellard
359 acd0a093 Luiz Capitulino
qemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx
360 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
361 2313086a Blue Swirl
362 82a56f0d Luiz Capitulino
QMP/qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx
363 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -q < $< > $@,"  GEN   $@")
364 b40292e7 Jan Kiszka
365 153859be Stuart Brady
qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
366 4c3b5a48 Blue Swirl
	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
367 153859be Stuart Brady
368 2313086a Blue Swirl
qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
369 0d00e563 aliguori
	$(call quiet-command, \
370 4c3b5a48 Blue Swirl
	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu.pod && \
371 0d00e563 aliguori
	  pod2man --section=1 --center=" " --release=" " qemu.pod > $@, \
372 0d00e563 aliguori
	  "  GEN   $@")
373 5a67135a bellard
374 153859be Stuart Brady
qemu-img.1: qemu-img.texi qemu-img-cmds.texi
375 0d00e563 aliguori
	$(call quiet-command, \
376 4c3b5a48 Blue Swirl
	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-img.pod && \
377 0d00e563 aliguori
	  pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@, \
378 0d00e563 aliguori
	  "  GEN   $@")
379 acd935ef bellard
380 a2d8f1be M. Mohan Kumar
fsdev/virtfs-proxy-helper.1: fsdev/virtfs-proxy-helper.texi
381 a2d8f1be M. Mohan Kumar
	$(call quiet-command, \
382 a2d8f1be M. Mohan Kumar
	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< fsdev/virtfs-proxy-helper.pod && \
383 a2d8f1be M. Mohan Kumar
	  pod2man --section=1 --center=" " --release=" " fsdev/virtfs-proxy-helper.pod > $@, \
384 a2d8f1be M. Mohan Kumar
	  "  GEN   $@")
385 a2d8f1be M. Mohan Kumar
386 7a5ca864 bellard
qemu-nbd.8: qemu-nbd.texi
387 0d00e563 aliguori
	$(call quiet-command, \
388 4c3b5a48 Blue Swirl
	  perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< qemu-nbd.pod && \
389 0d00e563 aliguori
	  pod2man --section=8 --center=" " --release=" " qemu-nbd.pod > $@, \
390 0d00e563 aliguori
	  "  GEN   $@")
391 7a5ca864 bellard
392 0cb3fb1e pbrook
dvi: qemu-doc.dvi qemu-tech.dvi
393 0cb3fb1e pbrook
html: qemu-doc.html qemu-tech.html
394 20cc9997 Stefan Weil
info: qemu-doc.info qemu-tech.info
395 20cc9997 Stefan Weil
pdf: qemu-doc.pdf qemu-tech.pdf
396 0cb3fb1e pbrook
397 20cc9997 Stefan Weil
qemu-doc.dvi qemu-doc.html qemu-doc.info qemu-doc.pdf: \
398 20cc9997 Stefan Weil
	qemu-img.texi qemu-nbd.texi qemu-options.texi \
399 20cc9997 Stefan Weil
	qemu-monitor.texi qemu-img-cmds.texi
400 818220f5 aliguori
401 df5cf721 ths
VERSION ?= $(shell cat VERSION)
402 df5cf721 ths
FILE = qemu-$(VERSION)
403 586314f2 bellard
404 1e43adfc bellard
# tar release (use 'make -k tar' on a checkouted tree)
405 586314f2 bellard
tar:
406 586314f2 bellard
	rm -rf /tmp/$(FILE)
407 1e43adfc bellard
	cp -r . /tmp/$(FILE)
408 99c6c082 aurel32
	cd /tmp && tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS --exclude .git --exclude .svn
409 586314f2 bellard
	rm -rf /tmp/$(FILE)
410 586314f2 bellard
411 4fb240a4 bellard
# Include automatically generated dependency files
412 48ff7a62 Michael Roth
-include $(wildcard *.d audio/*.d slirp/*.d block/*.d net/*.d ui/*.d qapi/*.d qga/*.d)