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

B
bellard 已提交
3
CFLAGS=-Wall -O2 -g
4
LDFLAGS=-g
B
bellard 已提交
5
LIBS=
B
bellard 已提交
6
DEFINES+=-D_GNU_SOURCE
7
TOOLS=qemu-mkcow
B
bellard 已提交
8

B
bellard 已提交
9 10 11 12
all: dyngen $(TOOLS) qemu-doc.html
	for d in $(TARGET_DIRS); do \
	make -C $$d $@ || exit 1 ; \
        done
13

14
qemu-mkcow: qemu-mkcow.o
B
bellard 已提交
15
	$(HOST_CC) -o $@ $^  $(LIBS)
B
bellard 已提交
16

B
bellard 已提交
17 18
dyngen: dyngen.o
	$(HOST_CC) -o $@ $^  $(LIBS)
B
bellard 已提交
19

20
%.o: %.c
B
bellard 已提交
21
	$(HOST_CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
22 23

clean:
24 25
# 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 已提交
26 27 28 29
	rm -f *.o *.a $(TOOLS) dyngen TAGS
	for d in $(TARGET_DIRS); do \
	make -C $$d $@ || exit 1 ; \
        done
30

B
bellard 已提交
31
distclean: clean
32
	rm -f config-host.mak config-host.h
B
updated  
bellard 已提交
33 34 35
	for d in $(TARGET_DIRS); do \
	rm -f $$d/config.h $$d/config.mak || exit 1 ; \
        done
B
bellard 已提交
36

B
bellard 已提交
37
install: all 
B
update  
bellard 已提交
38
	mkdir -p $(prefix)/bin
B
bellard 已提交
39 40 41 42
	install -m 755 -s $(TOOLS) $(prefix)/bin
	for d in $(TARGET_DIRS); do \
	make -C $$d $@ || exit 1 ; \
        done
B
bellard 已提交
43

B
bellard 已提交
44
# various test targets
B
bellard 已提交
45
test speed: all
B
bellard 已提交
46
	make -C tests $@
47

B
bellard 已提交
48
TAGS: 
B
bellard 已提交
49
	etags *.[ch] tests/*.[ch]
50

B
bellard 已提交
51 52 53 54
# documentation
qemu-doc.html: qemu-doc.texi
	texi2html -monolithic -number $<

55
FILE=qemu-$(shell cat VERSION)
B
bellard 已提交
56

57
# tar release (use 'make -k tar' on a checkouted tree)
B
bellard 已提交
58 59
tar:
	rm -rf /tmp/$(FILE)
60
	cp -r . /tmp/$(FILE)
B
bellard 已提交
61 62 63
	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) )
	rm -rf /tmp/$(FILE)

64 65 66 67
# generate a binary distribution including the test binary environnment 
BINPATH=/usr/local/qemu-i386

tarbin:
B
update  
bellard 已提交
68 69 70 71
	tar zcvf /tmp/qemu-$(VERSION)-i386-glibc21.tar.gz \
                 $(BINPATH)/etc $(BINPATH)/lib $(BINPATH)/bin $(BINPATH)/usr
	tar zcvf /tmp/qemu-$(VERSION)-i386-wine.tar.gz \
                 $(BINPATH)/wine
72

73 74 75
ifneq ($(wildcard .depend),)
include .depend
endif