-# you may or may not need to change this\r
-#devkit_path = x:/stuff/dev/devkitgp2x/\r
-CROSS = arm-linux-\r
-#CROSS = $(devkit_path)bin/arm-linux-\r
-\r
-# settings\r
-dprint = 1\r
-#mz80 = 1\r
-#debug_cyclone = 1\r
-asm_memory = 0 # TODO\r
-asm_render = 1\r
-asm_ym2612 = 1\r
-asm_misc = 1\r
-#profile = 1\r
-#use_musashi = 1\r
-#up = 1\r
-\r
-DEFINC = -I../.. -I. -DARM -D__GP2X__ -D_UNZIP_SUPPORT # -DBENCHMARK\r
-COPT_COMMON = -static -s -O3 -ftracer -fstrength-reduce -Wall -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math\r
-ifeq "$(profile)" "1"\r
-COPT_COMMON += -fprofile-generate\r
-endif\r
-ifeq "$(profile)" "2"\r
-COPT_COMMON += -fprofile-use\r
-endif\r
-COPT = $(COPT_COMMON) -mtune=arm920t\r
-ASOPT = -mcpu=arm920t -mfloat-abi=soft\r
-GCC = $(CROSS)gcc\r
-STRIP = $(CROSS)strip\r
-AS = $(CROSS)as\r
-LD = $(CROSS)ld\r
-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\r
-# 940 core control\r
-OBJS += 940ctl.o\r
-# Pico\r
-OBJS += ../../Pico/Area.o ../../Pico/Cart.o ../../Pico/Utils.o ../../Pico/Memory.o ../../Pico/Misc.o \\r
- ../../Pico/Pico.o ../../Pico/Sek.o ../../Pico/VideoPort.o ../../Pico/Draw2.o ../../Pico/Draw.o \\r
- ../../Pico/Patch.o\r
-# Pico - CD\r
-OBJS += ../../Pico/cd/Pico.o ../../Pico/cd/Memory.o ../../Pico/cd/Sek.o ../../Pico/cd/LC89510.o \\r
- ../../Pico/cd/cd_sys.o ../../Pico/cd/cd_file.o ../../Pico/cd/gfx_cd.o \\r
- ../../Pico/cd/Area.o ../../Pico/cd/Misc.o ../../Pico/cd/pcm.o ../../Pico/cd/buffering.o\r
-# asm stuff\r
-ifeq "$(asm_render)" "1"\r
-DEFINC += -D_ASM_DRAW_C\r
-OBJS += ../../Pico/draw_asm.o ../../Pico/draw2_asm.o\r
-endif\r
-ifeq "$(asm_memory)" "1"\r
-DEFINC += -D_ASM_MEMORY_C\r
-OBJS += ../../Pico/memory_asm.o\r
-endif\r
-ifeq "$(asm_ym2612)" "1"\r
-DEFINC += -D_ASM_YM2612_C\r
-OBJS += ../../Pico/sound/ym2612_asm.o\r
-endif\r
-ifeq "$(asm_misc)" "1"\r
-DEFINC += -D_ASM_MISC_C\r
-OBJS += ../../Pico/misc_asm.o\r
+VER := $(shell head -n 1 ../common/version.h | \\r
+ sed 's/.*"\(.*\)\.\(.*\)".*/\1\2/g')\r
+BUILD := $(shell git describe HEAD | grep -- - | \\r
+ sed -e 's/.*\-\(.*\)\-.*/\1/')\r
+ifneq "$(BUILD)" ""\r
+VER := $(VER)_$(BUILD)\r