move select from evdev to upper level
[picodrive.git] / platform / linux / Makefile
CommitLineData
cc68a136 1
2# settings
d26dc685 3use_musashi = 1
4#use_fame = 1
80db4442 5#use_mz80 = 1
70357ce5 6
cc68a136 7# profile = 1
8
9
7e4c661a 10DEFINC = -I../.. -I. -D__GP2X__ -D_UNZIP_SUPPORT -DIO_STATS -DIN_EVDEV # -DBENCHMARK
cc68a136 11GCC = gcc
12STRIP = strip
13AS = gcc
14
15ifeq "$(profile)" "1"
b542be46 16COPT_COMMON = -s -O3 -ftracer -fstrength-reduce -Wall -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math -fprofile-generate
17COPT = $(COPT_COMMON)
cc68a136 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
e5ab6faf 30OBJS += platform/gp2x/main.o platform/gp2x/menu.o platform/gp2x/emu.o usbjoy.o blit.o \
7e4c661a 31 in_evdev.o sndout_oss.o gp2x.o 940ctl_ym2612.o log_io.o
e5f426aa 32
33# common
58c86d00 34OBJS += platform/common/emu.o platform/common/menu.o platform/common/config.o platform/common/fonts.o \
7e4c661a 35 platform/common/readpng.o platform/common/input.o platform/common/mp3_helix.o
e5f426aa 36
cc68a136 37# Pico
efcba75f 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
cc68a136 40# Pico - CD
efcba75f 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
9037e45d 44# Pico - Pico
efcba75f 45OBJS += pico/pico/pico.o pico/pico/memory.o pico/pico/xpcm.o
cc68a136 46# Pico - sound
efcba75f 47OBJS += pico/sound/sound.o pico/sound/sn76496.o pico/sound/ym2612.o pico/sound/mix.o
f53f286a 48# Pico - carthw
efcba75f 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
cc68a136 51# zlib
2445b7cb 52OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \
71de3cd9 53 zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o zlib/uncompr.o
cc68a136 54# unzip
2445b7cb 55OBJS += unzip/unzip.o unzip/unzip_stream.o
cc68a136 56# CPU cores
80db4442 57ifeq "$(use_musashi)" "1"
cc68a136 58DEFINC += -DEMU_M68K
2445b7cb 59OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o
03e4f2a3 60endif
61ifeq "$(use_fame)" "1"
80db4442 62DEFINC += -DEMU_F68K
2445b7cb 63OBJS += cpu/fame/famec.o
70357ce5 64endif
80db4442 65# z80
66ifeq "$(use_mz80)" "1"
03e4f2a3 67DEFINC += -D_USE_MZ80
2445b7cb 68OBJS += cpu/mz80/mz80.o
80db4442 69else
03e4f2a3 70DEFINC += -D_USE_CZ80
2445b7cb 71OBJS += cpu/cz80/cz80.o
80db4442 72endif
03e4f2a3 73# misc
74ifeq "$(use_fame)" "1"
75ifeq "$(use_musashi)" "1"
efcba75f 76OBJS += pico/debugCPU.o
2445b7cb 77OBJS += cpu/musashi/m68kdasm.o
03e4f2a3 78endif
79endif
efcba75f 80OBJS += cpu/musashi/m68kdasm.o
cc68a136 81
2445b7cb 82vpath %.c = ../..
efcba75f 83DIRS = platform platform/gp2x platform/common pico pico/cd pico/pico pico/sound pico/carthw/svp \
f53f286a 84 zlib unzip cpu cpu/musashi cpu/fame cpu/mz80 cpu/cz80
cc68a136 85
2445b7cb 86all: mkdirs PicoDrive
cc68a136 87clean: tidy
88 @$(RM) PicoDrive
89tidy:
2445b7cb 90 $(RM) $(OBJS)
91 rm -rf $(DIRS)
cc68a136 92 @make -C ../../cpu/mz80/ clean
7d4906bf 93 @make -C ../common/helix/ X86=1 clean
cc68a136 94
7d4906bf 95PicoDrive : $(OBJS) ../common/helix/helix_mp3_x86.a
03e4f2a3 96 @echo ">>>" $@
97 $(GCC) $(COPT) $^ $(LDFLAGS) -lm -lpng -Wl,-Map=PicoDrive.map -o $@
cc68a136 98
2445b7cb 99mkdirs:
100 mkdir -p $(DIRS)
cc68a136 101
efcba75f 102pico/carthw/svp/compiler.o : ../../pico/carthw/svp/gen_arm.c
103pico/pico.o pico/cd/pico.o : ../../pico/pico_cmn.c ../../pico/pico_int.h
104pico/memory.o pico/cd/memory.o : ../../pico/memory_cmn.c ../../pico/pico_int.h
14565041 105
e5503e2f 106../../cpu/musashi/m68kops.c :
107 @make -C ../../cpu/musashi
108
2445b7cb 109cpu/mz80/mz80.o : ../../cpu/mz80/mz80.asm
cc68a136 110 @echo $@
111 @nasm -f elf $< -o $@
112
113../../cpu/mz80/mz80.asm :
114 @make -C ../../cpu/mz80/
115
7d4906bf 116../common/helix/helix_mp3_x86.a:
117 @make -C ../common/helix/ X86=1 clean all
01bc6b19 118
cc68a136 119.c.o:
03e4f2a3 120 @echo ">>>" $<
121 $(GCC) $(COPT) $(DEFINC) -c $< -o $@
cc68a136 122.s.o:
03e4f2a3 123 @echo ">>>" $<
124 $(GCC) $(COPT) $(DEFINC) -c $< -o $@
cc68a136 125
126
efcba75f 127pico/sound/ym2612.o : ../../pico/sound/ym2612.c
03e4f2a3 128 @echo ">>>" $@
129 $(GCC) $(COPT_COMMON) $(DEFINC) -c $< -o $@
130
2445b7cb 131cpu/fame/famec.o : ../../cpu/fame/famec.c ../../cpu/fame/famec_opcodes.h
03e4f2a3 132 @echo ">>>" $<
133 $(GCC) $(COPT) $(DEFINC) -Wno-unused -c $< -o $@
cc68a136 134
70357ce5 135