root / Makefile @ 78c34e98
History | View | Annotate | Download (3.6 kB)
1 | 7d13299d | bellard | include config.mak |
---|---|---|---|
2 | 766a487a | bellard | |
3 | 7d13299d | bellard | CFLAGS=-Wall -O2 -g |
4 | 31e31b8a | bellard | LDFLAGS=-g |
5 | 766a487a | bellard | LIBS= |
6 | 766a487a | bellard | DEFINES=-DHAVE_BYTESWAP_H |
7 | 7d13299d | bellard | |
8 | 7d13299d | bellard | ifeq ($(ARCH),i386) |
9 | 7d13299d | bellard | CFLAGS+=-fomit-frame-pointer |
10 | ca735206 | bellard | OP_CFLAGS=$(CFLAGS) -mpreferred-stack-boundary=2 |
11 | ca735206 | bellard | ifeq ($(GCC_MAJOR),3) |
12 | ca735206 | bellard | OP_CFLAGS+= -falign-functions=0 |
13 | ca735206 | bellard | else |
14 | ca735206 | bellard | OP_CFLAGS+= -malign-functions=0 |
15 | ca735206 | bellard | endif |
16 | 27c75a9a | bellard | # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object |
17 | 27c75a9a | bellard | # that the kernel ELF loader considers as an executable. I think this |
18 | 27c75a9a | bellard | # is the simplest way to make it self virtualizable! |
19 | 27c75a9a | bellard | LDFLAGS+=-Wl,-shared |
20 | 766a487a | bellard | endif |
21 | 766a487a | bellard | |
22 | 766a487a | bellard | ifeq ($(ARCH),ppc) |
23 | 927f621e | bellard | OP_CFLAGS=$(CFLAGS) |
24 | 27c75a9a | bellard | LDFLAGS+=-Wl,-T,ppc.ld |
25 | 766a487a | bellard | endif |
26 | 766a487a | bellard | |
27 | fd429f2f | bellard | ifeq ($(ARCH),s390) |
28 | fd429f2f | bellard | OP_CFLAGS=$(CFLAGS) |
29 | 27c75a9a | bellard | LDFLAGS+=-Wl,-T,s390.ld |
30 | fd429f2f | bellard | endif |
31 | fd429f2f | bellard | |
32 | d6cdca95 | bellard | ifeq ($(ARCH),alpha) |
33 | d6cdca95 | bellard | # Ensure there's only a single GP |
34 | d6cdca95 | bellard | CFLAGS += -msmall-data -msmall-text |
35 | d6cdca95 | bellard | # FIXME Too lazy to deal with gprelhigh/gprellow for now, inhibit them |
36 | d6cdca95 | bellard | OP_CFLAGS=$(CFLAGS) -mno-explicit-relocs |
37 | d6cdca95 | bellard | LDFLAGS+=-Wl,-T,alpha.ld |
38 | d6cdca95 | bellard | endif |
39 | d6cdca95 | bellard | |
40 | d6cdca95 | bellard | ifeq ($(ARCH),ia64) |
41 | d6cdca95 | bellard | OP_CFLAGS=$(CFLAGS) |
42 | d6cdca95 | bellard | endif |
43 | d6cdca95 | bellard | |
44 | ca735206 | bellard | ifeq ($(GCC_MAJOR),3) |
45 | ca735206 | bellard | # very important to generate a return at the end of every operation |
46 | ca735206 | bellard | OP_CFLAGS+=-fno-reorder-blocks -fno-optimize-sibling-calls |
47 | ca735206 | bellard | endif |
48 | ca735206 | bellard | |
49 | 766a487a | bellard | ######################################################### |
50 | 766a487a | bellard | |
51 | 0ecfa993 | bellard | DEFINES+=-D_GNU_SOURCE |
52 | 3ef693a0 | bellard | LIBS+=-lm |
53 | 7d13299d | bellard | |
54 | 7d13299d | bellard | # profiling code |
55 | 7d13299d | bellard | ifdef TARGET_GPROF |
56 | 7d13299d | bellard | LDFLAGS+=-p |
57 | dc99065b | bellard | main.o: CFLAGS+=-p |
58 | 7d13299d | bellard | endif |
59 | 31e31b8a | bellard | |
60 | e84be9db | bellard | OBJS= elfload.o main.o syscall.o signal.o vm86.o path.o |
61 | 3ef693a0 | bellard | SRCS:= $(OBJS:.o=.c) |
62 | 3ef693a0 | bellard | OBJS+= libqemu.a |
63 | 612384d7 | bellard | |
64 | 3ef693a0 | bellard | LIBOBJS+=thunk.o translate-i386.o op-i386.o exec-i386.o |
65 | 0ecfa993 | bellard | # NOTE: the disassembler code is only needed for debugging |
66 | b9adb4a6 | bellard | LIBOBJS+=disas.o ppc-dis.o i386-dis.o dis-buf.o |
67 | 31e31b8a | bellard | |
68 | d6cdca95 | bellard | ifeq ($(ARCH),ia64) |
69 | d6cdca95 | bellard | OBJS += ia64-syscall.o |
70 | d6cdca95 | bellard | endif |
71 | d6cdca95 | bellard | |
72 | 3ef693a0 | bellard | all: qemu qemu-doc.html |
73 | 31e31b8a | bellard | |
74 | 3ef693a0 | bellard | qemu: $(OBJS) |
75 | 27c75a9a | bellard | $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) |
76 | 31e31b8a | bellard | |
77 | 31e31b8a | bellard | depend: $(SRCS) |
78 | 31e31b8a | bellard | $(CC) -MM $(CFLAGS) $^ 1>.depend |
79 | 31e31b8a | bellard | |
80 | 3ef693a0 | bellard | # libqemu |
81 | 612384d7 | bellard | |
82 | 3ef693a0 | bellard | libqemu.a: $(LIBOBJS) |
83 | 612384d7 | bellard | rm -f $@ |
84 | 612384d7 | bellard | $(AR) rcs $@ $(LIBOBJS) |
85 | 612384d7 | bellard | |
86 | 367e86e8 | bellard | dyngen: dyngen.c |
87 | 367e86e8 | bellard | $(HOST_CC) -O2 -Wall -g $< -o $@ |
88 | 367e86e8 | bellard | |
89 | 367e86e8 | bellard | translate-i386.o: translate-i386.c op-i386.h cpu-i386.h |
90 | 367e86e8 | bellard | |
91 | 367e86e8 | bellard | op-i386.h: op-i386.o dyngen |
92 | 367e86e8 | bellard | ./dyngen -o $@ $< |
93 | 367e86e8 | bellard | |
94 | 367e86e8 | bellard | op-i386.o: op-i386.c opreg_template.h ops_template.h |
95 | 927f621e | bellard | $(CC) $(OP_CFLAGS) $(DEFINES) -c -o $@ $< |
96 | 367e86e8 | bellard | |
97 | 31e31b8a | bellard | %.o: %.c |
98 | 31e31b8a | bellard | $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< |
99 | 31e31b8a | bellard | |
100 | 31e31b8a | bellard | clean: |
101 | 7d13299d | bellard | $(MAKE) -C tests clean |
102 | 3ef693a0 | bellard | rm -f *.o *.a *~ qemu dyngen TAGS |
103 | 31e31b8a | bellard | |
104 | 7d13299d | bellard | distclean: clean |
105 | 7d13299d | bellard | rm -f config.mak config.h |
106 | 7d13299d | bellard | |
107 | 3ef693a0 | bellard | install: qemu |
108 | 3ef693a0 | bellard | install -m 755 -s qemu $(prefix)/bin |
109 | 612384d7 | bellard | |
110 | 367e86e8 | bellard | # various test targets |
111 | 3ef693a0 | bellard | test speed: qemu |
112 | 367e86e8 | bellard | make -C tests $@ |
113 | 31e31b8a | bellard | |
114 | 367e86e8 | bellard | TAGS: |
115 | b9adb4a6 | bellard | etags *.[ch] tests/*.[ch] |
116 | 31e31b8a | bellard | |
117 | 3ef693a0 | bellard | # documentation |
118 | 3ef693a0 | bellard | qemu-doc.html: qemu-doc.texi |
119 | 3ef693a0 | bellard | texi2html -monolithic -number $< |
120 | 3ef693a0 | bellard | |
121 | 586314f2 | bellard | FILES= \ |
122 | fd429f2f | bellard | README README.distrib COPYING COPYING.LIB TODO Changelog VERSION \ |
123 | fd429f2f | bellard | dyngen.c ioctls.h ops_template.h op_string.h syscall_types.h\ |
124 | 09bfb054 | bellard | Makefile elf.h thunk.c\ |
125 | 3ef693a0 | bellard | elfload.c main.c signal.c thunk.h\ |
126 | fd429f2f | bellard | cpu-i386.h qemu.h op-i386.c opc-i386.h syscall-i386.h translate-i386.c\ |
127 | 27c75a9a | bellard | dis-asm.h gen-i386.h syscall.c\ |
128 | b9adb4a6 | bellard | dis-buf.c disas.c disas.h ppc-dis.c i386-dis.c opreg_template.h syscall_defs.h\ |
129 | 1eb87257 | bellard | ppc.ld s390.ld exec-i386.h exec-i386.c path.c configure \ |
130 | 77f8dd5a | bellard | tests/Makefile\ |
131 | 586314f2 | bellard | tests/test-i386.c tests/test-i386-shift.h tests/test-i386.h\ |
132 | 612384d7 | bellard | tests/test-i386-muldiv.h tests/test-i386-code16.S\ |
133 | 612384d7 | bellard | tests/hello.c tests/hello tests/sha1.c \ |
134 | 3ef693a0 | bellard | tests/testsig.c tests/testclone.c tests/testthread.c \ |
135 | fd429f2f | bellard | tests/runcom.c tests/pi_10.com \ |
136 | 1eb87257 | bellard | tests/test_path.c \ |
137 | 3ef693a0 | bellard | qemu-doc.texi qemu-doc.html |
138 | 586314f2 | bellard | |
139 | 3ef693a0 | bellard | FILE=qemu-$(VERSION) |
140 | 586314f2 | bellard | |
141 | 586314f2 | bellard | tar: |
142 | 586314f2 | bellard | rm -rf /tmp/$(FILE) |
143 | 586314f2 | bellard | mkdir -p /tmp/$(FILE) |
144 | 586314f2 | bellard | cp -P $(FILES) /tmp/$(FILE) |
145 | 586314f2 | bellard | ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) ) |
146 | 586314f2 | bellard | rm -rf /tmp/$(FILE) |
147 | 586314f2 | bellard | |
148 | d691f669 | bellard | # generate a binary distribution including the test binary environnment |
149 | d691f669 | bellard | BINPATH=/usr/local/qemu-i386 |
150 | d691f669 | bellard | |
151 | d691f669 | bellard | tarbin: |
152 | 1eb87257 | bellard | tar zcvf /tmp/qemu-$(VERSION)-i386-glibc21.tar.gz \ |
153 | 1eb87257 | bellard | $(BINPATH)/etc $(BINPATH)/lib $(BINPATH)/bin $(BINPATH)/usr |
154 | 1eb87257 | bellard | tar zcvf /tmp/qemu-$(VERSION)-i386-wine.tar.gz \ |
155 | 1eb87257 | bellard | $(BINPATH)/wine |
156 | d691f669 | bellard | |
157 | 31e31b8a | bellard | ifneq ($(wildcard .depend),) |
158 | 31e31b8a | bellard | include .depend |
159 | 31e31b8a | bellard | endif |