libretro: satisfy vita's dynarec needs in a cleaner way
[picodrive.git] / platform / gp2x / code940 / Makefile
CommitLineData
42c7b147 1# you may or may not need to change this\r
2#devkit_path = x:/stuff/dev/devkitgp2x/\r
8beb4430 3devkit_path ?= $(HOME)/opt/devkitGP2X/\r
42c7b147 4lgcc_path = $(devkit_path)lib/gcc/arm-linux/4.0.3/\r
8beb4430 5CROSS = arm-linux-\r
42c7b147 6#CROSS = $(devkit_path)bin/arm-linux-\r
7\r
8# settings\r
9#up = 1\r
10\r
8beb4430 11CFLAGS += -O2 -Wall -fomit-frame-pointer -fstrict-aliasing -ffast-math\r
12CFLAGS += -I../.. -I. -D__GP2X__ -DARM\r
13CFLAGS += -mcpu=arm940t -mtune=arm940t\r
14LDFLAGS = -static -s -e code940 -Ttext 0x0 -L$(lgcc_path) -lgcc\r
15\r
42c7b147 16GCC = $(CROSS)gcc\r
17STRIP = $(CROSS)strip\r
18AS = $(CROSS)as\r
19LD = $(CROSS)ld\r
20OBJCOPY = $(CROSS)objcopy\r
21\r
7c18e34a 22vpath %.c = ../../common\r
23\r
e4fb433c 24BIN = pico940_v3.bin\r
d524c827 25\r
26all: $(BIN)\r
42c7b147 27\r
42c7b147 28.c.o:\r
e4fb433c 29 @echo ">>>" $<\r
7c34867a 30 $(GCC) $(CFLAGS) -c $< -o $@\r
42c7b147 31.s.o:\r
e4fb433c 32 @echo ">>>" $<\r
7c34867a 33 $(GCC) $(CFLAGS) -c $< -o $@\r
42c7b147 34\r
35\r
36# stuff for 940 core\r
37\r
38# init, emu_control, emu\r
7c18e34a 39OBJS940 += 940init.o 940.o 940ym2612.o memcpy.o misc_arm.o mp3.o\r
42c7b147 40# the asm code seems to be faster when run on 920, but not on 940 for some reason\r
41# OBJS940 += ../../Pico/sound/ym2612_asm.o\r
42\r
43# uClibc library code\r
44OBJS940 += uClibc/memset.o uClibc/s_floor.o uClibc/e_pow.o uClibc/e_sqrt.o uClibc/s_fabs.o\r
45OBJS940 += uClibc/s_scalbn.o uClibc/s_copysign.o uClibc/k_sin.o uClibc/k_cos.o uClibc/s_sin.o\r
46OBJS940 += uClibc/e_rem_pio2.o uClibc/k_rem_pio2.o uClibc/e_log.o uClibc/wrappers.o\r
47\r
7c34867a 48$(BIN) : code940.elf\r
e4fb433c 49 @echo ">>>" $@\r
50 $(OBJCOPY) -O binary $< $@\r
42c7b147 51\r
7c34867a 52code940.elf : $(OBJS940) ../../common/helix/$(CROSS)helix-mp3.a\r
e4fb433c 53 @echo ">>>" $@\r
8beb4430 54 $(LD) $^ $(LDFLAGS) -o $@ -Map code940.map\r
42c7b147 55\r
7c34867a 56940ym2612.o : ../../../pico/sound/ym2612.c\r
e4fb433c 57 @echo ">>>" $@\r
7c34867a 58 $(GCC) $(CFLAGS) -Os -DEXTERNAL_YM2612 -c $< -o $@\r
4f265db7 59\r
7c34867a 60mix.o : ../../../pico/sound/mix.s\r
e4fb433c 61 @echo ">>>" $@\r
7c34867a 62 $(GCC) $(CFLAGS) -DEXTERNAL_YM2612 -c $< -o $@\r
63misc_arm.o : ../../../pico/misc_arm.s\r
e4fb433c 64 @echo ">>>" $@\r
7c34867a 65 $(GCC) $(CFLAGS) -DEXTERNAL_YM2612 -c $< -o $@\r
42c7b147 66\r
da42200b 67../../common/helix/helix_mp3.a:\r
68 @make -C ../../common/helix/\r
42c7b147 69\r
70\r
d524c827 71up: $(BIN)\r
72 @cp -v $< /mnt/gp2x/mnt/sd/emus/PicoDrive/\r
51a902ae 73\r
74\r
42c7b147 75# cleanup\r
76clean: tidy\r
7c34867a 77 $(RM) $(BIN)\r
42c7b147 78tidy:\r
7c34867a 79 $(RM) code940.elf $(OBJS940) code940.map\r
42c7b147 80\r
81\r
8beb4430 82##\r
42c7b147 83OBJSMP3T = mp3test.o ../gp2x.o ../asmutils.o ../usbjoy.o\r
84\r
85mp3test.gpe : $(OBJSMP3T) ../helix/helix_mp3.a\r
86 $(GCC) -static -o $@ $^\r
87 $(STRIP) $@\r
88 @cp -v $@ /mnt/gp2x/mnt/sd\r
89\r
90cleanmp3test:\r
91 $(RM) $(OBJSMP3T) mp3test.gpe\r
92\r