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

P
pbrook 已提交
3
CFLAGS=-Wall -O2 -g -fno-strict-aliasing -I.
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 
P
pbrook 已提交
47 48 49
	mkdir -p "$(DESTDIR)$(bindir)"
	install -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)"
	mkdir -p "$(DESTDIR)$(datadir)"
P
pbrook 已提交
50 51 52 53
	for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
			video.x proll.elf linux_boot.bin; do \
		install -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
	done
P
pbrook 已提交
54 55
	mkdir -p "$(DESTDIR)$(docdir)"
	install -m 644 qemu-doc.html  qemu-tech.html "$(DESTDIR)$(docdir)"
B
bellard 已提交
56
ifndef CONFIG_WIN32
P
pbrook 已提交
57 58 59
	mkdir -p "$(DESTDIR)$(mandir)/man1"
	install qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
	mkdir -p "$(DESTDIR)$(datadir)/keymaps"
P
pbrook 已提交
60 61 62
	for x in $(KEYMAPS); do \
		install -m 644 $(SRC_PATH)/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
	done
B
bellard 已提交
63
endif
B
bellard 已提交
64
	for d in $(TARGET_DIRS); do \
B
bellard 已提交
65
	$(MAKE) -C $$d $@ || exit 1 ; \
B
bellard 已提交
66
        done
B
bellard 已提交
67

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

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

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

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

84
qemu.1: qemu-doc.texi
P
pbrook 已提交
85
	$(SRC_PATH)/texi2pod.pl $< qemu.pod
86 87
	pod2man --section=1 --center=" " --release=" " qemu.pod > $@

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

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

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

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

130 131 132
ifneq ($(wildcard .depend),)
include .depend
endif