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