blob: d4715bdca88051f7e551062a3ac10f857b2fdd3b [file] [log] [blame]
Lorenzo Miori66aa00d2013-07-23 16:24:19 +02001.PHONY: all clean dirs bmp2rb
2CFLAGS += -O1 -g -std=c99 -W -Wall $(DEFINES)
3PROGS = bmp2rb fwcrypt fwdecrypt
4CROSS_COMPILE = arm-ypr0-linux-gnueabi-
5R1_SAFEMODE_DIR = files/r1/etc/safemode
6R0_SAFEMODE_DIR = files/r0/etc/safemode
7DIRS = $(R1_SAFEMODE_DIR) $(R0_SAFEMODE_DIR)
8R1_IMAGES = $(subst .bmp,.raw,$(addprefix $(R1_SAFEMODE_DIR)/,$(notdir $(wildcard files/images/r1/*.bmp))))
9R0_IMAGES = $(subst .bmp,.raw,$(addprefix $(R0_SAFEMODE_DIR)/,$(notdir $(wildcard files/images/r0/*.bmp))))
10BMP2RB = ../../tools/bmp2rb
Thomas Martitz249bba02011-12-24 11:56:46 +000011
Lorenzo Miori66aa00d2013-07-23 16:24:19 +020012all: $(R1_SAFEMODE_DIR)/cable_detect $(PROGS) $(R1_IMAGES) $(R0_IMAGES)
13 $(MAKE) -C cramfs-1.1
Thomas Martitz249bba02011-12-24 11:56:46 +000014
Lorenzo Miorida8a6a92013-07-09 18:20:08 +020015fwdecrypt: fwdecrypt.o common.o ../../tools/fwpatcher/md5.o
Lorenzo Miorida8a6a92013-07-09 18:20:08 +020016
17fwcrypt: fwcrypt.o common.o ../../tools/fwpatcher/md5.o
Lorenzo Miori66aa00d2013-07-23 16:24:19 +020018
19$(BMP2RB):
20 $(MAKE) -C ../../tools/ bmp2rb
21
22$(R1_SAFEMODE_DIR)/cable_detect: cable_detect.c $(R1_SAFEMODE_DIR)
23 $(CROSS_COMPILE)$(CC) $(CFLAGS) $< -o $@
24
25$(R1_SAFEMODE_DIR)/%.raw: files/images/r1/%.bmp $(BMP2RB) $(R1_SAFEMODE_DIR)
26 $(BMP2RB) -r -f 9 $< > $@
27
28$(R0_SAFEMODE_DIR)/%.raw: files/images/r0/%.bmp $(BMP2RB) $(R0_SAFEMODE_DIR)
29 $(BMP2RB) -r -f 9 $< > $@
30
31$(DIRS):
32 $(SILENT)mkdir -p $@
33
34dirs: $(DIRS)
35
36bmp2rb: $(BMP2RB)
Thomas Martitz249bba02011-12-24 11:56:46 +000037
38clean:
Lorenzo Miori66aa00d2013-07-23 16:24:19 +020039 $(MAKE) -C cramfs-1.1 clean
40 rm -f *.o fwdecrypt fwcrypt
41 rm -rf $(R1_SAFEMODE_DIR)/../../etc $(R0_SAFEMODE_DIR)/../../etc