Made UAE buildable again.
[AROS-Contrib.git] / emu / uae / src / mmakefile.src
blob9609963e3c24bbd26920f6c4fb3f174222d026a4
1 #   $Id$
3 #   Makefile to make uae.
5 include $(TOP)/config/make.cfg
8 UAESRCDIR := $(SRCDIR)/$(CURDIR)
10 FILES := \
11     audio \
12     autoconf \
13     blitfunc \
14     blittable \
15     blitter \
16     bsdsocket \
17     cfgfile \
18     cia \
19     compiler \
20     cpudefs \
21     cpuemu \
22     cpustbl \
23     custom \
24     debug \
25     disk \
26     drawing \
27     ersatz \
28     expansion \
29     filesys \
30     fpp \
31     fsdb \
32     fsdb_unix \
33     fsusage \
34     gfxlib \
35     gfxutil \
36     hardfile \
37     identify \
38     keybuf \
39     main \
40     md-support \
41     memory \
42     missing \
43     native2amiga \
44     newcpu \
45     od-joy \
46     picasso96 \
47     readcpu \
48     savestate \
49     scsi-none \
50     sd-sound \
51     serial \
52     uaeexe \
53     uaelib \
54     writelog \
55     zfile \
56     td-thread
58 EXEDIR := $(CONTRIBDIR)/Emu/UAE
60 USER_CFLAGS := -O2 -fomit-frame-pointer -Wall -Wno-unused\
61                -Wno-format -W -Wmissing-prototypes -Wno-sign-compare \
62                -Wstrict-prototypes   -DGCCCONSTFUNC='__attribute__((const))'\
63                -D_REENTRANT \
64                -fno-exceptions -DUNALIGNED_PROFITABLE\
65                -fno-strength-reduce -DREGPARAM='__attribute__((regparm(3)))'\
66                -DX86_ASSEMBLY -DOPTIMIZED_FLAGS -D__inline__=inline\
67                -I$(UAESRCDIR) -I$(UAESRCDIR)/include \
68                -I$(TOP)/$(CURDIR) -I$(TOP)/$(CURDIR)/include \
69                -UAMIGA -U_AMIGA
71 #MM- contrib-complete: uae
72 #MM- uae : uae-$(AROS_TARGET_CPU)
73 #MM uae-i386 : setup includes uae-setup uae-od-aros uae-docs-copy
74 #MM- uae-quick : uae-setup uae-od-aros-quick uae-docs-copy
76 #MM
77 uae-setup ::  $(OBJDIR)/.build_setup_check
79 $(OBJDIR)/.build_setup_check:
80         rm -f machdep; ln -s $(SRCDIR)/$(CURDIR)/md-i386-gcc/ machdep
81         rm -f osdep; ln -s $(SRCDIR)/$(CURDIR)/od-amiga/ osdep
82         rm -f threaddep; ln -s $(SRCDIR)/$(CURDIR)/td-amigaos/ threaddep
83         rm -f sounddep; ln -s $(SRCDIR)/$(CURDIR)/sd-generic/ sounddep
84         %mkdirs_q $(OBJDIR)/machdep $(EXEDIR)
85         echo '#include "sounddep/sound.c"' >sd-sound.c
86         echo '#include "sounddep/sound.h"' >sd-sound.h
87         echo '#include "threaddep/thread.c"' >td-thread.c
88         echo '#include "od-generic/joystick.c"' >od-joy.c
89         echo '#include "targets/t-aros.h"' >target.h
90         echo '#include "fpp-unknown.h"' >md-fpp.h
91         echo '#include "md-i386-gcc/support.c"' >md-support.c
92         touch $(OBJDIR)/.build_setup_check
94 #MM uae-clean : uae-od-aros-clean
95 uae-clean :
96         $(RM) cpudefs.* cpustbl.* cputbl.h blitfunc.* blittable.* blit.h \
97               cpufast.s cpuemu.c cpuopti genblitter build68k gencpu\
98               sd-sound.c sd-sound.h od-joy.c target.h md-fpp.h md-support.c\
99               machdep osdep threaddep sounddep $(OBJDIR)
102 clean:: uae-clean
104 $(OBJDIR)/%.o: %.s
105         %assemble_q
107 $(OBJDIR)/%.o: %.S
108         %compile_q
110 blittable.c: blit.h
112 blit.h: genblitter
113         ./$< i >$@
114 blitfunc.c: genblitter blitfunc.h
115         ./$< f >$@
116 blitfunc.h: genblitter
117         ./$< h >$@
118 blittable.c: genblitter blitfunc.h
119         ./$< t >$@
121 # Temporarily disabled for gcc-3.x compatibility reasons
123 #cpufast.s: cpuemu.c cpuopti
124 #       $(CC) -S $(subst -g3, , $(CFLAGS)) $< -o cputmp.s
125 #       ./cpuopti <cputmp.s >$@
126 #       rm cputmp.s
128 $(OBJDIR)/_writelog.o : writelog.c
129         $(HOST_CC) $(USER_CFLAGS) $^ -c -o $@
131 genblitter: genblitter.c blitops.c $(OBJDIR)/_writelog.o
132         $(HOST_CC) $(USER_CFLAGS) $^ -o $@
133 build68k: build68k.c $(OBJDIR)/_writelog.o
134         $(HOST_CC) $(USER_CFLAGS) $^ -o $@
135 gencpu: gencpu.c readcpu.c cpudefs.c missing.c $(OBJDIR)/_writelog.o
136         $(HOST_CC) $(USER_CFLAGS) $^ -o $@
138 cpuemu.c: gencpu
139         ./gencpu
141 # gencpu also creates cpustbl.c and cputbl.h
142 cpustbl.c: cpuemu.c
143 cputbl.h: cpuemu.c
145 cpudefs.c: table68k  build68k
146         ./build68k < $< >$@
148 readcpu.o: readcpu.c
149 cpudefs.o: cpudefs.c
151 USER_LDFLAGS := "$(GENDIR)/$(CURDIR)/od-aros.o"
152 %build_prog mmake=uae-i386 \
153     progname=uae targetdir=$(EXEDIR) files=$(FILES) \
154     uselibs="SDL GL arossupport amiga arosc m" usehostlibs=gcc nix=yes
156 %common
158 .DELETE_ON_ERROR:
160 %copy_dir_recursive mmake=uae-docs-copy src=$(SRCDIR)/$(CURDIR)/../docs dst=$(EXEDIR)/Docs