]> git.proxmox.com Git - qemu.git/blame - Makefile
test infrastructure
[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
367e86e8
FB
33DEFINES+=-D_GNU_SOURCE -DGEMU -DDOSEMU -DNO_TRACE_MSGS
34DEFINES+=-DCONFIG_PREFIX=\"/usr/local\"
766a487a 35LDSCRIPT=$(ARCH).ld
927f621e 36LIBS+=-ldl -lm
31e31b8a
FB
37
38OBJS= i386/fp87.o i386/interp_main.o i386/interp_modrm.o i386/interp_16_32.o \
39 i386/interp_32_16.o i386/interp_32_32.o i386/emu-utils.o \
40 i386/dis8086.o i386/emu-ldt.o
367e86e8 41OBJS+=translate-i386.o op-i386.o
31e31b8a 42OBJS+= elfload.o main.o thunk.o syscall.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# old i386 emulator
54i386/interp_32_32.o: i386/interp_32_32.c i386/interp_gen.h
55
56i386/interp_gen.h: i386/gencode
57 ./i386/gencode > $@
58
59i386/gencode: i386/gencode.c
60 $(CC) -O2 -Wall -g $< -o $@
61
62# new i386 emulator
63dyngen: dyngen.c
64 $(HOST_CC) -O2 -Wall -g $< -o $@
65
66translate-i386.o: translate-i386.c op-i386.h cpu-i386.h
67
68op-i386.h: op-i386.o dyngen
69 ./dyngen -o $@ $<
70
71op-i386.o: op-i386.c opreg_template.h ops_template.h
927f621e 72 $(CC) $(OP_CFLAGS) $(DEFINES) -c -o $@ $<
367e86e8 73
31e31b8a
FB
74%.o: %.c
75 $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
76
77clean:
367e86e8 78 rm -f *.o *~ i386/*.o i386/*~ gemu TAGS
31e31b8a 79
367e86e8
FB
80# various test targets
81test speed: gemu
82 make -C tests $@
31e31b8a 83
367e86e8
FB
84TAGS:
85 etags *.[ch] i386/*.[ch]
31e31b8a
FB
86
87ifneq ($(wildcard .depend),)
88include .depend
89endif