Makefile 3.3 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
B
bellard 已提交
7 8 9
ifdef CONFIG_WIN32
CFLAGS+=-fpack-struct 
endif
10
LDFLAGS=-g
B
bellard 已提交
11
LIBS=
B
bellard 已提交
12
DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
B
bellard 已提交
13
TOOLS=qemu-img$(EXESUF)
B
bellard 已提交
14 15 16
ifdef CONFIG_STATIC
LDFLAGS+=-static
endif
B
bellard 已提交
17
DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1
B
bellard 已提交
18

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

24
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 已提交
25
	$(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS)
26

B
bellard 已提交
27 28
dyngen$(EXESUF): dyngen.c
	$(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^
29 30

clean:
31 32
# 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 已提交
33
	rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~
B
bellard 已提交
34
	$(MAKE) -C tests clean
B
bellard 已提交
35
	for d in $(TARGET_DIRS); do \
B
bellard 已提交
36
	$(MAKE) -C $$d $@ || exit 1 ; \
B
bellard 已提交
37
        done
38

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

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

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

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

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

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

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

89
FILE=qemu-$(shell cat VERSION)
B
bellard 已提交
90

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

B
bellard 已提交
98
# generate a binary distribution
99
tarbin:
B
bellard 已提交
100
	( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
B
bellard 已提交
101 102
	$(bindir)/qemu $(bindir)/qemu-fast \
	$(bindir)/qemu-system-ppc \
B
bellard 已提交
103
	$(bindir)/qemu-system-sparc \
B
bellard 已提交
104 105 106 107
	$(bindir)/qemu-i386 \
        $(bindir)/qemu-arm \
        $(bindir)/qemu-sparc \
        $(bindir)/qemu-ppc \
B
bellard 已提交
108
        $(bindir)/qemu-img \
B
bellard 已提交
109 110
	$(datadir)/bios.bin \
	$(datadir)/vgabios.bin \
B
bellard 已提交
111
	$(datadir)/vgabios-cirrus.bin \
B
bellard 已提交
112
	$(datadir)/ppc_rom.bin \
B
bellard 已提交
113
	$(datadir)/proll.bin \
B
bellard 已提交
114
	$(datadir)/linux_boot.bin \
B
bellard 已提交
115 116
	$(docdir)/qemu-doc.html \
	$(docdir)/qemu-tech.html \
B
bellard 已提交
117
	$(mandir)/man1/qemu.1 $(mandir)/man1/qemu-img.1 )
118

119 120 121
ifneq ($(wildcard .depend),)
include .depend
endif