Statistics
| Branch: | Revision:

root / Makefile @ dc5d0b3d

History | View | Annotate | Download (2.7 kB)

1
include config-host.mak
2

    
3
CFLAGS=-Wall -O2 -g
4
ifdef CONFIG_WIN32
5
CFLAGS+=-fpack-struct 
6
endif
7
LDFLAGS=-g
8
LIBS=
9
DEFINES+=-D_GNU_SOURCE
10
ifndef CONFIG_WIN32
11
TOOLS=qemu-mkcow vmdk2raw
12
endif
13
ifdef CONFIG_STATIC
14
LDFLAGS+=-static
15
endif
16

    
17
all: dyngen$(EXESUF) $(TOOLS) qemu-doc.html qemu-tech.html qemu.1
18
	for d in $(TARGET_DIRS); do \
19
	$(MAKE) -C $$d $@ || exit 1 ; \
20
        done
21

    
22
qemu-mkcow: qemu-mkcow.c
23
	$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ $(LIBS)
24

    
25
vmdk2raw: vmdk2raw.c
26
	$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ $(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 qemu.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
42
	for d in $(TARGET_DIRS); do \
43
	rm -rf $$d || exit 1 ; \
44
        done
45

    
46
install: all 
47
	mkdir -p "$(bindir)"
48
ifndef CONFIG_WIN32
49
	install -m 755 -s $(TOOLS) "$(bindir)"
50
endif
51
	mkdir -p "$(datadir)"
52
	install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin \
53
                       pc-bios/vgabios-cirrus.bin \
54
                       pc-bios/ppc_rom.bin \
55
                       pc-bios/linux_boot.bin "$(datadir)"
56
	mkdir -p "$(docdir)"
57
	install -m 644 qemu-doc.html  qemu-tech.html "$(docdir)"
58
ifndef CONFIG_WIN32
59
	mkdir -p "$(mandir)/man1"
60
	install qemu.1 qemu-mkcow.1 "$(mandir)/man1"
61
endif
62
	for d in $(TARGET_DIRS); do \
63
	$(MAKE) -C $$d $@ || exit 1 ; \
64
        done
65

    
66
# various test targets
67
test speed test2: all
68
	$(MAKE) -C tests $@
69

    
70
TAGS: 
71
	etags *.[ch] tests/*.[ch]
72

    
73
# documentation
74
%.html: %.texi
75
	texi2html -monolithic -number $<
76

    
77
qemu.1: qemu-doc.texi
78
	./texi2pod.pl $< qemu.pod
79
	pod2man --section=1 --center=" " --release=" " qemu.pod > $@
80

    
81
FILE=qemu-$(shell cat VERSION)
82

    
83
# tar release (use 'make -k tar' on a checkouted tree)
84
tar:
85
	rm -rf /tmp/$(FILE)
86
	cp -r . /tmp/$(FILE)
87
	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
88
	rm -rf /tmp/$(FILE)
89

    
90
# generate a binary distribution
91
tarbin:
92
	( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
93
	$(bindir)/qemu $(bindir)/qemu-fast \
94
	$(bindir)/qemu-system-ppc \
95
	$(bindir)/qemu-i386 \
96
        $(bindir)/qemu-arm \
97
        $(bindir)/qemu-sparc \
98
        $(bindir)/qemu-ppc \
99
        $(bindir)/qemu-mkcow $(bindir)/vmdk2raw \
100
	$(datadir)/bios.bin \
101
	$(datadir)/vgabios.bin \
102
	$(datadir)/vgabios-cirrus.bin \
103
	$(datadir)/ppc_rom.bin \
104
	$(datadir)/linux_boot.bin \
105
	$(docdir)/qemu-doc.html \
106
	$(docdir)/qemu-tech.html \
107
	$(mandir)/man1/qemu.1 $(mandir)/man1/qemu-mkcow.1 )
108

    
109
ifneq ($(wildcard .depend),)
110
include .depend
111
endif