Fix slirp redirection on systems without a useful host IP address.
[qemu/mini2440.git] / Makefile
blobff60329ad76cd13fa8bb4daba89ae0da46ed2473
1 include config-host.mak
3 CFLAGS=-Wall -O2 -g -fno-strict-aliasing -I.
4 ifdef CONFIG_DARWIN
5 CFLAGS+= -mdynamic-no-pic
6 endif
7 LDFLAGS=-g
8 LIBS=
9 DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
10 TOOLS=qemu-img$(EXESUF)
11 ifdef CONFIG_STATIC
12 LDFLAGS+=-static
13 endif
14 ifdef BUILD_DOCS
15 DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1
16 else
17 DOCS=
18 endif
20 all: dyngen$(EXESUF) $(TOOLS) $(DOCS)
21 for d in $(TARGET_DIRS); do \
22 $(MAKE) -C $$d $@ || exit 1 ; \
23 done
25 qemu-img$(EXESUF): qemu-img.c block.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c
26 $(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS)
28 dyngen$(EXESUF): dyngen.c
29 $(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^
31 clean:
32 # avoid old build problems by removing potentially incorrect old files
33 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
34 rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~
35 $(MAKE) -C tests clean
36 for d in $(TARGET_DIRS); do \
37 $(MAKE) -C $$d $@ || exit 1 ; \
38 done
40 distclean: clean
41 rm -f config-host.mak config-host.h $(DOCS)
42 for d in $(TARGET_DIRS); do \
43 rm -rf $$d || exit 1 ; \
44 done
46 KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
47 ar de en-us fi fr-be hr it lv nl pl ru th \
48 common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
50 install: all
51 mkdir -p "$(DESTDIR)$(bindir)"
52 $(INSTALL) -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)"
53 mkdir -p "$(DESTDIR)$(datadir)"
54 for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
55 video.x proll.elf linux_boot.bin; do \
56 $(INSTALL) -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
57 done
58 mkdir -p "$(DESTDIR)$(docdir)"
59 $(INSTALL) -m 644 qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)"
60 ifndef CONFIG_WIN32
61 mkdir -p "$(DESTDIR)$(mandir)/man1"
62 $(INSTALL) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
63 mkdir -p "$(DESTDIR)$(datadir)/keymaps"
64 for x in $(KEYMAPS); do \
65 $(INSTALL) -m 644 $(SRC_PATH)/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
66 done
67 endif
68 for d in $(TARGET_DIRS); do \
69 $(MAKE) -C $$d $@ || exit 1 ; \
70 done
72 # various test targets
73 test speed test2: all
74 $(MAKE) -C tests $@
76 TAGS:
77 etags *.[ch] tests/*.[ch]
79 cscope:
80 rm -f ./cscope.*
81 find . -name "*.[ch]" -print > ./cscope.files
82 cscope -b
84 # documentation
85 %.html: %.texi
86 texi2html -monolithic -number $<
88 qemu.1: qemu-doc.texi
89 $(SRC_PATH)/texi2pod.pl $< qemu.pod
90 pod2man --section=1 --center=" " --release=" " qemu.pod > $@
92 qemu-img.1: qemu-img.texi
93 $(SRC_PATH)/texi2pod.pl $< qemu-img.pod
94 pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@
96 FILE=qemu-$(shell cat VERSION)
98 # tar release (use 'make -k tar' on a checkouted tree)
99 tar:
100 rm -rf /tmp/$(FILE)
101 cp -r . /tmp/$(FILE)
102 ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
103 rm -rf /tmp/$(FILE)
105 # generate a binary distribution
106 tarbin:
107 ( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
108 $(bindir)/qemu \
109 $(bindir)/qemu-system-ppc \
110 $(bindir)/qemu-system-sparc \
111 $(bindir)/qemu-system-x86_64 \
112 $(bindir)/qemu-system-mips \
113 $(bindir)/qemu-system-mipsel \
114 $(bindir)/qemu-system-arm \
115 $(bindir)/qemu-i386 \
116 $(bindir)/qemu-arm \
117 $(bindir)/qemu-armeb \
118 $(bindir)/qemu-sparc \
119 $(bindir)/qemu-ppc \
120 $(bindir)/qemu-mips \
121 $(bindir)/qemu-mipsel \
122 $(bindir)/qemu-img \
123 $(datadir)/bios.bin \
124 $(datadir)/vgabios.bin \
125 $(datadir)/vgabios-cirrus.bin \
126 $(datadir)/ppc_rom.bin \
127 $(datadir)/video.x \
128 $(datadir)/proll.elf \
129 $(datadir)/linux_boot.bin \
130 $(docdir)/qemu-doc.html \
131 $(docdir)/qemu-tech.html \
132 $(mandir)/man1/qemu.1 $(mandir)/man1/qemu-img.1 )
134 ifneq ($(wildcard .depend),)
135 include .depend
136 endif