xref: /openbmc/qemu/Makefile (revision 7a3f194486ad5c8e21c96a19dee37b14a1057580)
1include config-host.mak
2
3CFLAGS=-Wall -O2 -g
4LDFLAGS=-g
5LIBS=
6DEFINES+=-D_GNU_SOURCE
7TOOLS=vlmkcow
8
9all: dyngen $(TOOLS) qemu-doc.html
10	for d in $(TARGET_DIRS); do \
11	make -C $$d $@ || exit 1 ; \
12        done
13
14vlmkcow: vlmkcow.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
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 -f $$d/config.h $$d/config.mak || exit 1 ; \
35        done
36
37install: all
38	mkdir -p $(prefix)/bin
39	install -m 755 -s $(TOOLS) $(prefix)/bin
40	for d in $(TARGET_DIRS); do \
41	make -C $$d $@ || exit 1 ; \
42        done
43
44# various test targets
45test speed: all
46	make -C tests $@
47
48TAGS:
49	etags *.[ch] tests/*.[ch]
50
51# documentation
52qemu-doc.html: qemu-doc.texi
53	texi2html -monolithic -number $<
54
55FILES= \
56README README.distrib COPYING COPYING.LIB TODO Changelog VERSION \
57configure Makefile Makefile.target \
58dyngen.c dyngen.h dyngen-exec.h ioctls.h syscall_types.h \
59elf.h elfload.c main.c signal.c qemu.h \
60syscall.c syscall_defs.h vm86.c path.c mmap.c \
61i386.ld ppc.ld alpha.ld s390.ld sparc.ld arm.ld m68k.ld \
62vl.c i386-vl.ld vl.h block.c vlmkcow.c vga.c vga_template.h sdl.c \
63thunk.c cpu-exec.c translate.c cpu-all.h cpu-defs.h thunk.h exec.h\
64exec.c cpu-exec.c gdbstub.c bswap.h \
65cpu-i386.h op-i386.c helper-i386.c helper2-i386.c syscall-i386.h translate-i386.c \
66exec-i386.h ops_template.h ops_template_mem.h opreg_template.h \
67ops_mem.h softmmu_template.h softmmu_header.h \
68cpu-arm.h syscall-arm.h exec-arm.h op-arm.c translate-arm.c op-arm-template.h \
69dis-asm.h disas.c disas.h alpha-dis.c ppc-dis.c i386-dis.c sparc-dis.c \
70arm-dis.c \
71tests/Makefile \
72tests/test-i386.c tests/test-i386-shift.h tests/test-i386.h \
73tests/test-i386-muldiv.h tests/test-i386-code16.S tests/test-i386-vm86.S \
74tests/hello-i386.c tests/hello-i386 \
75tests/hello-arm.c tests/hello-arm \
76tests/sha1.c \
77tests/testsig.c tests/testclone.c tests/testthread.c \
78tests/runcom.c tests/pi_10.com \
79tests/test_path.c \
80qemu-doc.texi qemu-doc.html
81
82FILE=qemu-$(VERSION)
83
84tar:
85	rm -rf /tmp/$(FILE)
86	mkdir -p /tmp/$(FILE)
87	cp --parent $(FILES) /tmp/$(FILE)
88	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) )
89	rm -rf /tmp/$(FILE)
90
91# generate a binary distribution including the test binary environnment
92BINPATH=/usr/local/qemu-i386
93
94tarbin:
95	tar zcvf /tmp/qemu-$(VERSION)-i386-glibc21.tar.gz \
96                 $(BINPATH)/etc $(BINPATH)/lib $(BINPATH)/bin $(BINPATH)/usr
97	tar zcvf /tmp/qemu-$(VERSION)-i386-wine.tar.gz \
98                 $(BINPATH)/wine
99
100ifneq ($(wildcard .depend),)
101include .depend
102endif
103