cc68a136 |
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 |
76276b0b |
27 | OBJS += ../gp2x/main.o ../gp2x/menu.o ../gp2x/fonts.o ../gp2x/emu.o ../gp2x/usbjoy.o blit.o gp2x.o 940ctl_ym2612.o |
cc68a136 |
28 | # Pico |
29 | OBJS += ../../Pico/Area.o ../../Pico/Cart.o ../../Pico/Utils.o ../../Pico/Memory.o ../../Pico/Misc.o \ |
b67ef287 |
30 | ../../Pico/Pico.o ../../Pico/Sek.o ../../Pico/VideoPort.o ../../Pico/Draw2.o ../../Pico/Draw.o \ |
31 | ../../Pico/Patch.o |
cc68a136 |
32 | # Pico - CD |
33 | OBJS += ../../Pico/cd/Pico.o ../../Pico/cd/Memory.o ../../Pico/cd/Sek.o ../../Pico/cd/LC89510.o \ |
51a902ae |
34 | ../../Pico/cd/cd_sys.o ../../Pico/cd/cd_file.o ../../Pico/cd/gfx_cd.o \ |
0a051f55 |
35 | ../../Pico/cd/Area.o ../../Pico/cd/Misc.o ../../Pico/cd/pcm.o ../../Pico/cd/buffering.o |
cc68a136 |
36 | # Pico - sound |
4f265db7 |
37 | OBJS += ../../Pico/sound/sound.o ../../Pico/sound/sn76496.o ../../Pico/sound/ym2612.o ../../Pico/sound/mix.o |
cc68a136 |
38 | # zlib |
39 | OBJS += ../../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 |
83bd0b76 |
42 | OBJS += ../../unzip/unzip.o ../../unzip/unzip_stream.o |
cb0316e4 |
43 | # mp3 |
44 | OBJS += ../gp2x/mp3.o |
cc68a136 |
45 | # CPU cores |
46 | DEFINC += -DEMU_M68K |
47 | OBJS += ../../cpu/musashi/m68kcpu.o ../../cpu/musashi/m68kopac.o ../../cpu/musashi/m68kopdm.o \ |
48 | ../../cpu/musashi/m68kopnz.o ../../cpu/musashi/m68kops.o |
49 | # mz80 |
50 | DEFINC += -D_USE_MZ80 |
51 | OBJS += ../../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 |
57 | OBJS += fakedasm.o |
58 | |
59 | |
60 | all: PicoDrive |
61 | clean: tidy |
62 | @$(RM) PicoDrive |
63 | tidy: |
64 | @$(RM) $(OBJS) |
65 | @make -C ../../cpu/mz80/ clean |
01bc6b19 |
66 | @make -C ../gp2x/helix/ X86=1 clean |
cc68a136 |
67 | |
01bc6b19 |
68 | PicoDrive : $(OBJS) ../gp2x/helix/helix_mp3_x86.a |
cc68a136 |
69 | @echo $@ |
01bc6b19 |
70 | @$(GCC) $(COPT) $^ $(LDFLAGS) -lm -Wl,-Map=PicoDrive.map -o $@ |
cc68a136 |
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 | |
01bc6b19 |
80 | ../gp2x/helix/helix_mp3_x86.a: |
81 | @make -C ../gp2x/helix/ X86=1 clean all |
82 | |
cc68a136 |
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 $@ |
2433f409 |
93 | @$(GCC) $(COPT_COMMON) $(DEFINC) -c $< -o $@ # -mtune=arm940t -DEXTERNAL_YM2612 |
cc68a136 |
94 | |
95 | # faked asm |
96 | ../../Pico/Draw.o : ../../Pico/Draw.c |
97 | @echo $< |
98 | @$(GCC) $(COPT) $(DEFINC) -D_ASM_DRAW_C -c $< -o $@ |
99 | |