giz rc1 release
[picodrive.git] / platform / gp2x / Makefile
index 0eee0eb..5c903b1 100644 (file)
@@ -1,7 +1,7 @@
 \r
 # you may or may not need to change this\r
 #devkit_path = x:/stuff/dev/devkitgp2x/\r
-CROSS = arm-linux-\r
+export CROSS = arm-linux-\r
 #CROSS = $(devkit_path)bin/arm-linux-\r
 \r
 # settings\r
@@ -32,7 +32,12 @@ use_cyclone = 1
 endif\r
 \r
 DEFINC = -I../.. -I. -DARM -D__GP2X__ -D_UNZIP_SUPPORT # -DBENCHMARK\r
-COPT_COMMON = -static -Wall -O2 -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math\r
+COPT_COMMON = -static -Wall -Winline\r
+ifeq ($(DEBUG),)\r
+COPT_COMMON += -O2 -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math\r
+else\r
+COPT_COMMON += -ggdb\r
+endif\r
 ifeq "$(profile)" "1"\r
 COPT_COMMON += -fprofile-generate\r
 endif\r
@@ -48,10 +53,14 @@ LD = $(CROSS)ld
 OBJCOPY = $(CROSS)objcopy\r
 \r
 # frontend\r
-OBJS += main.o menu.o fonts.o gp2x.o usbjoy.o emu.o squidgehack.o asmutils.o cpuctrl.o readpng.o\r
+OBJS += main.o menu.o gp2x.o usbjoy.o emu.o squidgehack.o cpuctrl.o\r
 # 940 core control\r
 OBJS += 940ctl.o\r
 \r
+# common\r
+OBJS += ../common/emu.o ../common/menu.o ../common/fonts.o ../common/arm_utils.o \\r
+       ../common/readpng.o ../common/mp3_helix.o\r
+\r
 # Pico\r
 ifeq "$(amalgamate)" "1"\r
 OBJS += ../../PicoAll.o\r
@@ -103,8 +112,6 @@ OBJS += ../../zlib/gzio.o ../../zlib/inffast.o ../../zlib/inflate.o ../../zlib/i
        ../../zlib/deflate.o ../../zlib/crc32.o ../../zlib/adler32.o ../../zlib/zutil.o ../../zlib/compress.o\r
 # unzip\r
 OBJS += ../../unzip/unzip.o ../../unzip/unzip_stream.o\r
-# mp3\r
-OBJS += mp3.o\r
 # debug\r
 ifeq "$(debug_cyclone)" "1"\r
 OBJS += ../../Pico/_cyclone_debug.o ../../cpu/musashi/m68kdasm.o\r
@@ -130,7 +137,7 @@ endif
 \r
 all: PicoDrive.gpe\r
 \r
-PicoDrive.gpe : $(OBJS) helix/helix_mp3.a\r
+PicoDrive.gpe : $(OBJS) ../common/helix/helix_mp3.a\r
        @echo $@\r
        @$(GCC) -o $@ $(COPT) $^ -lm -lpng -Wl,-Map=PicoDrive.map\r
 ifeq ($(DEBUG),)\r
@@ -148,7 +155,7 @@ up: PicoDrive.gpe
 #      @cmd //C copy PicoDrive.gpe \\\\10.0.1.2\\gp2x\\mnt\\sd\\games\\PicoDrive\\\r
 \r
 \r
-testrefr.gpe : test.o gp2x.o asmutils.o\r
+testrefr.gpe : test.o gp2x.o\r
        @echo $@\r
        @$(GCC) $(COPT) $^ -o $@\r
        @$(STRIP) $@\r
@@ -175,7 +182,7 @@ testrefr.gpe : test.o gp2x.o asmutils.o
 ../../Pico/sound/mix_asm.o : ../../Pico/sound/mix.s\r
        @echo $<\r
        @$(AS) $(ASOPT) $< -o $@\r
-../../Pico/misc_asm.o : ../../Pico/misc.s\r
+../../Pico/misc_asm.o : ../../Pico/Misc.s\r
        @echo $<\r
        @$(AS) $(ASOPT) $< -o $@\r
 ../../Pico/cd/pico_asm.o : ../../Pico/cd/Pico.s\r
@@ -184,7 +191,7 @@ testrefr.gpe : test.o gp2x.o asmutils.o
 ../../Pico/cd/memory_asm.o : ../../Pico/cd/Memory.s\r
        @echo $<\r
        @$(AS) $(ASOPT) $< -o $@\r
-../../Pico/cd/misc_asm.o : ../../Pico/cd/misc.s\r
+../../Pico/cd/misc_asm.o : ../../Pico/cd/Misc.s\r
        @echo $<\r
        @$(AS) $(ASOPT) $< -o $@\r
 \r
@@ -198,8 +205,8 @@ testrefr.gpe : test.o gp2x.o asmutils.o
 \r
 \r
 # build helix libs\r
-helix/helix_mp3.a:\r
-       make -C helix\r
+../common/helix/helix_mp3.a:\r
+       make -C ../common/helix\r
 \r
 \r
 # cleanup\r