Statistics
| Branch: | Revision:

root / Makefile @ f3548328

History | View | Annotate | Download (3.8 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: all 
51
	mkdir -p "$(DESTDIR)$(bindir)"
52
	$(INSTALL) -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)"
53
	mkdir -p "$(DESTDIR)$(datadir)"
54
	for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
55
			video.x proll.elf linux_boot.bin; do \
56
		$(INSTALL) -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
57
	done
58
	mkdir -p "$(DESTDIR)$(docdir)"
59
	$(INSTALL) -m 644 qemu-doc.html  qemu-tech.html "$(DESTDIR)$(docdir)"
60
ifndef CONFIG_WIN32
61
	mkdir -p "$(DESTDIR)$(mandir)/man1"
62
	$(INSTALL) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
63
	mkdir -p "$(DESTDIR)$(datadir)/keymaps"
64
	for x in $(KEYMAPS); do \
65
		$(INSTALL) -m 644 $(SRC_PATH)/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
66
	done
67
endif
68
	for d in $(TARGET_DIRS); do \
69
	$(MAKE) -C $$d $@ || exit 1 ; \
70
        done
71

    
72
# various test targets
73
test speed test2: all
74
	$(MAKE) -C tests $@
75

    
76
TAGS: 
77
	etags *.[ch] tests/*.[ch]
78

    
79
cscope:
80
	rm -f ./cscope.*
81
	find . -name "*.[ch]" -print > ./cscope.files
82
	cscope -b
83

    
84
# documentation
85
%.html: %.texi
86
	texi2html -monolithic -number $<
87

    
88
%.info: %.texi
89
	makeinfo $< -o $@
90

    
91
%.dvi: %.texi
92
	texi2dvi $<
93

    
94
qemu.1: qemu-doc.texi
95
	$(SRC_PATH)/texi2pod.pl $< qemu.pod
96
	pod2man --section=1 --center=" " --release=" " qemu.pod > $@
97

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

    
102
FILE=qemu-$(shell cat VERSION)
103

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

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

    
140
ifneq ($(wildcard .depend),)
141
include .depend
142
endif