Makefile 2.4 KB
Newer Older
B
bellard 已提交
1
include config-host.mak
B
bellard 已提交
2

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

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

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

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

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

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

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

B
bellard 已提交
61
# various test targets
B
update  
bellard 已提交
62
test speed test2: all
B
bellard 已提交
63
	$(MAKE) -C tests $@
64

B
bellard 已提交
65
TAGS: 
B
bellard 已提交
66
	etags *.[ch] tests/*.[ch]
67

B
bellard 已提交
68
# documentation
B
bellard 已提交
69
%.html: %.texi
B
bellard 已提交
70 71
	texi2html -monolithic -number $<

72 73 74 75
qemu.1: qemu-doc.texi
	./texi2pod.pl $< qemu.pod
	pod2man --section=1 --center=" " --release=" " qemu.pod > $@

76
FILE=qemu-$(shell cat VERSION)
B
bellard 已提交
77

78
# tar release (use 'make -k tar' on a checkouted tree)
B
bellard 已提交
79 80
tar:
	rm -rf /tmp/$(FILE)
81
	cp -r . /tmp/$(FILE)
B
bellard 已提交
82
	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
B
bellard 已提交
83 84
	rm -rf /tmp/$(FILE)

B
bellard 已提交
85
# generate a binary distribution
86
tarbin:
B
bellard 已提交
87
	( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
B
bellard 已提交
88 89 90 91 92 93 94 95 96 97
	$(bindir)/qemu $(bindir)/qemu-fast \
	$(bindir)/qemu-system-ppc \
	$(bindir)/qemu-i386 \
        $(bindir)/qemu-arm \
        $(bindir)/qemu-sparc \
        $(bindir)/qemu-ppc \
        $(bindir)/qemu-mkcow \
	$(datadir)/bios.bin \
	$(datadir)/vgabios.bin \
	$(datadir)/linux_boot.bin \
B
bellard 已提交
98 99 100
	$(docdir)/qemu-doc.html \
	$(docdir)/qemu-tech.html \
	$(mandir)/man1/qemu.1 $(mandir)/man1/qemu-mkcow.1 )
101

102 103 104
ifneq ($(wildcard .depend),)
include .depend
endif