summaryrefslogtreecommitdiffstats
path: root/utils/ypr0tools/Makefile
diff options
context:
space:
mode:
authorLorenzo Miori <memorys60@gmail.com>2013-07-23 16:24:19 +0200
committerThomas Martitz <kugel@rockbox.org>2013-09-16 12:55:48 +0200
commit66aa00d3e051956b634ea157c71782add41d7ed1 (patch)
tree4c992994bbae116dae8ac90a08710fe84e4f4694 /utils/ypr0tools/Makefile
parent5ef1e2dcfa2845d7196223af2e170798f7621df6 (diff)
downloadrockbox-66aa00d3e051956b634ea157c71782add41d7ed1.tar.gz
rockbox-66aa00d3e051956b634ea157c71782add41d7ed1.tar.bz2
rockbox-66aa00d3e051956b634ea157c71782add41d7ed1.zip
Samsung YP-R0/YP-R1 Safe Mode improvement
This is an improvement for the special mode present in the samsung ypr0 target. Apart adding new useful functionalities, it fixes a random disconnection bug, solved by debouncing and fully support to YP-R1 target. This opens also the possibility to interface this operating mode to rockbox USB functionality. Change-Id: Id70541541fcfaa1234328485fab0696a3bd491c9
Diffstat (limited to 'utils/ypr0tools/Makefile')
-rw-r--r--utils/ypr0tools/Makefile47
1 files changed, 34 insertions, 13 deletions
diff --git a/utils/ypr0tools/Makefile b/utils/ypr0tools/Makefile
index 3efdc61443..d4715bdca8 100644
--- a/utils/ypr0tools/Makefile
+++ b/utils/ypr0tools/Makefile
@@ -1,20 +1,41 @@
-DEFINES=
-CC=gcc
-LD=gcc
-CFLAGS=-g -std=c99 -W -Wall $(DEFINES)
-LDFLAGS=
-BINS=fwcrypt fwdecrypt
+.PHONY: all clean dirs bmp2rb
+CFLAGS += -O1 -g -std=c99 -W -Wall $(DEFINES)
+PROGS = bmp2rb fwcrypt fwdecrypt
+CROSS_COMPILE = arm-ypr0-linux-gnueabi-
+R1_SAFEMODE_DIR = files/r1/etc/safemode
+R0_SAFEMODE_DIR = files/r0/etc/safemode
+DIRS = $(R1_SAFEMODE_DIR) $(R0_SAFEMODE_DIR)
+R1_IMAGES = $(subst .bmp,.raw,$(addprefix $(R1_SAFEMODE_DIR)/,$(notdir $(wildcard files/images/r1/*.bmp))))
+R0_IMAGES = $(subst .bmp,.raw,$(addprefix $(R0_SAFEMODE_DIR)/,$(notdir $(wildcard files/images/r0/*.bmp))))
+BMP2RB = ../../tools/bmp2rb
-all: $(BINS)
-
-%.o: %.c
- $(CC) $(CFLAGS) -c -o $@ $<
+all: $(R1_SAFEMODE_DIR)/cable_detect $(PROGS) $(R1_IMAGES) $(R0_IMAGES)
+ $(MAKE) -C cramfs-1.1
fwdecrypt: fwdecrypt.o common.o ../../tools/fwpatcher/md5.o
- $(LD) -o $@ $^ $(LDFLAGS)
fwcrypt: fwcrypt.o common.o ../../tools/fwpatcher/md5.o
- $(LD) -o $@ $^ $(LDFLAGS)
+
+$(BMP2RB):
+ $(MAKE) -C ../../tools/ bmp2rb
+
+$(R1_SAFEMODE_DIR)/cable_detect: cable_detect.c $(R1_SAFEMODE_DIR)
+ $(CROSS_COMPILE)$(CC) $(CFLAGS) $< -o $@
+
+$(R1_SAFEMODE_DIR)/%.raw: files/images/r1/%.bmp $(BMP2RB) $(R1_SAFEMODE_DIR)
+ $(BMP2RB) -r -f 9 $< > $@
+
+$(R0_SAFEMODE_DIR)/%.raw: files/images/r0/%.bmp $(BMP2RB) $(R0_SAFEMODE_DIR)
+ $(BMP2RB) -r -f 9 $< > $@
+
+$(DIRS):
+ $(SILENT)mkdir -p $@
+
+dirs: $(DIRS)
+
+bmp2rb: $(BMP2RB)
clean:
- rm -fr *.o $(BINS)
+ $(MAKE) -C cramfs-1.1 clean
+ rm -f *.o fwdecrypt fwcrypt
+ rm -rf $(R1_SAFEMODE_DIR)/../../etc $(R0_SAFEMODE_DIR)/../../etc