]> git.proxmox.com Git - mirror_qemu.git/blame - Makefile
more syscalls
[mirror_qemu.git] / Makefile
CommitLineData
7d13299d 1include config.mak
766a487a 2
7d13299d 3CFLAGS=-Wall -O2 -g
31e31b8a 4LDFLAGS=-g
766a487a 5LIBS=
766a487a 6DEFINES=-DHAVE_BYTESWAP_H
7d13299d
FB
7
8ifeq ($(ARCH),i386)
9CFLAGS+=-fomit-frame-pointer
ca735206
FB
10OP_CFLAGS=$(CFLAGS) -mpreferred-stack-boundary=2
11ifeq ($(GCC_MAJOR),3)
12OP_CFLAGS+= -falign-functions=0
13else
14OP_CFLAGS+= -malign-functions=0
15endif
766a487a
FB
16endif
17
18ifeq ($(ARCH),ppc)
927f621e 19OP_CFLAGS=$(CFLAGS)
766a487a
FB
20endif
21
ca735206
FB
22ifeq ($(GCC_MAJOR),3)
23# very important to generate a return at the end of every operation
24OP_CFLAGS+=-fno-reorder-blocks -fno-optimize-sibling-calls
25endif
26
766a487a
FB
27#########################################################
28
0ecfa993 29DEFINES+=-D_GNU_SOURCE
766a487a 30LDSCRIPT=$(ARCH).ld
927f621e 31LIBS+=-ldl -lm
7d13299d
FB
32
33# profiling code
34ifdef TARGET_GPROF
35LDFLAGS+=-p
dc99065b 36main.o: CFLAGS+=-p
7d13299d 37endif
31e31b8a 38
66fb9763 39OBJS= elfload.o main.o thunk.o syscall.o signal.o libgemu.a
612384d7
FB
40
41LIBOBJS+=translate-i386.o op-i386.o exec-i386.o
0ecfa993 42# NOTE: the disassembler code is only needed for debugging
612384d7 43LIBOBJS+=i386-dis.o dis-buf.o
31e31b8a
FB
44SRCS = $(OBJS:.o=.c)
45
46all: gemu
47
48gemu: $(OBJS)
612384d7 49 $(CC) -Wl,-T,$(LDSCRIPT) $(LDFLAGS) -o $@ $^ $(LIBS)
31e31b8a
FB
50
51depend: $(SRCS)
52 $(CC) -MM $(CFLAGS) $^ 1>.depend
53
612384d7
FB
54# libgemu
55
56libgemu.a: $(LIBOBJS)
57 rm -f $@
58 $(AR) rcs $@ $(LIBOBJS)
59
367e86e8
FB
60dyngen: dyngen.c
61 $(HOST_CC) -O2 -Wall -g $< -o $@
62
63translate-i386.o: translate-i386.c op-i386.h cpu-i386.h
64
65op-i386.h: op-i386.o dyngen
66 ./dyngen -o $@ $<
67
68op-i386.o: op-i386.c opreg_template.h ops_template.h
927f621e 69 $(CC) $(OP_CFLAGS) $(DEFINES) -c -o $@ $<
367e86e8 70
31e31b8a
FB
71%.o: %.c
72 $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
73
74clean:
7d13299d 75 $(MAKE) -C tests clean
612384d7 76 rm -f *.o *.a *~ gemu dyngen TAGS
31e31b8a 77
7d13299d
FB
78distclean: clean
79 rm -f config.mak config.h
80
612384d7
FB
81install: gemu
82 install -m755 -s gemu $(prefix)/bin
83
367e86e8
FB
84# various test targets
85test speed: gemu
86 make -C tests $@
31e31b8a 87
367e86e8
FB
88TAGS:
89 etags *.[ch] i386/*.[ch]
31e31b8a 90
586314f2
FB
91FILES= \
92COPYING.LIB dyngen.c ioctls.h ops_template.h syscall_types.h\
93Makefile elf.h linux_bin.h segment.h thunk.c\
94TODO elfload.c main.c signal.c thunk.h\
68decc7c 95cpu-i386.h gemu.h op-i386.c opc-i386.h syscall-i386.h translate-i386.c\
586314f2
FB
96dis-asm.h gen-i386.h op-i386.h syscall.c\
97dis-buf.c i386-dis.c opreg_template.h syscall_defs.h\
7d13299d 98i386.ld ppc.ld exec-i386.h exec-i386.c configure VERSION \
77f8dd5a 99tests/Makefile\
586314f2 100tests/test-i386.c tests/test-i386-shift.h tests/test-i386.h\
612384d7
FB
101tests/test-i386-muldiv.h tests/test-i386-code16.S\
102tests/hello.c tests/hello tests/sha1.c \
103tests/testsig.c tests/testclone.c tests/testthread.c
586314f2
FB
104
105FILE=gemu-$(VERSION)
106
107tar:
108 rm -rf /tmp/$(FILE)
109 mkdir -p /tmp/$(FILE)
110 cp -P $(FILES) /tmp/$(FILE)
111 ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) )
112 rm -rf /tmp/$(FILE)
113
31e31b8a
FB
114ifneq ($(wildcard .depend),)
115include .depend
116endif