Statistics
| Branch: | Revision:

root / Makefile @ 766a487a

History | View | Annotate | Download (1.5 kB)

1 766a487a bellard
ARCH=i386
2 766a487a bellard
#ARCH=ppc
3 766a487a bellard
4 766a487a bellard
ifeq ($(ARCH),i386)
5 31e31b8a bellard
CFLAGS=-Wall -O2 -g
6 31e31b8a bellard
LDFLAGS=-g
7 766a487a bellard
LIBS=
8 766a487a bellard
CC=gcc
9 766a487a bellard
DEFINES=-DHAVE_BYTESWAP_H
10 766a487a bellard
endif
11 766a487a bellard
12 766a487a bellard
ifeq ($(ARCH),ppc)
13 766a487a bellard
GCC_LIBS_DIR=/usr/netgem/tools/lib/gcc-lib/powerpc-linux/2.95.2
14 766a487a bellard
DIST=/home/fbe/nsv/dist/hw/n6-dtt
15 766a487a bellard
CC=powerpc-linux-gcc -msoft-float 
16 766a487a bellard
CFLAGS=-Wall -pipe -O2 -mcpu=405 -mbig -nostdinc -g -I$(GCC_LIBS_DIR)/include -I$(DIST)/include
17 766a487a bellard
LIBS_DIR=$(DIST)/lib
18 766a487a bellard
CRT1=$(LIBS_DIR)/crt1.o
19 766a487a bellard
CRTI=$(LIBS_DIR)/crti.o
20 766a487a bellard
CRTN=$(LIBS_DIR)/crtn.o
21 766a487a bellard
CRTBEGIN=$(GCC_LIBS_DIR)/crtbegin.o
22 766a487a bellard
CRTEND=$(GCC_LIBS_DIR)/crtend.o
23 766a487a bellard
LDFLAGS=-static -g -nostdlib $(CRT1) $(CRTI) $(CRTBEGIN) 
24 766a487a bellard
LIBS=-L$(LIBS_DIR) -ltinyc -lgcc $(CRTEND) $(CRTN)
25 766a487a bellard
DEFINES=-Dsocklen_t=int
26 766a487a bellard
endif
27 766a487a bellard
28 766a487a bellard
#########################################################
29 766a487a bellard
30 766a487a bellard
DEFINES+=-D_GNU_SOURCE -DGEMU -DDOSEMU #-DNO_TRACE_MSGS
31 766a487a bellard
LDSCRIPT=$(ARCH).ld
32 31e31b8a bellard
33 31e31b8a bellard
OBJS= i386/fp87.o i386/interp_main.o i386/interp_modrm.o i386/interp_16_32.o \
34 31e31b8a bellard
      i386/interp_32_16.o i386/interp_32_32.o i386/emu-utils.o \
35 31e31b8a bellard
      i386/dis8086.o i386/emu-ldt.o
36 31e31b8a bellard
OBJS+= elfload.o main.o thunk.o syscall.o
37 31e31b8a bellard
38 31e31b8a bellard
SRCS = $(OBJS:.o=.c)
39 31e31b8a bellard
40 31e31b8a bellard
all: gemu
41 31e31b8a bellard
42 31e31b8a bellard
gemu: $(OBJS)
43 766a487a bellard
	$(CC) -Wl,-T,$(LDSCRIPT) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
44 31e31b8a bellard
45 31e31b8a bellard
depend: $(SRCS)
46 31e31b8a bellard
	$(CC) -MM $(CFLAGS) $^ 1>.depend
47 31e31b8a bellard
48 31e31b8a bellard
%.o: %.c
49 31e31b8a bellard
	$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
50 31e31b8a bellard
51 31e31b8a bellard
clean:
52 31e31b8a bellard
	rm -f *.o *~ i386/*.o i386/*~ gemu hello test1 test2 TAGS
53 31e31b8a bellard
54 31e31b8a bellard
hello: hello.c
55 31e31b8a bellard
	$(CC) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $<
56 31e31b8a bellard
57 31e31b8a bellard
test1: test1.c
58 31e31b8a bellard
	$(CC) $(CFLAGS) -static $(LDFLAGS) -o $@ $<
59 31e31b8a bellard
60 31e31b8a bellard
test2: test2.c
61 31e31b8a bellard
	$(CC) $(CFLAGS) -static $(LDFLAGS) -o $@ $<
62 31e31b8a bellard
63 31e31b8a bellard
ifneq ($(wildcard .depend),)
64 31e31b8a bellard
include .depend
65 31e31b8a bellard
endif