blob: 15506a19c09efad5ea8158557902328b05450097 [file] [log] [blame]
bellard626df762003-08-10 21:39:31 +00001include config-host.mak
bellard766a4872003-02-18 23:35:48 +00002
bellard7d132992003-03-06 23:23:54 +00003CFLAGS=-Wall -O2 -g
bellard67b915a2004-03-31 23:37:16 +00004ifdef CONFIG_WIN32
5CFLAGS+=-fpack-struct
6endif
bellard31e31b82003-02-18 22:55:36 +00007LDFLAGS=-g
bellard766a4872003-02-18 23:35:48 +00008LIBS=
bellard0ecfa992003-03-03 14:32:43 +00009DEFINES+=-D_GNU_SOURCE
bellard67b915a2004-03-31 23:37:16 +000010ifndef CONFIG_WIN32
bellard1e43adf2003-09-30 20:54:24 +000011TOOLS=qemu-mkcow
bellard67b915a2004-03-31 23:37:16 +000012endif
bellard7d132992003-03-06 23:23:54 +000013
bellard1f673132004-04-04 15:21:17 +000014all: dyngen$(EXESUF) $(TOOLS) qemu-doc.html qemu-tech.html qemu.1
bellard626df762003-08-10 21:39:31 +000015 for d in $(TARGET_DIRS); do \
16 make -C $$d $@ || exit 1 ; \
17 done
bellard33e39632003-07-06 17:15:21 +000018
bellard11d9f692004-04-02 20:55:59 +000019qemu-mkcow: qemu-mkcow.c
20 $(CC) $(CFLAGS) $(DEFINES) -o $@ $^ $(LIBS)
bellard0824d6f2003-06-24 13:42:40 +000021
bellard11d9f692004-04-02 20:55:59 +000022dyngen$(EXESUF): dyngen.c
23 $(HOST_CC) $(CFLAGS) $(DEFINES) -o $@ $^
bellard31e31b82003-02-18 22:55:36 +000024
25clean:
bellard2d80ae82003-08-11 23:01:33 +000026# avoid old build problems by removing potentially incorrect old files
27 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
bellard67b915a2004-03-31 23:37:16 +000028 rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS qemu.pod
bellard68e73e32004-01-25 15:47:27 +000029 make -C tests clean
bellard626df762003-08-10 21:39:31 +000030 for d in $(TARGET_DIRS); do \
31 make -C $$d $@ || exit 1 ; \
32 done
bellard31e31b82003-02-18 22:55:36 +000033
bellard7d132992003-03-06 23:23:54 +000034distclean: clean
bellard2d80ae82003-08-11 23:01:33 +000035 rm -f config-host.mak config-host.h
bellard76bc6832003-08-10 23:41:46 +000036 for d in $(TARGET_DIRS); do \
bellardbc1b0502003-10-28 00:12:52 +000037 rm -rf $$d || exit 1 ; \
bellard76bc6832003-08-10 23:41:46 +000038 done
bellard7d132992003-03-06 23:23:54 +000039
bellard626df762003-08-10 21:39:31 +000040install: all
bellard11d9f692004-04-02 20:55:59 +000041 mkdir -p "$(bindir)"
42ifndef CONFIG_WIN32
43 install -m 755 -s $(TOOLS) "$(bindir)"
44endif
45 mkdir -p "$(sharedir)"
bellarda735aa32004-02-25 23:54:25 +000046 install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin \
bellard11d9f692004-04-02 20:55:59 +000047 pc-bios/linux_boot.bin "$(sharedir)"
48ifndef CONFIG_WIN32
49 mkdir -p "$(mandir)/man1"
50 install qemu.1 qemu-mkcow.1 "$(mandir)/man1"
51endif
bellard626df762003-08-10 21:39:31 +000052 for d in $(TARGET_DIRS); do \
53 make -C $$d $@ || exit 1 ; \
54 done
bellard612384d2003-03-22 17:31:19 +000055
bellard367e86e2003-03-01 17:13:26 +000056# various test targets
bellard82c7e2a2004-01-04 16:10:33 +000057test speed test2: all
bellard367e86e2003-03-01 17:13:26 +000058 make -C tests $@
bellard31e31b82003-02-18 22:55:36 +000059
bellard367e86e2003-03-01 17:13:26 +000060TAGS:
bellardb9adb4a2003-04-29 20:41:16 +000061 etags *.[ch] tests/*.[ch]
bellard31e31b82003-02-18 22:55:36 +000062
bellard3ef693a2003-03-23 20:17:16 +000063# documentation
bellard1f673132004-04-04 15:21:17 +000064%.html: %.texi
bellard3ef693a2003-03-23 20:17:16 +000065 texi2html -monolithic -number $<
66
bellard5a671352003-10-01 00:13:48 +000067qemu.1: qemu-doc.texi
68 ./texi2pod.pl $< qemu.pod
69 pod2man --section=1 --center=" " --release=" " qemu.pod > $@
70
bellard1e43adf2003-09-30 20:54:24 +000071FILE=qemu-$(shell cat VERSION)
bellard586314f2003-03-03 15:02:29 +000072
bellard1e43adf2003-09-30 20:54:24 +000073# tar release (use 'make -k tar' on a checkouted tree)
bellard586314f2003-03-03 15:02:29 +000074tar:
75 rm -rf /tmp/$(FILE)
bellard1e43adf2003-09-30 20:54:24 +000076 cp -r . /tmp/$(FILE)
bellard76b62fd2003-10-28 00:47:44 +000077 ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
bellard586314f2003-03-03 15:02:29 +000078 rm -rf /tmp/$(FILE)
79
bellard76b62fd2003-10-28 00:47:44 +000080# generate a binary distribution
bellardd691f662003-03-24 21:58:34 +000081tarbin:
bellard76b62fd2003-10-28 00:47:44 +000082 ( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
83 $(prefix)/bin/qemu $(prefix)/bin/qemu-fast \
84 $(prefix)/bin/qemu-i386 \
85 $(prefix)/bin/qemu-arm \
86 $(prefix)/bin/qemu-sparc \
bellardc0637b32004-01-25 15:38:01 +000087 $(prefix)/bin/qemu-ppc \
bellard76b62fd2003-10-28 00:47:44 +000088 $(sharedir)/bios.bin \
89 $(sharedir)/vgabios.bin \
90 $(mandir)/man1/qemu.1 )
bellardd691f662003-03-24 21:58:34 +000091
bellard31e31b82003-02-18 22:55:36 +000092ifneq ($(wildcard .depend),)
93include .depend
94endif