xref: /openbmc/qemu/Makefile (revision cf495bcf9ffe0f1450a5de7497612dd1be23ff2a)
1include config-host.mak
2
3CFLAGS=-Wall -O2 -g
4LDFLAGS=-g
5LIBS=
6DEFINES+=-D_GNU_SOURCE
7TOOLS=qemu-mkcow
8
9all: dyngen $(TOOLS) qemu-doc.html qemu.1
10	for d in $(TARGET_DIRS); do \
11	make -C $$d $@ || exit 1 ; \
12        done
13
14qemu-mkcow: qemu-mkcow.o
15	$(HOST_CC) -o $@ $^  $(LIBS)
16
17dyngen: dyngen.o
18	$(HOST_CC) -o $@ $^  $(LIBS)
19
20%.o: %.c
21	$(HOST_CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
22
23clean:
24# avoid old build problems by removing potentially incorrect old files
25	rm -f config.mak config.h op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
26	rm -f *.o *.a $(TOOLS) dyngen TAGS qemu.pod
27	for d in $(TARGET_DIRS); do \
28	make -C $$d $@ || exit 1 ; \
29        done
30
31distclean: clean
32	rm -f config-host.mak config-host.h
33	for d in $(TARGET_DIRS); do \
34	rm -rf $$d || exit 1 ; \
35        done
36
37install: all
38	mkdir -p $(prefix)/bin
39	install -m 755 -s $(TOOLS) $(prefix)/bin
40	mkdir -p $(sharedir)
41	install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin $(sharedir)
42	mkdir -p $(mandir)/man1
43	install qemu.1 $(mandir)/man1
44	for d in $(TARGET_DIRS); do \
45	make -C $$d $@ || exit 1 ; \
46        done
47
48# various test targets
49test speed: all
50	make -C tests $@
51
52TAGS:
53	etags *.[ch] tests/*.[ch]
54
55# documentation
56qemu-doc.html: qemu-doc.texi
57	texi2html -monolithic -number $<
58
59qemu.1: qemu-doc.texi
60	./texi2pod.pl $< qemu.pod
61	pod2man --section=1 --center=" " --release=" " qemu.pod > $@
62
63FILE=qemu-$(shell cat VERSION)
64
65# tar release (use 'make -k tar' on a checkouted tree)
66tar:
67	rm -rf /tmp/$(FILE)
68	cp -r . /tmp/$(FILE)
69	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
70	rm -rf /tmp/$(FILE)
71
72# generate a binary distribution
73tarbin:
74	( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
75	$(prefix)/bin/qemu $(prefix)/bin/qemu-fast \
76	$(prefix)/bin/qemu-i386 \
77        $(prefix)/bin/qemu-arm \
78        $(prefix)/bin/qemu-sparc \
79	$(sharedir)/bios.bin \
80	$(sharedir)/vgabios.bin \
81	$(mandir)/man1/qemu.1 )
82
83ifneq ($(wildcard .depend),)
84include .depend
85endif
86