| 1 | #export CROSS = arm-none-linux-gnueabi-\r |
| 2 | CROSS ?= $(CROSS_COMPILE)\r |
| 3 | LIBROOT = /home/notaz/dev/pnd/libroot\r |
| 4 | PND_MAKE ?= $(HOME)/dev/pnd/src/pandora-libraries/testdata/scripts/pnd_make.sh\r |
| 5 | \r |
| 6 | # settings\r |
| 7 | use_cyclone = 1\r |
| 8 | #use_musashi = 1\r |
| 9 | use_drz80 = 1\r |
| 10 | use_sh2drc = 1\r |
| 11 | #use_sh2mame = 1\r |
| 12 | \r |
| 13 | asm_memory = 1\r |
| 14 | asm_render = 1\r |
| 15 | asm_ym2612 = 1\r |
| 16 | asm_misc = 1\r |
| 17 | asm_cdpico = 1\r |
| 18 | asm_cdmemory = 1\r |
| 19 | #profile = 1\r |
| 20 | #drc_debug = 3\r |
| 21 | \r |
| 22 | -include Makefile.local\r |
| 23 | \r |
| 24 | ifeq "$(use_musashi)" "1"\r |
| 25 | # due to CPU stop flag acces\r |
| 26 | asm_cdpico = 0\r |
| 27 | asm_cdmemory = 0\r |
| 28 | endif\r |
| 29 | \r |
| 30 | ARCH = arm\r |
| 31 | DEFINES += ARM PANDORA IN_EVDEV\r |
| 32 | CFLAGS += -I../.. -I. -I$(LIBROOT)/include\r |
| 33 | CFLAGS += -Wall -Winline -mcpu=cortex-a8 -mtune=cortex-a8 -march=armv7-a\r |
| 34 | ifeq ($(DEBUG),)\r |
| 35 | CFLAGS += -O2 -fomit-frame-pointer -fstrict-aliasing -ffast-math\r |
| 36 | endif\r |
| 37 | LDFLAGS += -L$(LIBROOT)/lib -Wl,-Bstatic -lpng -Wl,-Bdynamic -lm -lpthread -ldl\r |
| 38 | ASFLAGS = -mcpu=cortex-a8\r |
| 39 | CC = $(CROSS)gcc\r |
| 40 | STRIP = $(CROSS)strip\r |
| 41 | AS = $(CROSS)as\r |
| 42 | LD = $(CROSS)ld\r |
| 43 | OBJCOPY = $(CROSS)objcopy\r |
| 44 | \r |
| 45 | # frontend\r |
| 46 | OBJS += plat.o asm_utils.o\r |
| 47 | \r |
| 48 | # common\r |
| 49 | OBJS += platform/common/emu.o platform/common/menu.o platform/common/fonts.o platform/common/config.o \\r |
| 50 | platform/common/arm_utils.o platform/common/mp3_helix.o platform/common/arm_linux.o \\r |
| 51 | platform/common/readpng.o platform/common/input.o platform/common/main.o platform/common/mp3.o \\r |
| 52 | platform/linux/fbdev.o platform/linux/in_evdev.o platform/linux/sndout_oss.o \\r |
| 53 | platform/linux/plat.o platform/linux/oshide.o\r |
| 54 | \r |
| 55 | # ARM stuff\r |
| 56 | OBJS += pico/carthw/svp/compiler.o pico/carthw/svp/stub_arm.o\r |
| 57 | OBJS += pico/sound/mix_arm.o\r |
| 58 | \r |
| 59 | # zlib\r |
| 60 | OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \\r |
| 61 | zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o\r |
| 62 | # unzip\r |
| 63 | OBJS += unzip/unzip.o unzip/unzip_stream.o\r |
| 64 | \r |
| 65 | vpath %.c = ../..\r |
| 66 | vpath %.s = ../..\r |
| 67 | vpath %.S = ../..\r |
| 68 | DIRS += platform/linux zlib unzip\r |
| 69 | \r |
| 70 | all: mkdirs PicoDrive picorestore\r |
| 71 | \r |
| 72 | include ../common/common.mak\r |
| 73 | include ../common/common_arm.mak\r |
| 74 | include ../common/revision.mak\r |
| 75 | \r |
| 76 | CFLAGS += $(addprefix -D,$(DEFINES))\r |
| 77 | \r |
| 78 | PicoDrive : $(OBJS) ../common/helix/$(CROSS)helix-mp3.a\r |
| 79 | @echo ">>>" $@\r |
| 80 | $(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) -Wl,-Map=PicoDrive.map\r |
| 81 | ifeq ($(DEBUG),)\r |
| 82 | $(STRIP) $@\r |
| 83 | endif\r |
| 84 | \r |
| 85 | clean: tidy\r |
| 86 | $(RM) PicoDrive\r |
| 87 | tidy:\r |
| 88 | $(RM) $(OBJS)\r |
| 89 | \r |
| 90 | readme.txt: ../../tools/textfilter ../base_readme.txt\r |
| 91 | ../../tools/textfilter ../base_readme.txt $@ PANDORA\r |
| 92 | \r |
| 93 | PicoDrive.pxml: PicoDrive.pxml.template\r |
| 94 | ./make_pxml.sh PicoDrive.pxml.template PicoDrive.pxml\r |
| 95 | \r |
| 96 | platform/common/menu.o: menu.c\r |
| 97 | \r |
| 98 | # ----------- release -----------\r |
| 99 | \r |
| 100 | VER = $(shell head -n 1 version.h | sed 's/.*"\(.*\)\.\(.*\)".*/\1\2/g')\r |
| 101 | \r |
| 102 | rel: PicoDrive PicoDrive.run picorestore ../../pico/carthw.cfg readme.txt \\r |
| 103 | skin PicoDrive.png PicoDrive_p.png PicoDrive.pxml\r |
| 104 | rm -rf out\r |
| 105 | mkdir out\r |
| 106 | cp -r $^ out/\r |
| 107 | $(PND_MAKE) -p PicoDrive_$(VER).pnd -d out -x PicoDrive.pxml -i PicoDrive.png -c\r |