Statistics
| Branch: | Revision:

root / Makefile @ 38954dca

History | View | Annotate | Download (3.9 kB)

1
include config-host.mak
2

    
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
19

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

    
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)
27

    
28
dyngen$(EXESUF): dyngen.c
29
	$(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^
30

    
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
39

    
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
45

    
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
49

    
50
install-doc: $(DOCS)
51
	mkdir -p "$(DESTDIR)$(docdir)"
52
	$(INSTALL) -m 644 qemu-doc.html  qemu-tech.html "$(DESTDIR)$(docdir)"
53
ifndef CONFIG_WIN32
54
	mkdir -p "$(DESTDIR)$(mandir)/man1"
55
	$(INSTALL) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
56
endif
57

    
58
install: all $(if $(BUILD_DOCS),install-doc)
59
	mkdir -p "$(DESTDIR)$(bindir)"
60
	$(INSTALL) -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)"
61
	mkdir -p "$(DESTDIR)$(datadir)"
62
	for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
63
			video.x proll.elf linux_boot.bin; do \
64
		$(INSTALL) -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
65
	done
66
ifndef CONFIG_WIN32
67
	mkdir -p "$(DESTDIR)$(datadir)/keymaps"
68
	for x in $(KEYMAPS); do \
69
		$(INSTALL) -m 644 $(SRC_PATH)/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
70
	done
71
endif
72
	for d in $(TARGET_DIRS); do \
73
	$(MAKE) -C $$d $@ || exit 1 ; \
74
        done
75

    
76
# various test targets
77
test speed test2: all
78
	$(MAKE) -C tests $@
79

    
80
TAGS: 
81
	etags *.[ch] tests/*.[ch]
82

    
83
cscope:
84
	rm -f ./cscope.*
85
	find . -name "*.[ch]" -print > ./cscope.files
86
	cscope -b
87

    
88
# documentation
89
%.html: %.texi
90
	texi2html -monolithic -number $<
91

    
92
%.info: %.texi
93
	makeinfo $< -o $@
94

    
95
%.dvi: %.texi
96
	texi2dvi $<
97

    
98
qemu.1: qemu-doc.texi
99
	$(SRC_PATH)/texi2pod.pl $< qemu.pod
100
	pod2man --section=1 --center=" " --release=" " qemu.pod > $@
101

    
102
qemu-img.1: qemu-img.texi
103
	$(SRC_PATH)/texi2pod.pl $< qemu-img.pod
104
	pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@
105

    
106
FILE=qemu-$(shell cat VERSION)
107

    
108
# tar release (use 'make -k tar' on a checkouted tree)
109
tar:
110
	rm -rf /tmp/$(FILE)
111
	cp -r . /tmp/$(FILE)
112
	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
113
	rm -rf /tmp/$(FILE)
114

    
115
# generate a binary distribution
116
tarbin:
117
	( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
118
	$(bindir)/qemu \
119
	$(bindir)/qemu-system-ppc \
120
	$(bindir)/qemu-system-sparc \
121
	$(bindir)/qemu-system-x86_64 \
122
	$(bindir)/qemu-system-mips \
123
	$(bindir)/qemu-system-mipsel \
124
	$(bindir)/qemu-system-arm \
125
	$(bindir)/qemu-i386 \
126
        $(bindir)/qemu-arm \
127
        $(bindir)/qemu-armeb \
128
        $(bindir)/qemu-sparc \
129
        $(bindir)/qemu-ppc \
130
        $(bindir)/qemu-mips \
131
        $(bindir)/qemu-mipsel \
132
        $(bindir)/qemu-img \
133
	$(datadir)/bios.bin \
134
	$(datadir)/vgabios.bin \
135
	$(datadir)/vgabios-cirrus.bin \
136
	$(datadir)/ppc_rom.bin \
137
	$(datadir)/video.x \
138
	$(datadir)/proll.elf \
139
	$(datadir)/linux_boot.bin \
140
	$(docdir)/qemu-doc.html \
141
	$(docdir)/qemu-tech.html \
142
	$(mandir)/man1/qemu.1 $(mandir)/man1/qemu-img.1 )
143

    
144
ifneq ($(wildcard .depend),)
145
include .depend
146
endif