xref: /openbmc/qemu/Makefile (revision bbc9d348)
1626df76aSbellardinclude config-host.mak
2766a487aSbellard
37d13299dSbellardCFLAGS=-Wall -O2 -g
467b915a5Sbellardifdef CONFIG_WIN32
567b915a5SbellardCFLAGS+=-fpack-struct
667b915a5Sbellardendif
731e31b8aSbellardLDFLAGS=-g
8766a487aSbellardLIBS=
90ecfa993SbellardDEFINES+=-D_GNU_SOURCE
1067b915a5Sbellardifndef CONFIG_WIN32
111e43adfcSbellardTOOLS=qemu-mkcow
1267b915a5Sbellardendif
137d13299dSbellard
141f673135Sbellardall: dyngen$(EXESUF) $(TOOLS) qemu-doc.html qemu-tech.html qemu.1
15626df76aSbellard	for d in $(TARGET_DIRS); do \
16626df76aSbellard	make -C $$d $@ || exit 1 ; \
17626df76aSbellard        done
1833e3963eSbellard
1911d9f695Sbellardqemu-mkcow: qemu-mkcow.c
2011d9f695Sbellard	$(CC) $(CFLAGS) $(DEFINES) -o $@ $^ $(LIBS)
210824d6fcSbellard
2211d9f695Sbellarddyngen$(EXESUF): dyngen.c
2311d9f695Sbellard	$(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^
2431e31b8aSbellard
2531e31b8aSbellardclean:
262d80ae89Sbellard# avoid old build problems by removing potentially incorrect old files
272d80ae89Sbellard	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
2867b915a5Sbellard	rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS qemu.pod
2968e73e39Sbellard	make -C tests clean
30626df76aSbellard	for d in $(TARGET_DIRS); do \
31626df76aSbellard	make -C $$d $@ || exit 1 ; \
32626df76aSbellard        done
3331e31b8aSbellard
347d13299dSbellarddistclean: clean
352d80ae89Sbellard	rm -f config-host.mak config-host.h
3676bc6838Sbellard	for d in $(TARGET_DIRS); do \
37bc1b050dSbellard	rm -rf $$d || exit 1 ; \
3876bc6838Sbellard        done
397d13299dSbellard
40626df76aSbellardinstall: all
4111d9f695Sbellard	mkdir -p "$(bindir)"
4211d9f695Sbellardifndef CONFIG_WIN32
4311d9f695Sbellard	install -m 755 -s $(TOOLS) "$(bindir)"
4411d9f695Sbellardendif
4511d9f695Sbellard	mkdir -p "$(sharedir)"
46a735aa31Sbellard	install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin \
4711d9f695Sbellard                       pc-bios/linux_boot.bin "$(sharedir)"
4811d9f695Sbellardifndef CONFIG_WIN32
4911d9f695Sbellard	mkdir -p "$(mandir)/man1"
5011d9f695Sbellard	install qemu.1 qemu-mkcow.1 "$(mandir)/man1"
5111d9f695Sbellardendif
52626df76aSbellard	for d in $(TARGET_DIRS); do \
53626df76aSbellard	make -C $$d $@ || exit 1 ; \
54626df76aSbellard        done
55612384d7Sbellard
56367e86e8Sbellard# various test targets
5782c7e2a4Sbellardtest speed test2: all
58367e86e8Sbellard	make -C tests $@
5931e31b8aSbellard
60367e86e8SbellardTAGS:
61b9adb4a6Sbellard	etags *.[ch] tests/*.[ch]
6231e31b8aSbellard
633ef693a0Sbellard# documentation
641f673135Sbellard%.html: %.texi
653ef693a0Sbellard	texi2html -monolithic -number $<
663ef693a0Sbellard
675a67135aSbellardqemu.1: qemu-doc.texi
685a67135aSbellard	./texi2pod.pl $< qemu.pod
695a67135aSbellard	pod2man --section=1 --center=" " --release=" " qemu.pod > $@
705a67135aSbellard
711e43adfcSbellardFILE=qemu-$(shell cat VERSION)
72586314f2Sbellard
731e43adfcSbellard# tar release (use 'make -k tar' on a checkouted tree)
74586314f2Sbellardtar:
75586314f2Sbellard	rm -rf /tmp/$(FILE)
761e43adfcSbellard	cp -r . /tmp/$(FILE)
7776b62fd0Sbellard	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
78586314f2Sbellard	rm -rf /tmp/$(FILE)
79586314f2Sbellard
8076b62fd0Sbellard# generate a binary distribution
81d691f669Sbellardtarbin:
8276b62fd0Sbellard	( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
8376b62fd0Sbellard	$(prefix)/bin/qemu $(prefix)/bin/qemu-fast \
84*bbc9d348Sbellard	$(prefix)/bin/qemu-system-ppc \
8576b62fd0Sbellard	$(prefix)/bin/qemu-i386 \
8676b62fd0Sbellard        $(prefix)/bin/qemu-arm \
8776b62fd0Sbellard        $(prefix)/bin/qemu-sparc \
88c0637b37Sbellard        $(prefix)/bin/qemu-ppc \
8976b62fd0Sbellard	$(sharedir)/bios.bin \
9076b62fd0Sbellard	$(sharedir)/vgabios.bin \
9176b62fd0Sbellard	$(mandir)/man1/qemu.1 )
92d691f669Sbellard
9331e31b8aSbellardifneq ($(wildcard .depend),)
9431e31b8aSbellardinclude .depend
9531e31b8aSbellardendif
96