Makefile 3.5 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
B
bellard 已提交
20
ifdef CONFIG_KQEMU
B
bellard 已提交
21 22 23
ifdef CONFIG_WIN32
	$(MAKE) -C kqemu -f Makefile.winnt
else
B
bellard 已提交
24 25
	$(MAKE) -C kqemu
endif
B
bellard 已提交
26
endif
27

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

B
bellard 已提交
31 32
dyngen$(EXESUF): dyngen.c
	$(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^
33 34

clean:
35 36
# 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 已提交
37
	rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~
B
bellard 已提交
38
	$(MAKE) -C tests clean
B
bellard 已提交
39
	for d in $(TARGET_DIRS); do \
B
bellard 已提交
40
	$(MAKE) -C $$d $@ || exit 1 ; \
B
bellard 已提交
41
        done
B
bellard 已提交
42 43 44
ifdef CONFIG_KQEMU
	$(MAKE) -C kqemu clean
endif
45

B
bellard 已提交
46
distclean: clean
B
bellard 已提交
47
	rm -f config-host.mak config-host.h
B
updated  
bellard 已提交
48
	for d in $(TARGET_DIRS); do \
B
bellard 已提交
49
	rm -rf $$d || exit 1 ; \
B
updated  
bellard 已提交
50
        done
B
bellard 已提交
51

B
bellard 已提交
52 53 54 55
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 已提交
56
install: all 
B
bellard 已提交
57 58
	mkdir -p "$(bindir)"
	install -m 755 -s $(TOOLS) "$(bindir)"
B
bellard 已提交
59
	mkdir -p "$(datadir)"
B
bellard 已提交
60
	install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin \
B
bellard 已提交
61
                       pc-bios/vgabios-cirrus.bin \
B
bellard 已提交
62
                       pc-bios/ppc_rom.bin \
B
bellard 已提交
63
                       pc-bios/proll.elf \
B
bellard 已提交
64
                       pc-bios/linux_boot.bin "$(datadir)"
B
bellard 已提交
65 66
	mkdir -p "$(docdir)"
	install -m 644 qemu-doc.html  qemu-tech.html "$(docdir)"
B
bellard 已提交
67 68
ifndef CONFIG_WIN32
	mkdir -p "$(mandir)/man1"
B
bellard 已提交
69
	install qemu.1 qemu-img.1 "$(mandir)/man1"
70
	mkdir -p "$(datadir)/keymaps"
B
bellard 已提交
71
	install -m 644 $(addprefix keymaps/,$(KEYMAPS)) "$(datadir)/keymaps"
B
bellard 已提交
72
endif
B
bellard 已提交
73
	for d in $(TARGET_DIRS); do \
B
bellard 已提交
74
	$(MAKE) -C $$d $@ || exit 1 ; \
B
bellard 已提交
75
        done
B
bellard 已提交
76 77 78
ifdef CONFIG_KQEMU
	cd kqemu ; ./install.sh
endif
B
bellard 已提交
79

B
bellard 已提交
80
# various test targets
B
update  
bellard 已提交
81
test speed test2: all
B
bellard 已提交
82
	$(MAKE) -C tests $@
83

B
bellard 已提交
84
TAGS: 
B
bellard 已提交
85
	etags *.[ch] tests/*.[ch]
86

B
bellard 已提交
87
# documentation
B
bellard 已提交
88
%.html: %.texi
B
bellard 已提交
89 90
	texi2html -monolithic -number $<

91 92 93 94
qemu.1: qemu-doc.texi
	./texi2pod.pl $< qemu.pod
	pod2man --section=1 --center=" " --release=" " qemu.pod > $@

B
bellard 已提交
95 96 97 98
qemu-img.1: qemu-img.texi
	./texi2pod.pl $< qemu-img.pod
	pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@

99
FILE=qemu-$(shell cat VERSION)
B
bellard 已提交
100

101
# tar release (use 'make -k tar' on a checkouted tree)
B
bellard 已提交
102 103
tar:
	rm -rf /tmp/$(FILE)
104
	cp -r . /tmp/$(FILE)
B
bellard 已提交
105
	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
B
bellard 已提交
106 107
	rm -rf /tmp/$(FILE)

B
bellard 已提交
108
# generate a binary distribution
109
tarbin:
B
bellard 已提交
110
	( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
B
bellard 已提交
111 112
	$(bindir)/qemu $(bindir)/qemu-fast \
	$(bindir)/qemu-system-ppc \
B
bellard 已提交
113
	$(bindir)/qemu-system-sparc \
B
bellard 已提交
114 115 116 117
	$(bindir)/qemu-i386 \
        $(bindir)/qemu-arm \
        $(bindir)/qemu-sparc \
        $(bindir)/qemu-ppc \
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)/proll.elf \
B
bellard 已提交
124
	$(datadir)/linux_boot.bin \
B
bellard 已提交
125 126
	$(docdir)/qemu-doc.html \
	$(docdir)/qemu-tech.html \
B
bellard 已提交
127
	$(mandir)/man1/qemu.1 $(mandir)/man1/qemu-img.1 )
128

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