xref: /openbmc/qemu/Makefile (revision 68e73e39)
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
27*68e73e39Sbellard	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)
425a67135aSbellard	install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin $(sharedir)
435a67135aSbellard	mkdir -p $(mandir)/man1
445a67135aSbellard	install qemu.1 $(mandir)/man1
45626df76aSbellard	for d in $(TARGET_DIRS); do \
46626df76aSbellard	make -C $$d $@ || exit 1 ; \
47626df76aSbellard        done
48612384d7Sbellard
49367e86e8Sbellard# various test targets
5082c7e2a4Sbellardtest speed test2: all
51367e86e8Sbellard	make -C tests $@
5231e31b8aSbellard
53367e86e8SbellardTAGS:
54b9adb4a6Sbellard	etags *.[ch] tests/*.[ch]
5531e31b8aSbellard
563ef693a0Sbellard# documentation
573ef693a0Sbellardqemu-doc.html: qemu-doc.texi
583ef693a0Sbellard	texi2html -monolithic -number $<
593ef693a0Sbellard
605a67135aSbellardqemu.1: qemu-doc.texi
615a67135aSbellard	./texi2pod.pl $< qemu.pod
625a67135aSbellard	pod2man --section=1 --center=" " --release=" " qemu.pod > $@
635a67135aSbellard
641e43adfcSbellardFILE=qemu-$(shell cat VERSION)
65586314f2Sbellard
661e43adfcSbellard# tar release (use 'make -k tar' on a checkouted tree)
67586314f2Sbellardtar:
68586314f2Sbellard	rm -rf /tmp/$(FILE)
691e43adfcSbellard	cp -r . /tmp/$(FILE)
7076b62fd0Sbellard	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
71586314f2Sbellard	rm -rf /tmp/$(FILE)
72586314f2Sbellard
7376b62fd0Sbellard# generate a binary distribution
74d691f669Sbellardtarbin:
7576b62fd0Sbellard	( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
7676b62fd0Sbellard	$(prefix)/bin/qemu $(prefix)/bin/qemu-fast \
7776b62fd0Sbellard	$(prefix)/bin/qemu-i386 \
7876b62fd0Sbellard        $(prefix)/bin/qemu-arm \
7976b62fd0Sbellard        $(prefix)/bin/qemu-sparc \
80c0637b37Sbellard        $(prefix)/bin/qemu-ppc \
8176b62fd0Sbellard	$(sharedir)/bios.bin \
8276b62fd0Sbellard	$(sharedir)/vgabios.bin \
8376b62fd0Sbellard	$(mandir)/man1/qemu.1 )
84d691f669Sbellard
8531e31b8aSbellardifneq ($(wildcard .depend),)
8631e31b8aSbellardinclude .depend
8731e31b8aSbellardendif
88