Revision 367e86e8 Makefile

b/Makefile
1 1
ARCH=i386
2 2
#ARCH=ppc
3
HOST_CC=gcc
3 4

  
4 5
ifeq ($(ARCH),i386)
5
CFLAGS=-Wall -O2 -g
6
CFLAGS=-Wall -O2 -g -fomit-frame-pointer
6 7
LDFLAGS=-g
7 8
LIBS=
8 9
CC=gcc
......
27 28

  
28 29
#########################################################
29 30

  
30
DEFINES+=-D_GNU_SOURCE -DGEMU -DDOSEMU #-DNO_TRACE_MSGS
31
DEFINES+=-D_GNU_SOURCE -DGEMU -DDOSEMU -DNO_TRACE_MSGS
32
DEFINES+=-DCONFIG_PREFIX=\"/usr/local\"
31 33
LDSCRIPT=$(ARCH).ld
34
LIBS+=-ldl
32 35

  
33 36
OBJS= i386/fp87.o i386/interp_main.o i386/interp_modrm.o i386/interp_16_32.o \
34 37
      i386/interp_32_16.o i386/interp_32_32.o i386/emu-utils.o \
35 38
      i386/dis8086.o i386/emu-ldt.o
39
OBJS+=translate-i386.o op-i386.o
36 40
OBJS+= elfload.o main.o thunk.o syscall.o
37

  
38 41
SRCS = $(OBJS:.o=.c)
39 42

  
40 43
all: gemu
41 44

  
42 45
gemu: $(OBJS)
43
	$(CC) -Wl,-T,$(LDSCRIPT) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
46
	$(CC) -Wl,-T,$(LDSCRIPT) $(LDFLAGS) -o $@ $^ $(LIBS)
44 47

  
45 48
depend: $(SRCS)
46 49
	$(CC) -MM $(CFLAGS) $^ 1>.depend
47 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

  
48 72
%.o: %.c
49 73
	$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
50 74

  
51 75
clean:
52
	rm -f *.o *~ i386/*.o i386/*~ gemu hello test1 test2 TAGS
53

  
54
hello: hello.c
55
	$(CC) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $<
76
	rm -f *.o *~ i386/*.o i386/*~ gemu TAGS
56 77

  
57
test1: test1.c
58
	$(CC) $(CFLAGS) -static $(LDFLAGS) -o $@ $<
78
# various test targets
79
test speed: gemu
80
	make -C tests $@
59 81

  
60
test2: test2.c
61
	$(CC) $(CFLAGS) -static $(LDFLAGS) -o $@ $<
82
TAGS: 
83
	etags *.[ch] i386/*.[ch]
62 84

  
63 85
ifneq ($(wildcard .depend),)
64 86
include .depend

Also available in: Unified diff