Makefile 2.1 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

B
bellard 已提交
14
all: dyngen$(EXESUF) $(TOOLS) qemu-doc.html qemu.1
B
bellard 已提交
15 16 17
	for d in $(TARGET_DIRS); do \
	make -C $$d $@ || exit 1 ; \
        done
18

19
qemu-mkcow: qemu-mkcow.o
B
bellard 已提交
20
	$(HOST_CC) -o $@ $^  $(LIBS)
B
bellard 已提交
21

B
bellard 已提交
22
dyngen$(EXESUF): dyngen.o
B
bellard 已提交
23
	$(HOST_CC) -o $@ $^  $(LIBS)
B
bellard 已提交
24

25
%.o: %.c
B
bellard 已提交
26
	$(HOST_CC) $(CFLAGS) $(DEFINES) -c -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 34 35
	for d in $(TARGET_DIRS); do \
	make -C $$d $@ || exit 1 ; \
        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
update  
bellard 已提交
44
	mkdir -p $(prefix)/bin
B
bellard 已提交
45
	install -m 755 -s $(TOOLS) $(prefix)/bin
46
	mkdir -p $(sharedir)
B
bellard 已提交
47 48
	install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin \
                       pc-bios/linux_boot.bin $(sharedir)
49
	mkdir -p $(mandir)/man1
B
bellard 已提交
50
	install qemu.1 qemu-mkcow.1 $(mandir)/man1
B
bellard 已提交
51 52 53
	for d in $(TARGET_DIRS); do \
	make -C $$d $@ || exit 1 ; \
        done
B
bellard 已提交
54

B
bellard 已提交
55
# various test targets
B
update  
bellard 已提交
56
test speed test2: all
B
bellard 已提交
57
	make -C tests $@
58

B
bellard 已提交
59
TAGS: 
B
bellard 已提交
60
	etags *.[ch] tests/*.[ch]
61

B
bellard 已提交
62 63 64 65
# documentation
qemu-doc.html: qemu-doc.texi
	texi2html -monolithic -number $<

66 67 68 69
qemu.1: qemu-doc.texi
	./texi2pod.pl $< qemu.pod
	pod2man --section=1 --center=" " --release=" " qemu.pod > $@

70
FILE=qemu-$(shell cat VERSION)
B
bellard 已提交
71

72
# tar release (use 'make -k tar' on a checkouted tree)
B
bellard 已提交
73 74
tar:
	rm -rf /tmp/$(FILE)
75
	cp -r . /tmp/$(FILE)
B
bellard 已提交
76
	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
B
bellard 已提交
77 78
	rm -rf /tmp/$(FILE)

B
bellard 已提交
79
# generate a binary distribution
80
tarbin:
B
bellard 已提交
81 82 83 84 85
	( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
	$(prefix)/bin/qemu $(prefix)/bin/qemu-fast \
	$(prefix)/bin/qemu-i386 \
        $(prefix)/bin/qemu-arm \
        $(prefix)/bin/qemu-sparc \
B
update  
bellard 已提交
86
        $(prefix)/bin/qemu-ppc \
B
bellard 已提交
87 88 89
	$(sharedir)/bios.bin \
	$(sharedir)/vgabios.bin \
	$(mandir)/man1/qemu.1 )
90

91 92 93
ifneq ($(wildcard .depend),)
include .depend
endif