xref: /openbmc/qemu/Makefile (revision c0637b37)
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
27626df76aSbellard	for d in $(TARGET_DIRS); do \
28626df76aSbellard	make -C $$d $@ || exit 1 ; \
29626df76aSbellard        done
3031e31b8aSbellard
317d13299dSbellarddistclean: clean
322d80ae89Sbellard	rm -f config-host.mak config-host.h
3376bc6838Sbellard	for d in $(TARGET_DIRS); do \
34bc1b050dSbellard	rm -rf $$d || exit 1 ; \
3576bc6838Sbellard        done
367d13299dSbellard
37626df76aSbellardinstall: all
38d5a0b50cSbellard	mkdir -p $(prefix)/bin
39626df76aSbellard	install -m 755 -s $(TOOLS) $(prefix)/bin
405a67135aSbellard	mkdir -p $(sharedir)
415a67135aSbellard	install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin $(sharedir)
425a67135aSbellard	mkdir -p $(mandir)/man1
435a67135aSbellard	install qemu.1 $(mandir)/man1
44626df76aSbellard	for d in $(TARGET_DIRS); do \
45626df76aSbellard	make -C $$d $@ || exit 1 ; \
46626df76aSbellard        done
47612384d7Sbellard
48367e86e8Sbellard# various test targets
4982c7e2a4Sbellardtest speed test2: all
50367e86e8Sbellard	make -C tests $@
5131e31b8aSbellard
52367e86e8SbellardTAGS:
53b9adb4a6Sbellard	etags *.[ch] tests/*.[ch]
5431e31b8aSbellard
553ef693a0Sbellard# documentation
563ef693a0Sbellardqemu-doc.html: qemu-doc.texi
573ef693a0Sbellard	texi2html -monolithic -number $<
583ef693a0Sbellard
595a67135aSbellardqemu.1: qemu-doc.texi
605a67135aSbellard	./texi2pod.pl $< qemu.pod
615a67135aSbellard	pod2man --section=1 --center=" " --release=" " qemu.pod > $@
625a67135aSbellard
631e43adfcSbellardFILE=qemu-$(shell cat VERSION)
64586314f2Sbellard
651e43adfcSbellard# tar release (use 'make -k tar' on a checkouted tree)
66586314f2Sbellardtar:
67586314f2Sbellard	rm -rf /tmp/$(FILE)
681e43adfcSbellard	cp -r . /tmp/$(FILE)
6976b62fd0Sbellard	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
70586314f2Sbellard	rm -rf /tmp/$(FILE)
71586314f2Sbellard
7276b62fd0Sbellard# generate a binary distribution
73d691f669Sbellardtarbin:
7476b62fd0Sbellard	( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
7576b62fd0Sbellard	$(prefix)/bin/qemu $(prefix)/bin/qemu-fast \
7676b62fd0Sbellard	$(prefix)/bin/qemu-i386 \
7776b62fd0Sbellard        $(prefix)/bin/qemu-arm \
7876b62fd0Sbellard        $(prefix)/bin/qemu-sparc \
79*c0637b37Sbellard        $(prefix)/bin/qemu-ppc \
8076b62fd0Sbellard	$(sharedir)/bios.bin \
8176b62fd0Sbellard	$(sharedir)/vgabios.bin \
8276b62fd0Sbellard	$(mandir)/man1/qemu.1 )
83d691f669Sbellard
8431e31b8aSbellardifneq ($(wildcard .depend),)
8531e31b8aSbellardinclude .depend
8631e31b8aSbellardendif
87