]> git.proxmox.com Git - qemu.git/blob - Makefile
new x86 CPU core
[qemu.git] / Makefile
1 ARCH=i386
2 #ARCH=ppc
3 HOST_CC=gcc
4
5 ifeq ($(ARCH),i386)
6 CFLAGS=-Wall -O2 -g -fomit-frame-pointer
7 LDFLAGS=-g
8 LIBS=
9 CC=gcc
10 DEFINES=-DHAVE_BYTESWAP_H
11 endif
12
13 ifeq ($(ARCH),ppc)
14 GCC_LIBS_DIR=/usr/netgem/tools/lib/gcc-lib/powerpc-linux/2.95.2
15 DIST=/home/fbe/nsv/dist/hw/n6-dtt
16 CC=powerpc-linux-gcc -msoft-float
17 CFLAGS=-Wall -pipe -O2 -mcpu=405 -mbig -nostdinc -g -I$(GCC_LIBS_DIR)/include -I$(DIST)/include
18 LIBS_DIR=$(DIST)/lib
19 CRT1=$(LIBS_DIR)/crt1.o
20 CRTI=$(LIBS_DIR)/crti.o
21 CRTN=$(LIBS_DIR)/crtn.o
22 CRTBEGIN=$(GCC_LIBS_DIR)/crtbegin.o
23 CRTEND=$(GCC_LIBS_DIR)/crtend.o
24 LDFLAGS=-static -g -nostdlib $(CRT1) $(CRTI) $(CRTBEGIN)
25 LIBS=-L$(LIBS_DIR) -ltinyc -lgcc $(CRTEND) $(CRTN)
26 DEFINES=-Dsocklen_t=int
27 endif
28
29 #########################################################
30
31 DEFINES+=-D_GNU_SOURCE -DGEMU -DDOSEMU -DNO_TRACE_MSGS
32 DEFINES+=-DCONFIG_PREFIX=\"/usr/local\"
33 LDSCRIPT=$(ARCH).ld
34 LIBS+=-ldl
35
36 OBJS= i386/fp87.o i386/interp_main.o i386/interp_modrm.o i386/interp_16_32.o \
37 i386/interp_32_16.o i386/interp_32_32.o i386/emu-utils.o \
38 i386/dis8086.o i386/emu-ldt.o
39 OBJS+=translate-i386.o op-i386.o
40 OBJS+= elfload.o main.o thunk.o syscall.o
41 SRCS = $(OBJS:.o=.c)
42
43 all: gemu
44
45 gemu: $(OBJS)
46 $(CC) -Wl,-T,$(LDSCRIPT) $(LDFLAGS) -o $@ $^ $(LIBS)
47
48 depend: $(SRCS)
49 $(CC) -MM $(CFLAGS) $^ 1>.depend
50
51 # old i386 emulator
52 i386/interp_32_32.o: i386/interp_32_32.c i386/interp_gen.h
53
54 i386/interp_gen.h: i386/gencode
55 ./i386/gencode > $@
56
57 i386/gencode: i386/gencode.c
58 $(CC) -O2 -Wall -g $< -o $@
59
60 # new i386 emulator
61 dyngen: dyngen.c
62 $(HOST_CC) -O2 -Wall -g $< -o $@
63
64 translate-i386.o: translate-i386.c op-i386.h cpu-i386.h
65
66 op-i386.h: op-i386.o dyngen
67 ./dyngen -o $@ $<
68
69 op-i386.o: op-i386.c opreg_template.h ops_template.h
70 $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
71
72 %.o: %.c
73 $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
74
75 clean:
76 rm -f *.o *~ i386/*.o i386/*~ gemu TAGS
77
78 # various test targets
79 test speed: gemu
80 make -C tests $@
81
82 TAGS:
83 etags *.[ch] i386/*.[ch]
84
85 ifneq ($(wildcard .depend),)
86 include .depend
87 endif