Makefile 3.6 KB
Newer Older
B
bellard 已提交
1
-include config-host.mak
B
bellard 已提交
2

B
bellard 已提交
3
CFLAGS=-Wall -O2 -g -fno-strict-aliasing 
4 5 6
ifdef CONFIG_DARWIN
CFLAGS+= -mdynamic-no-pic
endif
7
LDFLAGS=-g
B
bellard 已提交
8
LIBS=
B
bellard 已提交
9
DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
B
bellard 已提交
10
TOOLS=qemu-img$(EXESUF)
B
bellard 已提交
11 12 13
ifdef CONFIG_STATIC
LDFLAGS+=-static
endif
B
bellard 已提交
14
DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1
B
bellard 已提交
15

B
bellard 已提交
16
all: dyngen$(EXESUF) $(TOOLS) $(DOCS)
B
bellard 已提交
17
	for d in $(TARGET_DIRS); do \
B
bellard 已提交
18
	$(MAKE) -C $$d $@ || exit 1 ; \
B
bellard 已提交
19
        done
20

21
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
B
bellard 已提交
22
	$(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS)
23

B
bellard 已提交
24 25
dyngen$(EXESUF): dyngen.c
	$(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^
26 27

clean:
28 29
# avoid old build problems by removing potentially incorrect old files
	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 
B
bellard 已提交
30
	rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~
B
bellard 已提交
31
	$(MAKE) -C tests clean
B
bellard 已提交
32
	for d in $(TARGET_DIRS); do \
B
bellard 已提交
33
	$(MAKE) -C $$d $@ || exit 1 ; \
B
bellard 已提交
34
        done
35

B
bellard 已提交
36
distclean: clean
B
bellard 已提交
37
	rm -f config-host.mak config-host.h
B
updated  
bellard 已提交
38
	for d in $(TARGET_DIRS); do \
B
bellard 已提交
39
	rm -rf $$d || exit 1 ; \
B
updated  
bellard 已提交
40
        done
B
bellard 已提交
41

B
bellard 已提交
42 43 44 45
KEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
ar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
common  de-ch  es     fo  fr-ca  hu     ja  mk  nl-be      pt  sl     tr

B
bellard 已提交
46
install: all 
B
bellard 已提交
47 48
	mkdir -p "$(bindir)"
	install -m 755 -s $(TOOLS) "$(bindir)"
B
bellard 已提交
49
	mkdir -p "$(datadir)"
B
bellard 已提交
50
	install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin \
B
bellard 已提交
51
                       pc-bios/vgabios-cirrus.bin \
B
bellard 已提交
52
                       pc-bios/ppc_rom.bin pc-bios/video.x \
B
bellard 已提交
53
                       pc-bios/proll.elf \
B
bellard 已提交
54
                       pc-bios/linux_boot.bin "$(datadir)"
B
bellard 已提交
55 56
	mkdir -p "$(docdir)"
	install -m 644 qemu-doc.html  qemu-tech.html "$(docdir)"
B
bellard 已提交
57 58
ifndef CONFIG_WIN32
	mkdir -p "$(mandir)/man1"
B
bellard 已提交
59
	install qemu.1 qemu-img.1 "$(mandir)/man1"
60
	mkdir -p "$(datadir)/keymaps"
B
bellard 已提交
61
	install -m 644 $(addprefix keymaps/,$(KEYMAPS)) "$(datadir)/keymaps"
B
bellard 已提交
62
endif
B
bellard 已提交
63
	for d in $(TARGET_DIRS); do \
B
bellard 已提交
64
	$(MAKE) -C $$d $@ || exit 1 ; \
B
bellard 已提交
65
        done
B
bellard 已提交
66

B
bellard 已提交
67
# various test targets
B
update  
bellard 已提交
68
test speed test2: all
B
bellard 已提交
69
	$(MAKE) -C tests $@
70

B
bellard 已提交
71
TAGS: 
B
bellard 已提交
72
	etags *.[ch] tests/*.[ch]
73

B
bellard 已提交
74 75 76 77 78
cscope:
	rm -f ./cscope.*
	find . -name "*.[ch]" -print > ./cscope.files
	cscope -b

B
bellard 已提交
79
# documentation
B
bellard 已提交
80
%.html: %.texi
B
bellard 已提交
81 82
	texi2html -monolithic -number $<

83 84 85 86
qemu.1: qemu-doc.texi
	./texi2pod.pl $< qemu.pod
	pod2man --section=1 --center=" " --release=" " qemu.pod > $@

B
bellard 已提交
87 88 89 90
qemu-img.1: qemu-img.texi
	./texi2pod.pl $< qemu-img.pod
	pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@

91
FILE=qemu-$(shell cat VERSION)
B
bellard 已提交
92

93
# tar release (use 'make -k tar' on a checkouted tree)
B
bellard 已提交
94 95
tar:
	rm -rf /tmp/$(FILE)
96
	cp -r . /tmp/$(FILE)
B
bellard 已提交
97
	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
B
bellard 已提交
98 99
	rm -rf /tmp/$(FILE)

B
bellard 已提交
100
# generate a binary distribution
101
tarbin:
B
bellard 已提交
102
	( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
B
bellard 已提交
103
	$(bindir)/qemu \
B
bellard 已提交
104
	$(bindir)/qemu-system-ppc \
B
bellard 已提交
105
	$(bindir)/qemu-system-sparc \
B
bellard 已提交
106
	$(bindir)/qemu-system-x86_64 \
B
bellard 已提交
107
	$(bindir)/qemu-system-mips \
B
update  
bellard 已提交
108
	$(bindir)/qemu-system-arm \
B
bellard 已提交
109 110
	$(bindir)/qemu-i386 \
        $(bindir)/qemu-arm \
B
update  
bellard 已提交
111
        $(bindir)/qemu-armeb \
B
bellard 已提交
112 113
        $(bindir)/qemu-sparc \
        $(bindir)/qemu-ppc \
B
update  
bellard 已提交
114 115
        $(bindir)/qemu-mips \
        $(bindir)/qemu-mipsel \
B
bellard 已提交
116
        $(bindir)/qemu-img \
B
bellard 已提交
117 118
	$(datadir)/bios.bin \
	$(datadir)/vgabios.bin \
B
bellard 已提交
119
	$(datadir)/vgabios-cirrus.bin \
B
bellard 已提交
120
	$(datadir)/ppc_rom.bin \
B
bellard 已提交
121
	$(datadir)/video.x \
B
bellard 已提交
122
	$(datadir)/proll.elf \
B
bellard 已提交
123
	$(datadir)/linux_boot.bin \
B
bellard 已提交
124 125
	$(docdir)/qemu-doc.html \
	$(docdir)/qemu-tech.html \
B
bellard 已提交
126
	$(mandir)/man1/qemu.1 $(mandir)/man1/qemu-img.1 )
127

128 129 130
ifneq ($(wildcard .depend),)
include .depend
endif