xref: /openbmc/qemu/Makefile (revision e80cfcfc)
18d5f07faSbellard-include config-host.mak
2766a487aSbellard
3b932cabaSbellardCFLAGS=-Wall -O2 -g -fno-strict-aliasing
483fb7adfSbellardifdef CONFIG_DARWIN
583fb7adfSbellardCFLAGS+= -mdynamic-no-pic
683fb7adfSbellardendif
731e31b8aSbellardLDFLAGS=-g
8766a487aSbellardLIBS=
9d5249393SbellardDEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
10e35c55feSbellardTOOLS=qemu-img$(EXESUF)
111f50f8d1Sbellardifdef CONFIG_STATIC
121f50f8d1SbellardLDFLAGS+=-static
131f50f8d1Sbellardendif
14acd935efSbellardDOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1
157d13299dSbellard
168d5f07faSbellardall: dyngen$(EXESUF) $(TOOLS) $(DOCS)
17626df76aSbellard	for d in $(TARGET_DIRS); do \
187d3505c5Sbellard	$(MAKE) -C $$d $@ || exit 1 ; \
19626df76aSbellard        done
2033e3963eSbellard
21585d0ed9Sbellardqemu-img$(EXESUF): qemu-img.c block.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c
22b932cabaSbellard	$(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS)
2347cea614Sbellard
2411d9f695Sbellarddyngen$(EXESUF): dyngen.c
2511d9f695Sbellard	$(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^
2631e31b8aSbellard
2731e31b8aSbellardclean:
282d80ae89Sbellard# avoid old build problems by removing potentially incorrect old files
292d80ae89Sbellard	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
30acd935efSbellard	rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~
317d3505c5Sbellard	$(MAKE) -C tests clean
32626df76aSbellard	for d in $(TARGET_DIRS); do \
337d3505c5Sbellard	$(MAKE) -C $$d $@ || exit 1 ; \
34626df76aSbellard        done
3531e31b8aSbellard
367d13299dSbellarddistclean: clean
37c72a345fSbellard	rm -f config-host.mak config-host.h
3876bc6838Sbellard	for d in $(TARGET_DIRS); do \
39bc1b050dSbellard	rm -rf $$d || exit 1 ; \
4076bc6838Sbellard        done
417d13299dSbellard
42fed4a9adSbellardKEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
43fed4a9adSbellardar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
44fed4a9adSbellardcommon  de-ch  es     fo  fr-ca  hu     ja  mk  nl-be      pt  sl     tr
45fed4a9adSbellard
46626df76aSbellardinstall: all
4711d9f695Sbellard	mkdir -p "$(bindir)"
4811d9f695Sbellard	install -m 755 -s $(TOOLS) "$(bindir)"
497efa4387Sbellard	mkdir -p "$(datadir)"
50a735aa31Sbellard	install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin \
51de9258a8Sbellard                       pc-bios/vgabios-cirrus.bin \
52637f6cd7Sbellard                       pc-bios/ppc_rom.bin \
53*e80cfcfcSbellard                       pc-bios/proll.elf \
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"
59acd935efSbellard	install qemu.1 qemu-img.1 "$(mandir)/man1"
603d11d0ebSbellard	mkdir -p "$(datadir)/keymaps"
61fed4a9adSbellard	install -m 644 $(addprefix keymaps/,$(KEYMAPS)) "$(datadir)/keymaps"
6211d9f695Sbellardendif
63626df76aSbellard	for d in $(TARGET_DIRS); do \
647d3505c5Sbellard	$(MAKE) -C $$d $@ || exit 1 ; \
65626df76aSbellard        done
66612384d7Sbellard
67367e86e8Sbellard# various test targets
6882c7e2a4Sbellardtest speed test2: all
697d3505c5Sbellard	$(MAKE) -C tests $@
7031e31b8aSbellard
71367e86e8SbellardTAGS:
72b9adb4a6Sbellard	etags *.[ch] tests/*.[ch]
7331e31b8aSbellard
743ef693a0Sbellard# documentation
751f673135Sbellard%.html: %.texi
763ef693a0Sbellard	texi2html -monolithic -number $<
773ef693a0Sbellard
785a67135aSbellardqemu.1: qemu-doc.texi
795a67135aSbellard	./texi2pod.pl $< qemu.pod
805a67135aSbellard	pod2man --section=1 --center=" " --release=" " qemu.pod > $@
815a67135aSbellard
82acd935efSbellardqemu-img.1: qemu-img.texi
83acd935efSbellard	./texi2pod.pl $< qemu-img.pod
84acd935efSbellard	pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@
85acd935efSbellard
861e43adfcSbellardFILE=qemu-$(shell cat VERSION)
87586314f2Sbellard
881e43adfcSbellard# tar release (use 'make -k tar' on a checkouted tree)
89586314f2Sbellardtar:
90586314f2Sbellard	rm -rf /tmp/$(FILE)
911e43adfcSbellard	cp -r . /tmp/$(FILE)
9276b62fd0Sbellard	( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
93586314f2Sbellard	rm -rf /tmp/$(FILE)
94586314f2Sbellard
9576b62fd0Sbellard# generate a binary distribution
96d691f669Sbellardtarbin:
9776b62fd0Sbellard	( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
987efa4387Sbellard	$(bindir)/qemu $(bindir)/qemu-fast \
997efa4387Sbellard	$(bindir)/qemu-system-ppc \
100acd935efSbellard	$(bindir)/qemu-system-sparc \
1017efa4387Sbellard	$(bindir)/qemu-i386 \
1027efa4387Sbellard        $(bindir)/qemu-arm \
1037efa4387Sbellard        $(bindir)/qemu-sparc \
1047efa4387Sbellard        $(bindir)/qemu-ppc \
105b932cabaSbellard        $(bindir)/qemu-img \
1067efa4387Sbellard	$(datadir)/bios.bin \
1077efa4387Sbellard	$(datadir)/vgabios.bin \
108de9258a8Sbellard	$(datadir)/vgabios-cirrus.bin \
109637f6cd7Sbellard	$(datadir)/ppc_rom.bin \
110*e80cfcfcSbellard	$(datadir)/proll.elf \
1117efa4387Sbellard	$(datadir)/linux_boot.bin \
1121f50f8d1Sbellard	$(docdir)/qemu-doc.html \
1131f50f8d1Sbellard	$(docdir)/qemu-tech.html \
114acd935efSbellard	$(mandir)/man1/qemu.1 $(mandir)/man1/qemu-img.1 )
115d691f669Sbellard
11631e31b8aSbellardifneq ($(wildcard .depend),)
11731e31b8aSbellardinclude .depend
11831e31b8aSbellardendif
119