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