xref: /openbmc/qemu/Makefile (revision 83fb7adf)
1626df76aSbellardinclude config-host.mak
2766a487aSbellard
37d13299dSbellardCFLAGS=-Wall -O2 -g
4*83fb7adfSbellardifdef CONFIG_DARWIN
5*83fb7adfSbellardCFLAGS+= -mdynamic-no-pic
6*83fb7adfSbellardendif
767b915a5Sbellardifdef CONFIG_WIN32
867b915a5SbellardCFLAGS+=-fpack-struct
967b915a5Sbellardendif
1031e31b8aSbellardLDFLAGS=-g
11766a487aSbellardLIBS=
120ecfa993SbellardDEFINES+=-D_GNU_SOURCE
1367b915a5Sbellardifndef CONFIG_WIN32
1447cea614SbellardTOOLS=qemu-mkcow vmdk2raw
1567b915a5Sbellardendif
161f50f8d1Sbellardifdef CONFIG_STATIC
171f50f8d1SbellardLDFLAGS+=-static
181f50f8d1Sbellardendif
197d13299dSbellard
201f673135Sbellardall: dyngen$(EXESUF) $(TOOLS) qemu-doc.html qemu-tech.html qemu.1
21626df76aSbellard	for d in $(TARGET_DIRS); do \
227d3505c5Sbellard	$(MAKE) -C $$d $@ || exit 1 ; \
23626df76aSbellard        done
2433e3963eSbellard
2511d9f695Sbellardqemu-mkcow: qemu-mkcow.c
261f50f8d1Sbellard	$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ $(LIBS)
270824d6fcSbellard
2847cea614Sbellardvmdk2raw: vmdk2raw.c
2947cea614Sbellard	$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ $(LIBS)
3047cea614Sbellard
3111d9f695Sbellarddyngen$(EXESUF): dyngen.c
3211d9f695Sbellard	$(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^
3331e31b8aSbellard
3431e31b8aSbellardclean:
352d80ae89Sbellard# avoid old build problems by removing potentially incorrect old files
362d80ae89Sbellard	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
3767b915a5Sbellard	rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS qemu.pod
387d3505c5Sbellard	$(MAKE) -C tests clean
39626df76aSbellard	for d in $(TARGET_DIRS); do \
407d3505c5Sbellard	$(MAKE) -C $$d $@ || exit 1 ; \
41626df76aSbellard        done
4231e31b8aSbellard
437d13299dSbellarddistclean: clean
442d80ae89Sbellard	rm -f config-host.mak config-host.h
4576bc6838Sbellard	for d in $(TARGET_DIRS); do \
46bc1b050dSbellard	rm -rf $$d || exit 1 ; \
4776bc6838Sbellard        done
487d13299dSbellard
49626df76aSbellardinstall: all
5011d9f695Sbellard	mkdir -p "$(bindir)"
5111d9f695Sbellardifndef CONFIG_WIN32
5211d9f695Sbellard	install -m 755 -s $(TOOLS) "$(bindir)"
5311d9f695Sbellardendif
547efa4387Sbellard	mkdir -p "$(datadir)"
55a735aa31Sbellard	install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin \
56de9258a8Sbellard                       pc-bios/vgabios-cirrus.bin \
57637f6cd7Sbellard                       pc-bios/ppc_rom.bin \
587efa4387Sbellard                       pc-bios/linux_boot.bin "$(datadir)"
591f50f8d1Sbellard	mkdir -p "$(docdir)"
601f50f8d1Sbellard	install -m 644 qemu-doc.html  qemu-tech.html "$(docdir)"
6111d9f695Sbellardifndef CONFIG_WIN32
6211d9f695Sbellard	mkdir -p "$(mandir)/man1"
6311d9f695Sbellard	install qemu.1 qemu-mkcow.1 "$(mandir)/man1"
6411d9f695Sbellardendif
65626df76aSbellard	for d in $(TARGET_DIRS); do \
667d3505c5Sbellard	$(MAKE) -C $$d $@ || exit 1 ; \
67626df76aSbellard        done
68612384d7Sbellard
69367e86e8Sbellard# various test targets
7082c7e2a4Sbellardtest speed test2: all
717d3505c5Sbellard	$(MAKE) -C tests $@
7231e31b8aSbellard
73367e86e8SbellardTAGS:
74b9adb4a6Sbellard	etags *.[ch] tests/*.[ch]
7531e31b8aSbellard
763ef693a0Sbellard# documentation
771f673135Sbellard%.html: %.texi
783ef693a0Sbellard	texi2html -monolithic -number $<
793ef693a0Sbellard
805a67135aSbellardqemu.1: qemu-doc.texi
815a67135aSbellard	./texi2pod.pl $< qemu.pod
825a67135aSbellard	pod2man --section=1 --center=" " --release=" " qemu.pod > $@
835a67135aSbellard
841e43adfcSbellardFILE=qemu-$(shell cat VERSION)
85586314f2Sbellard
861e43adfcSbellard# tar release (use 'make -k tar' on a checkouted tree)
87586314f2Sbellardtar:
88586314f2Sbellard	rm -rf /tmp/$(FILE)
891e43adfcSbellard	cp -r . /tmp/$(FILE)
9076b62fd0Sbellard	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
91586314f2Sbellard	rm -rf /tmp/$(FILE)
92586314f2Sbellard
9376b62fd0Sbellard# generate a binary distribution
94d691f669Sbellardtarbin:
9576b62fd0Sbellard	( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
967efa4387Sbellard	$(bindir)/qemu $(bindir)/qemu-fast \
977efa4387Sbellard	$(bindir)/qemu-system-ppc \
987efa4387Sbellard	$(bindir)/qemu-i386 \
997efa4387Sbellard        $(bindir)/qemu-arm \
1007efa4387Sbellard        $(bindir)/qemu-sparc \
1017efa4387Sbellard        $(bindir)/qemu-ppc \
10247cea614Sbellard        $(bindir)/qemu-mkcow $(bindir)/vmdk2raw \
1037efa4387Sbellard	$(datadir)/bios.bin \
1047efa4387Sbellard	$(datadir)/vgabios.bin \
105de9258a8Sbellard	$(datadir)/vgabios-cirrus.bin \
106637f6cd7Sbellard	$(datadir)/ppc_rom.bin \
1077efa4387Sbellard	$(datadir)/linux_boot.bin \
1081f50f8d1Sbellard	$(docdir)/qemu-doc.html \
1091f50f8d1Sbellard	$(docdir)/qemu-tech.html \
1101f50f8d1Sbellard	$(mandir)/man1/qemu.1 $(mandir)/man1/qemu-mkcow.1 )
111d691f669Sbellard
11231e31b8aSbellardifneq ($(wildcard .depend),)
11331e31b8aSbellardinclude .depend
11431e31b8aSbellardendif
115