xref: /openbmc/qemu/Makefile (revision de9258a8)
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
1147cea614SbellardTOOLS=qemu-mkcow vmdk2raw
1267b915a5Sbellardendif
131f50f8d1Sbellardifdef CONFIG_STATIC
141f50f8d1SbellardLDFLAGS+=-static
151f50f8d1Sbellardendif
167d13299dSbellard
171f673135Sbellardall: dyngen$(EXESUF) $(TOOLS) qemu-doc.html qemu-tech.html qemu.1
18626df76aSbellard	for d in $(TARGET_DIRS); do \
197d3505c5Sbellard	$(MAKE) -C $$d $@ || exit 1 ; \
20626df76aSbellard        done
2133e3963eSbellard
2211d9f695Sbellardqemu-mkcow: qemu-mkcow.c
231f50f8d1Sbellard	$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ $(LIBS)
240824d6fcSbellard
2547cea614Sbellardvmdk2raw: vmdk2raw.c
2647cea614Sbellard	$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ $(LIBS)
2747cea614Sbellard
2811d9f695Sbellarddyngen$(EXESUF): dyngen.c
2911d9f695Sbellard	$(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^
3031e31b8aSbellard
3131e31b8aSbellardclean:
322d80ae89Sbellard# avoid old build problems by removing potentially incorrect old files
332d80ae89Sbellard	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
3467b915a5Sbellard	rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS qemu.pod
357d3505c5Sbellard	$(MAKE) -C tests clean
36626df76aSbellard	for d in $(TARGET_DIRS); do \
377d3505c5Sbellard	$(MAKE) -C $$d $@ || exit 1 ; \
38626df76aSbellard        done
3931e31b8aSbellard
407d13299dSbellarddistclean: clean
412d80ae89Sbellard	rm -f config-host.mak config-host.h
4276bc6838Sbellard	for d in $(TARGET_DIRS); do \
43bc1b050dSbellard	rm -rf $$d || exit 1 ; \
4476bc6838Sbellard        done
457d13299dSbellard
46626df76aSbellardinstall: all
4711d9f695Sbellard	mkdir -p "$(bindir)"
4811d9f695Sbellardifndef CONFIG_WIN32
4911d9f695Sbellard	install -m 755 -s $(TOOLS) "$(bindir)"
5011d9f695Sbellardendif
517efa4387Sbellard	mkdir -p "$(datadir)"
52a735aa31Sbellard	install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin \
53*de9258a8Sbellard                       pc-bios/vgabios-cirrus.bin \
547efa4387Sbellard                       pc-bios/linux_boot.bin "$(datadir)"
551f50f8d1Sbellard	mkdir -p "$(docdir)"
561f50f8d1Sbellard	install -m 644 qemu-doc.html  qemu-tech.html "$(docdir)"
5711d9f695Sbellardifndef CONFIG_WIN32
5811d9f695Sbellard	mkdir -p "$(mandir)/man1"
5911d9f695Sbellard	install qemu.1 qemu-mkcow.1 "$(mandir)/man1"
6011d9f695Sbellardendif
61626df76aSbellard	for d in $(TARGET_DIRS); do \
627d3505c5Sbellard	$(MAKE) -C $$d $@ || exit 1 ; \
63626df76aSbellard        done
64612384d7Sbellard
65367e86e8Sbellard# various test targets
6682c7e2a4Sbellardtest speed test2: all
677d3505c5Sbellard	$(MAKE) -C tests $@
6831e31b8aSbellard
69367e86e8SbellardTAGS:
70b9adb4a6Sbellard	etags *.[ch] tests/*.[ch]
7131e31b8aSbellard
723ef693a0Sbellard# documentation
731f673135Sbellard%.html: %.texi
743ef693a0Sbellard	texi2html -monolithic -number $<
753ef693a0Sbellard
765a67135aSbellardqemu.1: qemu-doc.texi
775a67135aSbellard	./texi2pod.pl $< qemu.pod
785a67135aSbellard	pod2man --section=1 --center=" " --release=" " qemu.pod > $@
795a67135aSbellard
801e43adfcSbellardFILE=qemu-$(shell cat VERSION)
81586314f2Sbellard
821e43adfcSbellard# tar release (use 'make -k tar' on a checkouted tree)
83586314f2Sbellardtar:
84586314f2Sbellard	rm -rf /tmp/$(FILE)
851e43adfcSbellard	cp -r . /tmp/$(FILE)
8676b62fd0Sbellard	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
87586314f2Sbellard	rm -rf /tmp/$(FILE)
88586314f2Sbellard
8976b62fd0Sbellard# generate a binary distribution
90d691f669Sbellardtarbin:
9176b62fd0Sbellard	( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
927efa4387Sbellard	$(bindir)/qemu $(bindir)/qemu-fast \
937efa4387Sbellard	$(bindir)/qemu-system-ppc \
947efa4387Sbellard	$(bindir)/qemu-i386 \
957efa4387Sbellard        $(bindir)/qemu-arm \
967efa4387Sbellard        $(bindir)/qemu-sparc \
977efa4387Sbellard        $(bindir)/qemu-ppc \
9847cea614Sbellard        $(bindir)/qemu-mkcow $(bindir)/vmdk2raw \
997efa4387Sbellard	$(datadir)/bios.bin \
1007efa4387Sbellard	$(datadir)/vgabios.bin \
101*de9258a8Sbellard	$(datadir)/vgabios-cirrus.bin \
1027efa4387Sbellard	$(datadir)/linux_boot.bin \
1031f50f8d1Sbellard	$(docdir)/qemu-doc.html \
1041f50f8d1Sbellard	$(docdir)/qemu-tech.html \
1051f50f8d1Sbellard	$(mandir)/man1/qemu.1 $(mandir)/man1/qemu-mkcow.1 )
106d691f669Sbellard
10731e31b8aSbellardifneq ($(wildcard .depend),)
10831e31b8aSbellardinclude .depend
10931e31b8aSbellardendif
110