| 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/fonts.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/Patch.o |
| 32 | # Pico - CD |
| 33 | OBJS += ../../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 |
| 37 | OBJS += ../../Pico/sound/sound.o ../../Pico/sound/sn76496.o ../../Pico/sound/ym2612.o ../../Pico/sound/mix.o |
| 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 |
| 42 | OBJS += ../../unzip/unzip.o ../../unzip/unzip_stream.o |
| 43 | # mp3 |
| 44 | OBJS += ../gp2x/mp3.o |
| 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 |
| 66 | |
| 67 | PicoDrive : $(OBJS) |
| 68 | @echo $@ |
| 69 | @$(GCC) $(COPT) $(OBJS) ../gp2x/helix/helix_mp3_x86.a $(LDFLAGS) -lm -o $@ |
| 70 | |
| 71 | |
| 72 | ../../cpu/mz80/mz80.o : ../../cpu/mz80/mz80.asm |
| 73 | @echo $@ |
| 74 | @nasm -f elf $< -o $@ |
| 75 | |
| 76 | ../../cpu/mz80/mz80.asm : |
| 77 | @make -C ../../cpu/mz80/ |
| 78 | |
| 79 | .c.o: |
| 80 | @echo $< |
| 81 | @$(GCC) $(COPT) $(DEFINC) -c $< -o $@ |
| 82 | .s.o: |
| 83 | @echo $< |
| 84 | @$(GCC) $(COPT) $(DEFINC) -c $< -o $@ |
| 85 | |
| 86 | |
| 87 | ../../Pico/sound/ym2612.o : ../../Pico/sound/ym2612.c |
| 88 | @echo $@ |
| 89 | @$(GCC) $(COPT_COMMON) $(DEFINC) -DEXTERNAL_YM2612 -c $< -o $@ # -mtune=arm940t |
| 90 | |
| 91 | # faked asm |
| 92 | ../../Pico/Draw.o : ../../Pico/Draw.c |
| 93 | @echo $< |
| 94 | @$(GCC) $(COPT) $(DEFINC) -D_ASM_DRAW_C -c $< -o $@ |
| 95 | |