]> git.proxmox.com Git - mirror_qemu.git/blame - Makefile
convert several x86 instructions at the same time
[mirror_qemu.git] / Makefile
CommitLineData
766a487a
FB
1ARCH=i386
2#ARCH=ppc
367e86e8 3HOST_CC=gcc
766a487a
FB
4
5ifeq ($(ARCH),i386)
367e86e8 6CFLAGS=-Wall -O2 -g -fomit-frame-pointer
31e31b8a 7LDFLAGS=-g
766a487a
FB
8LIBS=
9CC=gcc
10DEFINES=-DHAVE_BYTESWAP_H
927f621e 11OP_CFLAGS=$(CFLAGS) -malign-functions=0 -mpreferred-stack-boundary=2
766a487a
FB
12endif
13
14ifeq ($(ARCH),ppc)
15GCC_LIBS_DIR=/usr/netgem/tools/lib/gcc-lib/powerpc-linux/2.95.2
16DIST=/home/fbe/nsv/dist/hw/n6-dtt
17CC=powerpc-linux-gcc -msoft-float
18CFLAGS=-Wall -pipe -O2 -mcpu=405 -mbig -nostdinc -g -I$(GCC_LIBS_DIR)/include -I$(DIST)/include
19LIBS_DIR=$(DIST)/lib
20CRT1=$(LIBS_DIR)/crt1.o
21CRTI=$(LIBS_DIR)/crti.o
22CRTN=$(LIBS_DIR)/crtn.o
23CRTBEGIN=$(GCC_LIBS_DIR)/crtbegin.o
24CRTEND=$(GCC_LIBS_DIR)/crtend.o
25LDFLAGS=-static -g -nostdlib $(CRT1) $(CRTI) $(CRTBEGIN)
26LIBS=-L$(LIBS_DIR) -ltinyc -lgcc $(CRTEND) $(CRTN)
27DEFINES=-Dsocklen_t=int
927f621e 28OP_CFLAGS=$(CFLAGS)
766a487a
FB
29endif
30
31#########################################################
32
0ecfa993 33DEFINES+=-D_GNU_SOURCE
367e86e8 34DEFINES+=-DCONFIG_PREFIX=\"/usr/local\"
766a487a 35LDSCRIPT=$(ARCH).ld
927f621e 36LIBS+=-ldl -lm
586314f2 37VERSION=0.1
31e31b8a 38
586314f2 39OBJS= elfload.o main.o thunk.o syscall.o
367e86e8 40OBJS+=translate-i386.o op-i386.o
0ecfa993
FB
41# NOTE: the disassembler code is only needed for debugging
42OBJS+=i386-dis.o dis-buf.o
31e31b8a
FB
43SRCS = $(OBJS:.o=.c)
44
45all: gemu
46
47gemu: $(OBJS)
367e86e8 48 $(CC) -Wl,-T,$(LDSCRIPT) $(LDFLAGS) -o $@ $^ $(LIBS)
31e31b8a
FB
49
50depend: $(SRCS)
51 $(CC) -MM $(CFLAGS) $^ 1>.depend
52
367e86e8
FB
53# new i386 emulator
54dyngen: dyngen.c
55 $(HOST_CC) -O2 -Wall -g $< -o $@
56
57translate-i386.o: translate-i386.c op-i386.h cpu-i386.h
58
59op-i386.h: op-i386.o dyngen
60 ./dyngen -o $@ $<
61
62op-i386.o: op-i386.c opreg_template.h ops_template.h
927f621e 63 $(CC) $(OP_CFLAGS) $(DEFINES) -c -o $@ $<
367e86e8 64
31e31b8a
FB
65%.o: %.c
66 $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
67
68clean:
586314f2 69 rm -f *.o *~ gemu dyngen TAGS
31e31b8a 70
367e86e8
FB
71# various test targets
72test speed: gemu
73 make -C tests $@
31e31b8a 74
367e86e8
FB
75TAGS:
76 etags *.[ch] i386/*.[ch]
31e31b8a 77
586314f2
FB
78FILES= \
79COPYING.LIB dyngen.c ioctls.h ops_template.h syscall_types.h\
80Makefile elf.h linux_bin.h segment.h thunk.c\
81TODO elfload.c main.c signal.c thunk.h\
82cpu-i386.h gemu.h op-i386.c syscall-i386.h translate-i386.c\
83dis-asm.h gen-i386.h op-i386.h syscall.c\
84dis-buf.c i386-dis.c opreg_template.h syscall_defs.h\
85i386.ld ppc.ld\
77f8dd5a 86tests/Makefile\
586314f2 87tests/test-i386.c tests/test-i386-shift.h tests/test-i386.h\
d57c4e01 88tests/test-i386-muldiv.h\
1017ebe9 89tests/test2.c tests/hello.c tests/sha1.c
586314f2
FB
90
91FILE=gemu-$(VERSION)
92
93tar:
94 rm -rf /tmp/$(FILE)
95 mkdir -p /tmp/$(FILE)
96 cp -P $(FILES) /tmp/$(FILE)
97 ( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) )
98 rm -rf /tmp/$(FILE)
99
31e31b8a
FB
100ifneq ($(wildcard .depend),)
101include .depend
102endif