port to updated Cyclone, debug menu
[picodrive.git] / platform / linux / Makefile
... / ...
CommitLineData
1
2# settings
3dprint = 1
4# profile = 1
5
6
7DEFINC = -I../.. -I. -D__GP2X__ -D_UNZIP_SUPPORT # -DBENCHMARK
8GCC = gcc
9STRIP = strip
10AS = gcc
11
12ifeq "$(profile)" "1"
13COPT_COMMON = -s -O3 -ftracer -fstrength-reduce -Wall -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math -fprofile-generate # -static
14COPT = $(COPT_COMMON) # -mtune=arm920t
15else
16COPT = -ggdb -Wall -fno-strict-aliasing # -pg -O3 -ftracer -fstrength-reduce -funroll-loops -fomit-frame-pointer -ffast-math
17COPT_COMMON = $(COPT)
18endif
19
20# gtk
21COPT += `pkg-config --cflags gtk+-2.0`
22LDFLAGS += `pkg-config --libs gtk+-2.0`
23COPT += `pkg-config --cflags gthread-2.0`
24LDFLAGS += `pkg-config --libs gthread-2.0`
25
26# frontend
27OBJS += ../gp2x/main.o ../gp2x/menu.o ../gp2x/fonts.o ../gp2x/emu.o ../gp2x/usbjoy.o blit.o gp2x.o 940ctl_ym2612.o
28# Pico
29OBJS += ../../Pico/Area.o ../../Pico/Cart.o ../../Pico/Utils.o ../../Pico/Memory.o ../../Pico/Misc.o \
30 ../../Pico/Pico.o ../../Pico/Sek.o ../../Pico/VideoPort.o ../../Pico/Draw2.o ../../Pico/Draw.o \
31 ../../Pico/Patch.o
32# Pico - CD
33OBJS += ../../Pico/cd/Pico.o ../../Pico/cd/Memory.o ../../Pico/cd/Sek.o ../../Pico/cd/LC89510.o \
34 ../../Pico/cd/cd_sys.o ../../Pico/cd/cd_file.o ../../Pico/cd/gfx_cd.o \
35 ../../Pico/cd/Area.o ../../Pico/cd/Misc.o ../../Pico/cd/pcm.o ../../Pico/cd/buffering.o
36# Pico - sound
37OBJS += ../../Pico/sound/sound.o ../../Pico/sound/sn76496.o ../../Pico/sound/ym2612.o ../../Pico/sound/mix.o
38# zlib
39OBJS += ../../zlib/gzio.o ../../zlib/inffast.o ../../zlib/inflate.o ../../zlib/inftrees.o ../../zlib/trees.o \
40 ../../zlib/deflate.o ../../zlib/crc32.o ../../zlib/adler32.o ../../zlib/zutil.o ../../zlib/compress.o
41# unzip
42OBJS += ../../unzip/unzip.o ../../unzip/unzip_stream.o
43# mp3
44OBJS += ../gp2x/mp3.o
45# CPU cores
46DEFINC += -DEMU_M68K
47OBJS += ../../cpu/musashi/m68kcpu.o ../../cpu/musashi/m68kopac.o ../../cpu/musashi/m68kopdm.o \
48 ../../cpu/musashi/m68kopnz.o ../../cpu/musashi/m68kops.o
49# mz80
50DEFINC += -D_USE_MZ80
51OBJS += ../../cpu/mz80/mz80.o
52
53# faked asm
54#DEFINC += -D_ASM_DRAW_C
55#DEFINC += -D_ASM_MEMORY_C
56#DEFINC += -D_ASM_YM2612_C
57OBJS += fakedasm.o
58
59
60all: PicoDrive
61clean: tidy
62 @$(RM) PicoDrive
63tidy:
64 @$(RM) $(OBJS)
65 @make -C ../../cpu/mz80/ clean
66 @make -C ../gp2x/helix/ X86=1 clean
67
68PicoDrive : $(OBJS) ../gp2x/helix/helix_mp3_x86.a
69 @echo $@
70 @$(GCC) $(COPT) $^ $(LDFLAGS) -lm -Wl,-Map=PicoDrive.map -o $@
71
72
73../../cpu/mz80/mz80.o : ../../cpu/mz80/mz80.asm
74 @echo $@
75 @nasm -f elf $< -o $@
76
77../../cpu/mz80/mz80.asm :
78 @make -C ../../cpu/mz80/
79
80../gp2x/helix/helix_mp3_x86.a:
81 @make -C ../gp2x/helix/ X86=1 clean all
82
83.c.o:
84 @echo $<
85 @$(GCC) $(COPT) $(DEFINC) -c $< -o $@
86.s.o:
87 @echo $<
88 @$(GCC) $(COPT) $(DEFINC) -c $< -o $@
89
90
91../../Pico/sound/ym2612.o : ../../Pico/sound/ym2612.c
92 @echo $@
93 @$(GCC) $(COPT_COMMON) $(DEFINC) -c $< -o $@ # -mtune=arm940t -DEXTERNAL_YM2612
94
95# faked asm
96../../Pico/Draw.o : ../../Pico/Draw.c
97 @echo $<
98 @$(GCC) $(COPT) $(DEFINC) -D_ASM_DRAW_C -c $< -o $@
99