pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 1 | include config-host.mak |
bellard | 766a487 | 2003-02-18 23:35:48 +0000 | [diff] [blame] | 2 | |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 3 | CFLAGS=-Wall -O2 -g -fno-strict-aliasing -I. |
bellard | 83fb7ad | 2004-07-05 21:25:26 +0000 | [diff] [blame] | 4 | ifdef CONFIG_DARWIN |
| 5 | CFLAGS+= -mdynamic-no-pic |
| 6 | endif |
bellard | 31e31b8 | 2003-02-18 22:55:36 +0000 | [diff] [blame] | 7 | LDFLAGS=-g |
bellard | 766a487 | 2003-02-18 23:35:48 +0000 | [diff] [blame] | 8 | LIBS= |
bellard | d524939 | 2004-08-03 21:14:23 +0000 | [diff] [blame] | 9 | DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE |
bellard | e35c55f | 2004-11-16 01:44:03 +0000 | [diff] [blame] | 10 | TOOLS=qemu-img$(EXESUF) |
bellard | 1f50f8d | 2004-05-08 14:44:43 +0000 | [diff] [blame] | 11 | ifdef CONFIG_STATIC |
| 12 | LDFLAGS+=-static |
| 13 | endif |
bellard | acd935e | 2004-11-15 22:57:26 +0000 | [diff] [blame] | 14 | DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 15 | |
bellard | 8d5f07f | 2004-10-04 21:23:09 +0000 | [diff] [blame] | 16 | all: dyngen$(EXESUF) $(TOOLS) $(DOCS) |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 17 | for d in $(TARGET_DIRS); do \ |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 18 | $(MAKE) -C $$d $@ || exit 1 ; \ |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 19 | done |
bellard | 33e3963 | 2003-07-06 17:15:21 +0000 | [diff] [blame] | 20 | |
bellard | de167e4 | 2005-04-28 21:15:08 +0000 | [diff] [blame] | 21 | qemu-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 |
bellard | b932cab | 2004-08-01 21:46:49 +0000 | [diff] [blame] | 22 | $(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS) |
bellard | 47cea61 | 2004-05-17 20:06:42 +0000 | [diff] [blame] | 23 | |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 24 | dyngen$(EXESUF): dyngen.c |
| 25 | $(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^ |
bellard | 31e31b8 | 2003-02-18 22:55:36 +0000 | [diff] [blame] | 26 | |
| 27 | clean: |
bellard | 2d80ae8 | 2003-08-11 23:01:33 +0000 | [diff] [blame] | 28 | # 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 |
bellard | acd935e | 2004-11-15 22:57:26 +0000 | [diff] [blame] | 30 | rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~ |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 31 | $(MAKE) -C tests clean |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 32 | for d in $(TARGET_DIRS); do \ |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 33 | $(MAKE) -C $$d $@ || exit 1 ; \ |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 34 | done |
bellard | 31e31b8 | 2003-02-18 22:55:36 +0000 | [diff] [blame] | 35 | |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 36 | distclean: clean |
bellard | c72a345 | 2004-11-14 20:52:54 +0000 | [diff] [blame] | 37 | rm -f config-host.mak config-host.h |
bellard | 76bc683 | 2003-08-10 23:41:46 +0000 | [diff] [blame] | 38 | for d in $(TARGET_DIRS); do \ |
bellard | bc1b050 | 2003-10-28 00:12:52 +0000 | [diff] [blame] | 39 | rm -rf $$d || exit 1 ; \ |
bellard | 76bc683 | 2003-08-10 23:41:46 +0000 | [diff] [blame] | 40 | done |
bellard | 7d13299 | 2003-03-06 23:23:54 +0000 | [diff] [blame] | 41 | |
bellard | fed4a9a | 2004-12-12 22:18:34 +0000 | [diff] [blame] | 42 | KEYMAPS=da en-gb et fr fr-ch is lt modifiers no pt-br sv \ |
| 43 | ar de en-us fi fr-be hr it lv nl pl ru th \ |
| 44 | common de-ch es fo fr-ca hu ja mk nl-be pt sl tr |
| 45 | |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 46 | install: all |
pbrook | 1236cab | 2006-04-09 20:47:35 +0000 | [diff] [blame] | 47 | mkdir -p "$(DESTDIR)$(bindir)" |
pbrook | 6a88264 | 2006-04-17 13:57:12 +0000 | [diff] [blame^] | 48 | $(INSTALL) -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)" |
pbrook | 1236cab | 2006-04-09 20:47:35 +0000 | [diff] [blame] | 49 | mkdir -p "$(DESTDIR)$(datadir)" |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 50 | for x in bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \ |
| 51 | video.x proll.elf linux_boot.bin; do \ |
pbrook | 6a88264 | 2006-04-17 13:57:12 +0000 | [diff] [blame^] | 52 | $(INSTALL) -m 644 $(SRC_PATH)/pc-bios/$$x "$(DESTDIR)$(datadir)"; \ |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 53 | done |
pbrook | 1236cab | 2006-04-09 20:47:35 +0000 | [diff] [blame] | 54 | mkdir -p "$(DESTDIR)$(docdir)" |
pbrook | 6a88264 | 2006-04-17 13:57:12 +0000 | [diff] [blame^] | 55 | $(INSTALL) -m 644 qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)" |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 56 | ifndef CONFIG_WIN32 |
pbrook | 1236cab | 2006-04-09 20:47:35 +0000 | [diff] [blame] | 57 | mkdir -p "$(DESTDIR)$(mandir)/man1" |
pbrook | 6a88264 | 2006-04-17 13:57:12 +0000 | [diff] [blame^] | 58 | $(INSTALL) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1" |
pbrook | 1236cab | 2006-04-09 20:47:35 +0000 | [diff] [blame] | 59 | mkdir -p "$(DESTDIR)$(datadir)/keymaps" |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 60 | for x in $(KEYMAPS); do \ |
pbrook | 6a88264 | 2006-04-17 13:57:12 +0000 | [diff] [blame^] | 61 | $(INSTALL) -m 644 $(SRC_PATH)/keymaps/$$x "$(DESTDIR)$(datadir)/keymaps"; \ |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 62 | done |
bellard | 11d9f69 | 2004-04-02 20:55:59 +0000 | [diff] [blame] | 63 | endif |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 64 | for d in $(TARGET_DIRS); do \ |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 65 | $(MAKE) -C $$d $@ || exit 1 ; \ |
bellard | 626df76 | 2003-08-10 21:39:31 +0000 | [diff] [blame] | 66 | done |
bellard | 612384d | 2003-03-22 17:31:19 +0000 | [diff] [blame] | 67 | |
bellard | 367e86e | 2003-03-01 17:13:26 +0000 | [diff] [blame] | 68 | # various test targets |
bellard | 82c7e2a | 2004-01-04 16:10:33 +0000 | [diff] [blame] | 69 | test speed test2: all |
bellard | 7d3505c | 2004-05-12 19:32:15 +0000 | [diff] [blame] | 70 | $(MAKE) -C tests $@ |
bellard | 31e31b8 | 2003-02-18 22:55:36 +0000 | [diff] [blame] | 71 | |
bellard | 367e86e | 2003-03-01 17:13:26 +0000 | [diff] [blame] | 72 | TAGS: |
bellard | b9adb4a | 2003-04-29 20:41:16 +0000 | [diff] [blame] | 73 | etags *.[ch] tests/*.[ch] |
bellard | 31e31b8 | 2003-02-18 22:55:36 +0000 | [diff] [blame] | 74 | |
bellard | 6688bc6 | 2005-08-21 09:23:39 +0000 | [diff] [blame] | 75 | cscope: |
| 76 | rm -f ./cscope.* |
| 77 | find . -name "*.[ch]" -print > ./cscope.files |
| 78 | cscope -b |
| 79 | |
bellard | 3ef693a | 2003-03-23 20:17:16 +0000 | [diff] [blame] | 80 | # documentation |
bellard | 1f67313 | 2004-04-04 15:21:17 +0000 | [diff] [blame] | 81 | %.html: %.texi |
bellard | 3ef693a | 2003-03-23 20:17:16 +0000 | [diff] [blame] | 82 | texi2html -monolithic -number $< |
| 83 | |
bellard | 5a67135 | 2003-10-01 00:13:48 +0000 | [diff] [blame] | 84 | qemu.1: qemu-doc.texi |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 85 | $(SRC_PATH)/texi2pod.pl $< qemu.pod |
bellard | 5a67135 | 2003-10-01 00:13:48 +0000 | [diff] [blame] | 86 | pod2man --section=1 --center=" " --release=" " qemu.pod > $@ |
| 87 | |
bellard | acd935e | 2004-11-15 22:57:26 +0000 | [diff] [blame] | 88 | qemu-img.1: qemu-img.texi |
pbrook | ad06484 | 2006-04-16 12:41:07 +0000 | [diff] [blame] | 89 | $(SRC_PATH)/texi2pod.pl $< qemu-img.pod |
bellard | acd935e | 2004-11-15 22:57:26 +0000 | [diff] [blame] | 90 | pod2man --section=1 --center=" " --release=" " qemu-img.pod > $@ |
| 91 | |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 92 | FILE=qemu-$(shell cat VERSION) |
bellard | 586314f | 2003-03-03 15:02:29 +0000 | [diff] [blame] | 93 | |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 94 | # tar release (use 'make -k tar' on a checkouted tree) |
bellard | 586314f | 2003-03-03 15:02:29 +0000 | [diff] [blame] | 95 | tar: |
| 96 | rm -rf /tmp/$(FILE) |
bellard | 1e43adf | 2003-09-30 20:54:24 +0000 | [diff] [blame] | 97 | cp -r . /tmp/$(FILE) |
bellard | 76b62fd | 2003-10-28 00:47:44 +0000 | [diff] [blame] | 98 | ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS ) |
bellard | 586314f | 2003-03-03 15:02:29 +0000 | [diff] [blame] | 99 | rm -rf /tmp/$(FILE) |
| 100 | |
bellard | 76b62fd | 2003-10-28 00:47:44 +0000 | [diff] [blame] | 101 | # generate a binary distribution |
bellard | d691f66 | 2003-03-24 21:58:34 +0000 | [diff] [blame] | 102 | tarbin: |
bellard | 76b62fd | 2003-10-28 00:47:44 +0000 | [diff] [blame] | 103 | ( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \ |
bellard | 43095f3 | 2005-04-27 20:49:23 +0000 | [diff] [blame] | 104 | $(bindir)/qemu \ |
bellard | 7efa438 | 2004-05-12 18:54:06 +0000 | [diff] [blame] | 105 | $(bindir)/qemu-system-ppc \ |
bellard | acd935e | 2004-11-15 22:57:26 +0000 | [diff] [blame] | 106 | $(bindir)/qemu-system-sparc \ |
bellard | 43095f3 | 2005-04-27 20:49:23 +0000 | [diff] [blame] | 107 | $(bindir)/qemu-system-x86_64 \ |
bellard | 93856aa | 2005-07-24 18:44:35 +0000 | [diff] [blame] | 108 | $(bindir)/qemu-system-mips \ |
pbrook | 3826099 | 2006-03-11 14:51:13 +0000 | [diff] [blame] | 109 | $(bindir)/qemu-system-mipsel \ |
bellard | ea31eb5 | 2005-12-06 21:42:03 +0000 | [diff] [blame] | 110 | $(bindir)/qemu-system-arm \ |
bellard | 7efa438 | 2004-05-12 18:54:06 +0000 | [diff] [blame] | 111 | $(bindir)/qemu-i386 \ |
| 112 | $(bindir)/qemu-arm \ |
bellard | ea31eb5 | 2005-12-06 21:42:03 +0000 | [diff] [blame] | 113 | $(bindir)/qemu-armeb \ |
bellard | 7efa438 | 2004-05-12 18:54:06 +0000 | [diff] [blame] | 114 | $(bindir)/qemu-sparc \ |
| 115 | $(bindir)/qemu-ppc \ |
bellard | ea31eb5 | 2005-12-06 21:42:03 +0000 | [diff] [blame] | 116 | $(bindir)/qemu-mips \ |
| 117 | $(bindir)/qemu-mipsel \ |
bellard | b932cab | 2004-08-01 21:46:49 +0000 | [diff] [blame] | 118 | $(bindir)/qemu-img \ |
bellard | 7efa438 | 2004-05-12 18:54:06 +0000 | [diff] [blame] | 119 | $(datadir)/bios.bin \ |
| 120 | $(datadir)/vgabios.bin \ |
bellard | de9258a | 2004-06-06 15:50:03 +0000 | [diff] [blame] | 121 | $(datadir)/vgabios-cirrus.bin \ |
bellard | 637f6cd | 2004-06-21 19:54:47 +0000 | [diff] [blame] | 122 | $(datadir)/ppc_rom.bin \ |
bellard | d529525 | 2005-07-03 14:00:51 +0000 | [diff] [blame] | 123 | $(datadir)/video.x \ |
bellard | e80cfcf | 2004-12-19 23:18:01 +0000 | [diff] [blame] | 124 | $(datadir)/proll.elf \ |
bellard | 7efa438 | 2004-05-12 18:54:06 +0000 | [diff] [blame] | 125 | $(datadir)/linux_boot.bin \ |
bellard | 1f50f8d | 2004-05-08 14:44:43 +0000 | [diff] [blame] | 126 | $(docdir)/qemu-doc.html \ |
| 127 | $(docdir)/qemu-tech.html \ |
bellard | acd935e | 2004-11-15 22:57:26 +0000 | [diff] [blame] | 128 | $(mandir)/man1/qemu.1 $(mandir)/man1/qemu-img.1 ) |
bellard | d691f66 | 2003-03-24 21:58:34 +0000 | [diff] [blame] | 129 | |
bellard | 31e31b8 | 2003-02-18 22:55:36 +0000 | [diff] [blame] | 130 | ifneq ($(wildcard .depend),) |
| 131 | include .depend |
| 132 | endif |