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