blob: 401776a4ecadca19b83c231ea5caf3101cf02404 [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
bellard31e31b82003-02-18 22:55:36 +00004LDFLAGS=-g
bellard766a4872003-02-18 23:35:48 +00005LIBS=
bellard0ecfa992003-03-03 14:32:43 +00006DEFINES+=-D_GNU_SOURCE
bellard1e43adf2003-09-30 20:54:24 +00007TOOLS=qemu-mkcow
bellard7d132992003-03-06 23:23:54 +00008
bellard5a671352003-10-01 00:13:48 +00009all: dyngen $(TOOLS) qemu-doc.html qemu.1
bellard626df762003-08-10 21:39:31 +000010 for d in $(TARGET_DIRS); do \
11 make -C $$d $@ || exit 1 ; \
12 done
bellard33e39632003-07-06 17:15:21 +000013
bellard1e43adf2003-09-30 20:54:24 +000014qemu-mkcow: qemu-mkcow.o
bellard626df762003-08-10 21:39:31 +000015 $(HOST_CC) -o $@ $^ $(LIBS)
bellard0824d6f2003-06-24 13:42:40 +000016
bellard626df762003-08-10 21:39:31 +000017dyngen: dyngen.o
18 $(HOST_CC) -o $@ $^ $(LIBS)
bellardde83cd02003-06-15 20:25:43 +000019
bellard31e31b82003-02-18 22:55:36 +000020%.o: %.c
bellard626df762003-08-10 21:39:31 +000021 $(HOST_CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
bellard31e31b82003-02-18 22:55:36 +000022
23clean:
bellard2d80ae82003-08-11 23:01:33 +000024# avoid old build problems by removing potentially incorrect old files
25 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
bellard5a671352003-10-01 00:13:48 +000026 rm -f *.o *.a $(TOOLS) dyngen TAGS qemu.pod
bellard626df762003-08-10 21:39:31 +000027 for d in $(TARGET_DIRS); do \
28 make -C $$d $@ || exit 1 ; \
29 done
bellard31e31b82003-02-18 22:55:36 +000030
bellard7d132992003-03-06 23:23:54 +000031distclean: clean
bellard2d80ae82003-08-11 23:01:33 +000032 rm -f config-host.mak config-host.h
bellard76bc6832003-08-10 23:41:46 +000033 for d in $(TARGET_DIRS); do \
bellardbc1b0502003-10-28 00:12:52 +000034 rm -rf $$d || exit 1 ; \
bellard76bc6832003-08-10 23:41:46 +000035 done
bellard7d132992003-03-06 23:23:54 +000036
bellard626df762003-08-10 21:39:31 +000037install: all
bellardd5a0b502003-06-27 12:02:03 +000038 mkdir -p $(prefix)/bin
bellard626df762003-08-10 21:39:31 +000039 install -m 755 -s $(TOOLS) $(prefix)/bin
bellard5a671352003-10-01 00:13:48 +000040 mkdir -p $(sharedir)
41 install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin $(sharedir)
42 mkdir -p $(mandir)/man1
43 install qemu.1 $(mandir)/man1
bellard626df762003-08-10 21:39:31 +000044 for d in $(TARGET_DIRS); do \
45 make -C $$d $@ || exit 1 ; \
46 done
bellard612384d2003-03-22 17:31:19 +000047
bellard367e86e2003-03-01 17:13:26 +000048# various test targets
bellard82c7e2a2004-01-04 16:10:33 +000049test speed test2: all
bellard367e86e2003-03-01 17:13:26 +000050 make -C tests $@
bellard31e31b82003-02-18 22:55:36 +000051
bellard367e86e2003-03-01 17:13:26 +000052TAGS:
bellardb9adb4a2003-04-29 20:41:16 +000053 etags *.[ch] tests/*.[ch]
bellard31e31b82003-02-18 22:55:36 +000054
bellard3ef693a2003-03-23 20:17:16 +000055# documentation
56qemu-doc.html: qemu-doc.texi
57 texi2html -monolithic -number $<
58
bellard5a671352003-10-01 00:13:48 +000059qemu.1: qemu-doc.texi
60 ./texi2pod.pl $< qemu.pod
61 pod2man --section=1 --center=" " --release=" " qemu.pod > $@
62
bellard1e43adf2003-09-30 20:54:24 +000063FILE=qemu-$(shell cat VERSION)
bellard586314f2003-03-03 15:02:29 +000064
bellard1e43adf2003-09-30 20:54:24 +000065# tar release (use 'make -k tar' on a checkouted tree)
bellard586314f2003-03-03 15:02:29 +000066tar:
67 rm -rf /tmp/$(FILE)
bellard1e43adf2003-09-30 20:54:24 +000068 cp -r . /tmp/$(FILE)
bellard76b62fd2003-10-28 00:47:44 +000069 ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS )
bellard586314f2003-03-03 15:02:29 +000070 rm -rf /tmp/$(FILE)
71
bellard76b62fd2003-10-28 00:47:44 +000072# generate a binary distribution
bellardd691f662003-03-24 21:58:34 +000073tarbin:
bellard76b62fd2003-10-28 00:47:44 +000074 ( cd / ; tar zcvf ~/qemu-$(VERSION)-i386.tar.gz \
75 $(prefix)/bin/qemu $(prefix)/bin/qemu-fast \
76 $(prefix)/bin/qemu-i386 \
77 $(prefix)/bin/qemu-arm \
78 $(prefix)/bin/qemu-sparc \
79 $(sharedir)/bios.bin \
80 $(sharedir)/vgabios.bin \
81 $(mandir)/man1/qemu.1 )
bellardd691f662003-03-24 21:58:34 +000082
bellard31e31b82003-02-18 22:55:36 +000083ifneq ($(wildcard .depend),)
84include .depend
85endif