1.56 release
[picodrive.git] / platform / linux / Makefile
... / ...
CommitLineData
1# settings
2use_musashi = 1
3#use_fame = 1
4#use_mz80 = 1
5#profile = 1
6#fake_in_gp2x = 1
7
8-include Makefile.local
9
10ifeq "$(profile)" "1"
11CFLAGS += -O3 -Wall
12CFLAGS += -ftracer -fstrength-reduce -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math
13CFLAGS += -fprofile-generate
14else
15CFLAGS = -ggdb -Wall
16endif
17DEFINES = _UNZIP_SUPPORT IO_STATS IN_EVDEV
18CFLAGS += -I../.. -I.
19
20# gtk
21CFLAGS += `pkg-config --cflags gtk+-2.0`
22LDFLAGS += `pkg-config --libs gtk+-2.0`
23CFLAGS += `pkg-config --cflags gthread-2.0`
24LDFLAGS += `pkg-config --libs gthread-2.0`
25
26# frontend
27OBJS += platform/gp2x/emu.o blit.o in_evdev.o plat.o sndout_oss.o gp2x.o log_io.o
28
29# common
30OBJS += platform/common/main.o platform/common/emu.o platform/common/menu.o \
31 platform/common/config.o platform/common/fonts.o platform/common/readpng.o \
32 platform/common/input.o
33
34ifeq "$(fake_in_gp2x)" "1"
35DEFINES += IN_GP2X FAKE_IN_GP2X
36OBJS += platform/gp2x/in_gp2x.o
37endif
38
39# Pico
40OBJS += pico/area.o pico/cart.o pico/memory.o pico/misc.o pico/pico.o pico/sek.o \
41 pico/videoport.o pico/draw2.o pico/draw.o pico/patch.o pico/debug.o
42# Pico - CD
43OBJS += pico/cd/pico.o pico/cd/memory.o pico/cd/sek.o pico/cd/LC89510.o \
44 pico/cd/cd_sys.o pico/cd/cd_file.o pico/cd/cue.o pico/cd/gfx_cd.o \
45 pico/cd/area.o pico/cd/misc.o pico/cd/pcm.o pico/cd/buffering.o
46# Pico - Pico
47OBJS += pico/pico/pico.o pico/pico/memory.o pico/pico/xpcm.o
48# Pico - sound
49OBJS += pico/sound/sound.o pico/sound/sn76496.o pico/sound/ym2612.o pico/sound/mix.o
50# Pico - carthw
51OBJS += pico/carthw/carthw.o pico/carthw/svp/svp.o pico/carthw/svp/memory.o \
52 pico/carthw/svp/ssp16.o pico/carthw/svp/compiler.o
53# zlib
54OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \
55 zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o zlib/uncompr.o
56# unzip
57OBJS += unzip/unzip.o unzip/unzip_stream.o
58# CPU cores
59ifeq "$(use_musashi)" "1"
60DEFINES += EMU_M68K
61OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o
62OBJS += cpu/musashi/m68kdasm.o
63endif
64ifeq "$(use_fame)" "1"
65DEFINES += EMU_F68K
66OBJS += cpu/fame/famec.o
67endif
68# z80
69ifeq "$(use_mz80)" "1"
70DEFINES += _USE_MZ80
71OBJS += cpu/mz80/mz80.o
72else
73DEFINES += _USE_CZ80
74OBJS += cpu/cz80/cz80.o
75endif
76# misc
77ifeq "$(use_fame)" "1"
78ifeq "$(use_musashi)" "1"
79OBJS += pico/debugCPU.o
80endif
81endif
82
83CFLAGS += $(addprefix -D,$(DEFINES))
84
85vpath %.c = ../..
86
87DIRS = platform platform/gp2x platform/common pico pico/cd pico/pico pico/sound pico/carthw/svp \
88 zlib unzip cpu cpu/musashi cpu/fame cpu/mz80 cpu/cz80
89
90all: mkdirs PicoDrive
91clean: tidy
92 @$(RM) PicoDrive
93tidy:
94 $(RM) $(OBJS)
95 rm -rf $(DIRS)
96 @make -C ../../cpu/mz80/ clean
97 @make -C ../common/helix/ X86=1 clean
98
99PicoDrive : $(OBJS) ../common/helix/helix_mp3_x86.a
100 @echo ">>>" $@
101 $(CC) $(CFLAGS) $^ $(LDFLAGS) -lm -lpng -Wl,-Map=PicoDrive.map -o $@
102
103mkdirs:
104 mkdir -p $(DIRS)
105
106pico/carthw/svp/compiler.o : ../../pico/carthw/svp/gen_arm.c
107pico/pico.o pico/cd/pico.o : ../../pico/pico_cmn.c ../../pico/pico_int.h
108pico/memory.o pico/cd/memory.o : ../../pico/memory_cmn.c ../../pico/pico_int.h
109platform/common/menu.o : revision.h
110
111revision.h:
112 @echo "#define REVISION \"`svn info | grep Revision | cut -c 11-`\"" > /tmp/r.tmp
113 @diff -q $@ /tmp/r.tmp > /dev/null 2>&1 || mv -f /tmp/r.tmp $@
114
115../../cpu/musashi/m68kops.c :
116 @make -C ../../cpu/musashi
117
118cpu/mz80/mz80.o : ../../cpu/mz80/mz80.asm
119 @echo $@
120 @nasm -f elf $< -o $@
121
122../../cpu/mz80/mz80.asm :
123 @make -C ../../cpu/mz80/
124
125../common/helix/helix_mp3_x86.a:
126 @make -C ../common/helix/ X86=1 clean all
127
128.c.o:
129 @echo ">>>" $<
130 $(CC) $(CFLAGS) -c $< -o $@
131.s.o:
132 @echo ">>>" $<
133 $(CC) $(CFLAGS) -c $< -o $@
134
135
136#pico/sound/ym2612.o : ../../pico/sound/ym2612.c
137# @echo ">>>" $@
138# $(CC) $(CFLAGS) -c $< -o $@
139
140cpu/fame/famec.o : ../../cpu/fame/famec.c ../../cpu/fame/famec_opcodes.h
141 @echo ">>>" $<
142 $(CC) $(CFLAGS) -Wno-unused -c $< -o $@
143