root / Makefile @ 7d13299d
History | View | Annotate | Download (2.1 kB)
1 |
include config.mak |
---|---|
2 |
|
3 |
CFLAGS=-Wall -O2 -g |
4 |
LDFLAGS=-g |
5 |
LIBS= |
6 |
DEFINES=-DHAVE_BYTESWAP_H |
7 |
|
8 |
ifeq ($(ARCH),i386) |
9 |
CFLAGS+=-fomit-frame-pointer |
10 |
OP_CFLAGS=$(CFLAGS) -malign-functions=0 -mpreferred-stack-boundary=2 |
11 |
endif |
12 |
|
13 |
ifeq ($(ARCH),ppc) |
14 |
OP_CFLAGS=$(CFLAGS) |
15 |
endif |
16 |
|
17 |
######################################################### |
18 |
|
19 |
DEFINES+=-D_GNU_SOURCE |
20 |
LDSCRIPT=$(ARCH).ld |
21 |
LIBS+=-ldl -lm |
22 |
|
23 |
# profiling code |
24 |
ifdef TARGET_GPROF |
25 |
LDFLAGS+=-p |
26 |
CFLAGS+=-p |
27 |
endif |
28 |
|
29 |
OBJS= elfload.o main.o thunk.o syscall.o |
30 |
OBJS+=translate-i386.o op-i386.o exec-i386.o |
31 |
# NOTE: the disassembler code is only needed for debugging |
32 |
OBJS+=i386-dis.o dis-buf.o |
33 |
SRCS = $(OBJS:.o=.c) |
34 |
|
35 |
all: gemu |
36 |
|
37 |
gemu: $(OBJS) |
38 |
$(CC) -Wl,-T,$(LDSCRIPT) $(LDFLAGS) -o $@ $^ $(LIBS) |
39 |
|
40 |
depend: $(SRCS) |
41 |
$(CC) -MM $(CFLAGS) $^ 1>.depend |
42 |
|
43 |
# new i386 emulator |
44 |
dyngen: dyngen.c |
45 |
$(HOST_CC) -O2 -Wall -g $< -o $@ |
46 |
|
47 |
translate-i386.o: translate-i386.c op-i386.h cpu-i386.h |
48 |
|
49 |
op-i386.h: op-i386.o dyngen |
50 |
./dyngen -o $@ $< |
51 |
|
52 |
op-i386.o: op-i386.c opreg_template.h ops_template.h |
53 |
$(CC) $(OP_CFLAGS) $(DEFINES) -c -o $@ $< |
54 |
|
55 |
%.o: %.c |
56 |
$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< |
57 |
|
58 |
clean: |
59 |
$(MAKE) -C tests clean |
60 |
rm -f *.o *~ gemu dyngen TAGS |
61 |
|
62 |
distclean: clean |
63 |
rm -f config.mak config.h |
64 |
|
65 |
# various test targets |
66 |
test speed: gemu |
67 |
make -C tests $@ |
68 |
|
69 |
TAGS: |
70 |
etags *.[ch] i386/*.[ch] |
71 |
|
72 |
FILES= \ |
73 |
COPYING.LIB dyngen.c ioctls.h ops_template.h syscall_types.h\ |
74 |
Makefile elf.h linux_bin.h segment.h thunk.c\ |
75 |
TODO elfload.c main.c signal.c thunk.h\ |
76 |
cpu-i386.h gemu.h op-i386.c syscall-i386.h translate-i386.c\ |
77 |
dis-asm.h gen-i386.h op-i386.h syscall.c\ |
78 |
dis-buf.c i386-dis.c opreg_template.h syscall_defs.h\ |
79 |
i386.ld ppc.ld exec-i386.h exec-i386.c configure VERSION \ |
80 |
tests/Makefile\ |
81 |
tests/test-i386.c tests/test-i386-shift.h tests/test-i386.h\ |
82 |
tests/test-i386-muldiv.h\ |
83 |
tests/test2.c tests/hello.c tests/sha1.c |
84 |
|
85 |
FILE=gemu-$(VERSION) |
86 |
|
87 |
tar: |
88 |
rm -rf /tmp/$(FILE) |
89 |
mkdir -p /tmp/$(FILE) |
90 |
cp -P $(FILES) /tmp/$(FILE) |
91 |
( cd /tmp ; tar zcvf ~/$(FILE).tar.gz $(FILE) ) |
92 |
rm -rf /tmp/$(FILE) |
93 |
|
94 |
ifneq ($(wildcard .depend),) |
95 |
include .depend |
96 |
endif |