minor game_def.cfg update
[libpicofe.git] / linux / Makefile
... / ...
CommitLineData
1
2# settings
3use_musashi = 1
4#use_fame = 1
5#use_mz80 = 1
6
7# profile = 1
8
9
10DEFINC = -I../.. -I. -D__GP2X__ -D_UNZIP_SUPPORT -DIO_STATS # -DBENCHMARK
11GCC = gcc
12STRIP = strip
13AS = gcc
14
15ifeq "$(profile)" "1"
16COPT_COMMON = -s -O3 -ftracer -fstrength-reduce -Wall -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math -fprofile-generate
17COPT = $(COPT_COMMON)
18else
19COPT = -ggdb -Wall -fno-strict-aliasing # -pg -O3 -ftracer -fstrength-reduce -funroll-loops -fomit-frame-pointer -ffast-math
20COPT_COMMON = $(COPT)
21endif
22
23# gtk
24COPT += `pkg-config --cflags gtk+-2.0`
25LDFLAGS += `pkg-config --libs gtk+-2.0`
26COPT += `pkg-config --cflags gthread-2.0`
27LDFLAGS += `pkg-config --libs gthread-2.0`
28
29# frontend
30OBJS += platform/gp2x/main.o platform/gp2x/menu.o platform/gp2x/emu.o platform/gp2x/usbjoy.o blit.o \
31 gp2x.o 940ctl_ym2612.o log_io.o
32
33# common
34OBJS += platform/common/emu.o platform/common/menu.o platform/common/config.o platform/common/fonts.o \
35 platform/common/readpng.o platform/common/mp3_helix.o
36
37# Pico
38OBJS += Pico/Area.o Pico/Cart.o Pico/Memory.o Pico/Misc.o Pico/Pico.o Pico/Sek.o \
39 Pico/VideoPort.o Pico/Draw2.o Pico/Draw.o Pico/Patch.o Pico/Debug.o
40# Pico - CD
41OBJS += Pico/cd/Pico.o Pico/cd/Memory.o Pico/cd/Sek.o Pico/cd/LC89510.o \
42 Pico/cd/cd_sys.o Pico/cd/cd_file.o Pico/cd/cue.o Pico/cd/gfx_cd.o \
43 Pico/cd/Area.o Pico/cd/Misc.o Pico/cd/pcm.o Pico/cd/buffering.o
44# Pico - Pico
45OBJS += Pico/Pico/Pico.o Pico/Pico/Memory.o Pico/Pico/xpcm.o
46# Pico - sound
47OBJS += Pico/sound/sound.o Pico/sound/sn76496.o Pico/sound/ym2612.o Pico/sound/mix.o
48# Pico - carthw
49OBJS += Pico/carthw/carthw.o Pico/carthw/svp/svp.o Pico/carthw/svp/Memory.o \
50 Pico/carthw/svp/ssp16.o Pico/carthw/svp/compiler.o
51# zlib
52OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \
53 zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o zlib/uncompr.o
54# unzip
55OBJS += unzip/unzip.o unzip/unzip_stream.o
56# CPU cores
57ifeq "$(use_musashi)" "1"
58DEFINC += -DEMU_M68K
59OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o
60endif
61ifeq "$(use_fame)" "1"
62DEFINC += -DEMU_F68K
63OBJS += cpu/fame/famec.o
64endif
65# z80
66ifeq "$(use_mz80)" "1"
67DEFINC += -D_USE_MZ80
68OBJS += cpu/mz80/mz80.o
69else
70DEFINC += -D_USE_CZ80
71OBJS += cpu/cz80/cz80.o
72endif
73# misc
74ifeq "$(use_fame)" "1"
75ifeq "$(use_musashi)" "1"
76OBJS += Pico/DebugCPU.o
77OBJS += cpu/musashi/m68kdasm.o
78endif
79endif
80
81vpath %.c = ../..
82DIRS = platform platform/gp2x platform/common Pico Pico/cd Pico/Pico Pico/sound Pico/carthw/svp \
83 zlib unzip cpu cpu/musashi cpu/fame cpu/mz80 cpu/cz80
84
85all: mkdirs PicoDrive
86clean: tidy
87 @$(RM) PicoDrive
88tidy:
89 $(RM) $(OBJS)
90 rm -rf $(DIRS)
91 @make -C ../../cpu/mz80/ clean
92 @make -C ../common/helix/ X86=1 clean
93
94PicoDrive : $(OBJS) ../common/helix/helix_mp3_x86.a
95 @echo ">>>" $@
96 $(GCC) $(COPT) $^ $(LDFLAGS) -lm -lpng -Wl,-Map=PicoDrive.map -o $@
97
98mkdirs:
99 mkdir -p $(DIRS)
100
101Pico/carthw/svp/compiler.o : ../../Pico/carthw/svp/gen_arm.c
102Pico/Pico.o Pico/cd/Pico.o : ../../Pico/PicoFrameHints.c ../../Pico/PicoInt.h
103Pico/Memory.o Pico/cd/Memory.o : ../../Pico/MemoryCmn.c ../../Pico/PicoInt.h
104
105../../cpu/musashi/m68kops.c :
106 @make -C ../../cpu/musashi
107
108cpu/mz80/mz80.o : ../../cpu/mz80/mz80.asm
109 @echo $@
110 @nasm -f elf $< -o $@
111
112../../cpu/mz80/mz80.asm :
113 @make -C ../../cpu/mz80/
114
115../common/helix/helix_mp3_x86.a:
116 @make -C ../common/helix/ X86=1 clean all
117
118.c.o:
119 @echo ">>>" $<
120 $(GCC) $(COPT) $(DEFINC) -c $< -o $@
121.s.o:
122 @echo ">>>" $<
123 $(GCC) $(COPT) $(DEFINC) -c $< -o $@
124
125
126Pico/sound/ym2612.o : ../../Pico/sound/ym2612.c
127 @echo ">>>" $@
128 $(GCC) $(COPT_COMMON) $(DEFINC) -c $< -o $@
129
130cpu/fame/famec.o : ../../cpu/fame/famec.c ../../cpu/fame/famec_opcodes.h
131 @echo ">>>" $<
132 $(GCC) $(COPT) $(DEFINC) -Wno-unused -c $< -o $@
133
134