blob: 0c2ab09dd35ae544e1b14804ada728581dced1d9 [file] [log] [blame]
pbrookad064842006-04-16 12:41:07 +00001include config-host.mak
bellard766a4872003-02-18 23:35:48 +00002
pbrookad064842006-04-16 12:41:07 +00003CFLAGS=-Wall -O2 -g -fno-strict-aliasing -I.
bellard83fb7ad2004-07-05 21:25:26 +00004ifdef CONFIG_DARWIN
5CFLAGS+= -mdynamic-no-pic
6endif
bellard31e31b82003-02-18 22:55:36 +00007LDFLAGS=-g
bellard766a4872003-02-18 23:35:48 +00008LIBS=
bellardd5249392004-08-03 21:14:23 +00009DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
bellarde35c55f2004-11-16 01:44:03 +000010TOOLS=qemu-img$(EXESUF)
bellard1f50f8d2004-05-08 14:44:43 +000011ifdef CONFIG_STATIC
12LDFLAGS+=-static
13endif
bellardacd935e2004-11-15 22:57:26 +000014DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1
bellard7d132992003-03-06 23:23:54 +000015
bellard8d5f07f2004-10-04 21:23:09 +000016all: dyngen$(EXESUF) $(TOOLS) $(DOCS)
bellard626df762003-08-10 21:39:31 +000017 for d in $(TARGET_DIRS); do \
bellard7d3505c2004-05-12 19:32:15 +000018 $(MAKE) -C $$d $@ || exit 1 ; \
bellard626df762003-08-10 21:39:31 +000019 done
bellard33e39632003-07-06 17:15:21 +000020
bellardde167e42005-04-28 21:15:08 +000021qemu-img$(EXESUF): qemu-img.c block.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c
bellardb932cab2004-08-01 21:46:49 +000022 $(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS)
bellard47cea612004-05-17 20:06:42 +000023
bellard11d9f692004-04-02 20:55:59 +000024dyngen$(EXESUF): dyngen.c
25 $(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^
bellard31e31b82003-02-18 22:55:36 +000026
27clean:
bellard2d80ae82003-08-11 23:01:33 +000028# avoid old build problems by removing potentially incorrect old files
29 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
bellardacd935e2004-11-15 22:57:26 +000030 rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~
bellard7d3505c2004-05-12 19:32:15 +000031 $(MAKE) -C tests clean
bellard626df762003-08-10 21:39:31 +000032 for d in $(TARGET_DIRS); do \
bellard7d3505c2004-05-12 19:32:15 +000033 $(MAKE) -C $$d $@ || exit 1 ; \
bellard626df762003-08-10 21:39:31 +000034 done
bellard31e31b82003-02-18 22:55:36 +000035
bellard7d132992003-03-06 23:23:54 +000036distclean: clean
bellardc72a3452004-11-14 20:52:54 +000037 rm -f config-host.mak config-host.h
bellard76bc6832003-08-10 23:41:46 +000038 for d in $(TARGET_DIRS); do \
bellardbc1b0502003-10-28 00:12:52 +000039 rm -rf $$d || exit 1 ; \
bellard76bc6832003-08-10 23:41:46 +000040 done
bellard7d132992003-03-06 23:23:54 +000041
bellardfed4a9a2004-12-12 22:18:34 +000042KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \
43ar de en-us fi fr-be hr it lv nl pl ru th \
44common de-ch es fo fr-ca hu ja mk nl-be pt sl tr
45
bellard626df762003-08-10 21:39:31 +000046install: all
pbrook1236cab2006-04-09 20:47:35 +000047 mkdir -p "$(DESTDIR)$(bindir)"
pbrook6a882642006-04-17 13:57:12 +000048 $(INSTALL) -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)"
pbrook1236cab2006-04-09 20:47:35 +000049 mkdir -p "$(DESTDIR)$(datadir)"
pbrookad064842006-04-16 12:41:07 +000050 for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
51 video.x proll.elf linux_boot.bin; do \
pbrook6a882642006-04-17 13:57:12 +000052 $(INSTALL) -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \
pbrookad064842006-04-16 12:41:07 +000053 done
pbrook1236cab2006-04-09 20:47:35 +000054 mkdir -p "$(DESTDIR)$(docdir)"
pbrook6a882642006-04-17 13:57:12 +000055 $(INSTALL) -m 644 qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)"
bellard11d9f692004-04-02 20:55:59 +000056ifndef CONFIG_WIN32
pbrook1236cab2006-04-09 20:47:35 +000057 mkdir -p "$(DESTDIR)$(mandir)/man1"
pbrook6a882642006-04-17 13:57:12 +000058 $(INSTALL) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
pbrook1236cab2006-04-09 20:47:35 +000059 mkdir -p "$(DESTDIR)$(datadir)/keymaps"
pbrookad064842006-04-16 12:41:07 +000060 for x in $(KEYMAPS); do \
pbrook6a882642006-04-17 13:57:12 +000061 $(INSTALL) -m 644 $(SRC_PATH)/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \
pbrookad064842006-04-16 12:41:07 +000062 done
bellard11d9f692004-04-02 20:55:59 +000063endif
bellard626df762003-08-10 21:39:31 +000064 for d in $(TARGET_DIRS); do \
bellard7d3505c2004-05-12 19:32:15 +000065 $(MAKE) -C $$d $@ || exit 1 ; \
bellard626df762003-08-10 21:39:31 +000066 done
bellard612384d2003-03-22 17:31:19 +000067
bellard367e86e2003-03-01 17:13:26 +000068# various test targets
bellard82c7e2a2004-01-04 16:10:33 +000069test speed test2: all
bellard7d3505c2004-05-12 19:32:15 +000070 $(MAKE) -C tests $@
bellard31e31b82003-02-18 22:55:36 +000071
bellard367e86e2003-03-01 17:13:26 +000072TAGS:
bellardb9adb4a2003-04-29 20:41:16 +000073 etags *.[ch] tests/*.[ch]
bellard31e31b82003-02-18 22:55:36 +000074
bellard6688bc62005-08-21 09:23:39 +000075cscope:
76 rm -f ./cscope.*
77 find . -name "*.[ch]" -print > ./cscope.files
78 cscope -b
79
bellard3ef693a2003-03-23 20:17:16 +000080# documentation
bellard1f673132004-04-04 15:21:17 +000081%.html: %.texi
bellard3ef693a2003-03-23 20:17:16 +000082 texi2html -monolithic -number $<
83
bellard5a671352003-10-01 00:13:48 +000084qemu.1: qemu-doc.texi
pbrookad064842006-04-16 12:41:07 +000085 $(SRC_PATH)/texi2pod.pl $< qemu.pod
bellard5a671352003-10-01 00:13:48 +000086 pod2man --section=1 --center=" " --release=" " qemu.pod > $@
87
bellardacd935e2004-11-15 22:57:26 +000088qemu-img.1: qemu-img.texi
pbrookad064842006-04-16 12:41:07 +000089 $(SRC_PATH)/texi2pod.pl $< qemu-img.pod
bellardacd935e2004-11-15 22:57:26 +000090 pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@
91
bellard1e43adf2003-09-30 20:54:24 +000092FILE=qemu-$(shell cat VERSION)
bellard586314f2003-03-03 15:02:29 +000093
bellard1e43adf2003-09-30 20:54:24 +000094# tar release (use 'make -k tar' on a checkouted tree)
bellard586314f2003-03-03 15:02:29 +000095tar:
96 rm -rf /tmp/$(FILE)
bellard1e43adf2003-09-30 20:54:24 +000097 cp -r . /tmp/$(FILE)
bellard76b62fd2003-10-28 00:47:44 +000098 ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
bellard586314f2003-03-03 15:02:29 +000099 rm -rf /tmp/$(FILE)
100
bellard76b62fd2003-10-28 00:47:44 +0000101# generate a binary distribution
bellardd691f662003-03-24 21:58:34 +0000102tarbin:
bellard76b62fd2003-10-28 00:47:44 +0000103 ( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
bellard43095f32005-04-27 20:49:23 +0000104 $(bindir)/qemu \
bellard7efa4382004-05-12 18:54:06 +0000105 $(bindir)/qemu-system-ppc \
bellardacd935e2004-11-15 22:57:26 +0000106 $(bindir)/qemu-system-sparc \
bellard43095f32005-04-27 20:49:23 +0000107 $(bindir)/qemu-system-x86_64 \
bellard93856aa2005-07-24 18:44:35 +0000108 $(bindir)/qemu-system-mips \
pbrook38260992006-03-11 14:51:13 +0000109 $(bindir)/qemu-system-mipsel \
bellardea31eb52005-12-06 21:42:03 +0000110 $(bindir)/qemu-system-arm \
bellard7efa4382004-05-12 18:54:06 +0000111 $(bindir)/qemu-i386 \
112 $(bindir)/qemu-arm \
bellardea31eb52005-12-06 21:42:03 +0000113 $(bindir)/qemu-armeb \
bellard7efa4382004-05-12 18:54:06 +0000114 $(bindir)/qemu-sparc \
115 $(bindir)/qemu-ppc \
bellardea31eb52005-12-06 21:42:03 +0000116 $(bindir)/qemu-mips \
117 $(bindir)/qemu-mipsel \
bellardb932cab2004-08-01 21:46:49 +0000118 $(bindir)/qemu-img \
bellard7efa4382004-05-12 18:54:06 +0000119 $(datadir)/bios.bin \
120 $(datadir)/vgabios.bin \
bellardde9258a2004-06-06 15:50:03 +0000121 $(datadir)/vgabios-cirrus.bin \
bellard637f6cd2004-06-21 19:54:47 +0000122 $(datadir)/ppc_rom.bin \
bellardd5295252005-07-03 14:00:51 +0000123 $(datadir)/video.x \
bellarde80cfcf2004-12-19 23:18:01 +0000124 $(datadir)/proll.elf \
bellard7efa4382004-05-12 18:54:06 +0000125 $(datadir)/linux_boot.bin \
bellard1f50f8d2004-05-08 14:44:43 +0000126 $(docdir)/qemu-doc.html \
127 $(docdir)/qemu-tech.html \
bellardacd935e2004-11-15 22:57:26 +0000128 $(mandir)/man1/qemu.1 $(mandir)/man1/qemu-img.1 )
bellardd691f662003-03-24 21:58:34 +0000129
bellard31e31b82003-02-18 22:55:36 +0000130ifneq ($(wildcard .depend),)
131include .depend
132endif