xref: /openbmc/qemu/Makefile (revision c101c49c)
1626df76aSbellardinclude config-host.mak
2766a487aSbellard
37d13299dSbellardCFLAGS=-Wall -O2 -g
431e31b8aSbellardLDFLAGS=-g
5766a487aSbellardLIBS=
60ecfa993SbellardDEFINES+=-D_GNU_SOURCE
71e43adfcSbellardTOOLS=qemu-mkcow
87d13299dSbellard
95a67135aSbellardall: dyngen $(TOOLS) qemu-doc.html qemu.1
10626df76aSbellard	for d in $(TARGET_DIRS); do \
11626df76aSbellard	make -C $$d $@ || exit 1 ; \
12626df76aSbellard        done
1333e3963eSbellard
141e43adfcSbellardqemu-mkcow: qemu-mkcow.o
15626df76aSbellard	$(HOST_CC) -o $@ $^  $(LIBS)
160824d6fcSbellard
17626df76aSbellarddyngen: dyngen.o
18626df76aSbellard	$(HOST_CC) -o $@ $^  $(LIBS)
19de83cd02Sbellard
2031e31b8aSbellard%.o: %.c
21626df76aSbellard	$(HOST_CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
2231e31b8aSbellard
2331e31b8aSbellardclean:
242d80ae89Sbellard# avoid old build problems by removing potentially incorrect old files
252d80ae89Sbellard	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
265a67135aSbellard	rm -f *.o *.a $(TOOLS) dyngen TAGS qemu.pod
2768e73e39Sbellard	make -C tests clean
28626df76aSbellard	for d in $(TARGET_DIRS); do \
29626df76aSbellard	make -C $$d $@ || exit 1 ; \
30626df76aSbellard        done
3131e31b8aSbellard
327d13299dSbellarddistclean: clean
332d80ae89Sbellard	rm -f config-host.mak config-host.h
3476bc6838Sbellard	for d in $(TARGET_DIRS); do \
35bc1b050dSbellard	rm -rf $$d || exit 1 ; \
3676bc6838Sbellard        done
377d13299dSbellard
38626df76aSbellardinstall: all
39d5a0b50cSbellard	mkdir -p $(prefix)/bin
40626df76aSbellard	install -m 755 -s $(TOOLS) $(prefix)/bin
415a67135aSbellard	mkdir -p $(sharedir)
42a735aa31Sbellard	install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin \
43a735aa31Sbellard                       pc-bios/linux_boot.bin $(sharedir)
445a67135aSbellard	mkdir -p $(mandir)/man1
45*c101c49cSbellard	install qemu.1 qemu-mkcow.1 $(mandir)/man1
46626df76aSbellard	for d in $(TARGET_DIRS); do \
47626df76aSbellard	make -C $$d $@ || exit 1 ; \
48626df76aSbellard        done
49612384d7Sbellard
50367e86e8Sbellard# various test targets
5182c7e2a4Sbellardtest speed test2: all
52367e86e8Sbellard	make -C tests $@
5331e31b8aSbellard
54367e86e8SbellardTAGS:
55b9adb4a6Sbellard	etags *.[ch] tests/*.[ch]
5631e31b8aSbellard
573ef693a0Sbellard# documentation
583ef693a0Sbellardqemu-doc.html: qemu-doc.texi
593ef693a0Sbellard	texi2html -monolithic -number $<
603ef693a0Sbellard
615a67135aSbellardqemu.1: qemu-doc.texi
625a67135aSbellard	./texi2pod.pl $< qemu.pod
635a67135aSbellard	pod2man --section=1 --center=" " --release=" " qemu.pod > $@
645a67135aSbellard
651e43adfcSbellardFILE=qemu-$(shell cat VERSION)
66586314f2Sbellard
671e43adfcSbellard# tar release (use 'make -k tar' on a checkouted tree)
68586314f2Sbellardtar:
69586314f2Sbellard	rm -rf /tmp/$(FILE)
701e43adfcSbellard	cp -r . /tmp/$(FILE)
7176b62fd0Sbellard	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
72586314f2Sbellard	rm -rf /tmp/$(FILE)
73586314f2Sbellard
7476b62fd0Sbellard# generate a binary distribution
75d691f669Sbellardtarbin:
7676b62fd0Sbellard	( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
7776b62fd0Sbellard	$(prefix)/bin/qemu $(prefix)/bin/qemu-fast \
7876b62fd0Sbellard	$(prefix)/bin/qemu-i386 \
7976b62fd0Sbellard        $(prefix)/bin/qemu-arm \
8076b62fd0Sbellard        $(prefix)/bin/qemu-sparc \
81c0637b37Sbellard        $(prefix)/bin/qemu-ppc \
8276b62fd0Sbellard	$(sharedir)/bios.bin \
8376b62fd0Sbellard	$(sharedir)/vgabios.bin \
8476b62fd0Sbellard	$(mandir)/man1/qemu.1 )
85d691f669Sbellard
8631e31b8aSbellardifneq ($(wildcard .depend),)
8731e31b8aSbellardinclude .depend
8831e31b8aSbellardendif
89